By definition of tangent,
[tex]\tan\theta=\dfrac{\sin\theta}{\cos\theta}\implies\tan^2\theta=\dfrac{\sin^2\theta}{\cos^2\theta}[/tex]
Distribute the squared cosine:
[tex]\cos^2\theta\left(1+\dfrac{\sin^2\theta}{\cos^2\theta}\right)=\cos^2\theta+\sin^2\theta=1[/tex]
where the last step is simply applying the Pythagorean identity.