Consider right triangle ABC wit hright angle C. Then by the Pythagorean theorem,
[tex]AB^2=AC^2+BC^2.[/tex]
Divide this equality by [tex]AB^2:[/tex]
[tex]\dfrac{AB^2}{AB^2}=\dfrac{AC^2}{AB^2}+\dfrac{BC^2}{AB^2},\\ \\1=\left(\dfrac{AC}{AB}\right)^2+\left(\dfrac{BC}{AB}\right)^2.[/tex]
Note that
[tex]\dfrac{AC}{AB}=\cos \angle A,\\ \\\dfrac{BC}{AB}=\sin \angle A.[/tex]
Then
[tex]1=\cos^2 \angle A+\sin^2 \angle A.[/tex]
Suppose that you know the sine of the angle, then tha cosine of the angle can be determined as
[tex]\cos \angle A=\pm\sqrt{1-\sin^2 \angle A}.[/tex]
If you divide the equality [tex]1=\cos^2 \angle A+\sin^2 \angle A[/tex] by the [tex]\cos ^2 \angle A,[/tex] you get
[tex]\dfrac{1}{\cos^2 \angle A}=1+\tan^2 \angle A\Rightarrow \tan^2 \angle A=\dfrac{1}{\cos^2 \angle A}-1.[/tex]