how does (sec^2(θ)-tan^2(θ))/sec(θ)-tan(θ) factor out into

((sec(θ)-tan(θ))(sec(θ)+tan(θ)))/sec(θ)-tan(θ)

recall that

sec^ θ = tan^2 θ + 1
then, ...
(sec^2(θ)-tan^2(θ))/sec(θ)-tan(θ)
= (tan^2 + 1 - tan^2 θ)/(sec θ - tan θ)
= 1/(secθ - tanθ)

other part :
((sec(θ)-tan(θ))(sec(θ)+tan(θ)))/sec(θ)-tan(θ)
notice that the denominator is the same, so all we have to do is show that
(sec(θ)-tan(θ)(sec(θ)+tan(θ) = 1
LS = sec^2 θ - tan^2 θ <------ by the difference of squares thingy
= tan^2 θ + 1 - tan^2 θ
= 1
= RS