You can put this solution on YOUR website! (For easier typing, we will let theta = x)
If we multiply the numerator and denominator by 1 - sin(x), and simplify we get:
(1 - 2sin(x) + sin^2(x))/cos^2(x) = (1-2sin(x))/cos^2(x) + tan^2(x)
Simplifying the first term gives
sec^2(x) - 2sec(x)tan(x) + tan^2(x) = (sec(x) - tan(x))^2