I find that its easier to convert directly to sine and cosine. I recognize the trig identities better.
(sinX/cosX)/(1-cosX/sinX) + (cosX/sinX)/(1-sinX/cosX)
There are too many fractions. Turn the 1's into sinX"/"sinX and cosX"/"cosX, then combine the denominators into fractions over sinX and cosX.
(sinX/cosX)/((sinX-cosX)/sinX) + (cosX/sinX)/((cosX-sinX)/cosX)
Now we can get rid of these fractions of fractions by flipping the denominators and multiplying them by the numerators.
sin^2X/(cosX(sinX-cosX)) + cos^2X/(sinX(cosX-sinX))
Cross multiply the denominators to get a common denominator.
(sin^3X(cosX-sinX) + cos^3(sinX-cosX))/(sinXcosX(sinX-cosX)(cosX-sinX))
Multiply through the parenthesis.
(sin^3XcosX-sin^4X - cos^4X+sinXcos^3X)/(sinXcosX(-sin^2X+2sinXcosX - cos^2X))
Pull a factor of sinXcosX out of two of the terms in the numerator. There is also a -(sin^2X+cos^2X) in the denominator, which by the Pythagorean theorem is equal to -1.
((sin^2X + cos^2X)sinXcosX -sin^4X - cos^4X)/(sinXcosX(2sinXcosX-1))
We can use the Pythagorean theorem again on the top. Also, pull out a -1 from the ""^4 terms in the numerator.
(sinXcosX -(sin^4X + cos^4X))/(sinXcosX(2sinXcosX-1))
Split the sin^4X term into two sin^2X terms. Then we can use the Pythagorean theorem, sin^2X = 1-cos^2X to replace one of the sin^2 terms. Do a similar action with the cosX^4 term.
(sinXcosX -(sin^2Xsin^2X+cos^2Xcos^2X))/(sinXcosX(2sinXcosX-1))
(sinXcosX -(sin^2X(1-cos^2X)+cos^2X(1-sin^2X)))/(sinXcosX(2sinXcosX-1))
Multiply through the terms in the top parenthesis.
(sinXcosX -(sin^2X-2sin^2Xcos^2X +cos^2X))/(sinXcosX(2sinXcosX-1))
Once again Pythagorean theorem out the sin^2X and cos^2X terms.
(sinXcosX -(1-2sin^2Xcos^2X))/(sinXcosX(2sinXcosX-1))
Multiply the -1 through the parenthesis in the numerator.
( sinXcosX+2sin^2Xcos^2X-1)/(sinXcosX(2sinXcosX-1))
Pull out a factor of sinXcosX from two of the terms in the numerator.
( sinXcosX(1+2sinXcosX)-1)/(sinXcosX(2sinXcosX-1))
Adding and subtracting a 1 inside the parenthesis is the same as adding 0.
( sinXcosX(1+2sinXcosX+(1-1))-1)/(sinXcosX(2sinXcosX-1))
Combine the two +1 terms in the parenthesis.
( sinXcosX(2sinXcosX-1 +2)-1)/(sinXcosX(2sinXcosX-1))
Now pull the 2 out. Remember to multiply by sinXcosX.
( sinXcosX(2sinXcosX-1) + 2sinXcosX-1)/(sinXcosX(2sinXcosX-1))
Finally we have a term in the numerator that is the same as the denominator. Split the addition terms in the numerator to get;
(sinXcosX(2sinXcosX-1))/(sinXcosX(2sinXcosX-1)) + (2sinXcosX-1)/(sinXcosX(2sinXcosX-1))
The first term simplifies to 1 and in the second term the (2sinXcosX-1)s cancel out.
1+1/(sinXcosX)
Now convert to secXand cscX
1+secXcscX