RHS = (1/ sin x + cosx / sin x) ^2 = (1+cosx)^2 / sin^2 x
= (1+cos x)^2 / (1- cos^2 x)
= (1+cos x )(1 + cos x ) / (1+cosx)(1-cosx)
= (1+cosx ) / ( 1- cosx )
for the question asked and get the right answer , the RHS question should be (csc^2 x - cot^2 x)