Line 5 is got by factoring sin^2 x from line 4. Then divide both sides by sin^2 x to get line 6. Two sides are equal in line 6, so x=x and this statement is true for all x values (except x=0 because we divided both sides by sin^2 x, so you should check this for x=0 manually)
Firstly, thanks for your quick response. However, we are taught not to do proving like this... We have to do it something like this:
LHS: xxxxxxxx
= xxxxxxxxxx
= xxxxxxxxxx
= xxxxxxxxxx
= xxxxxxxxxx = RHS
Would you mind doing it in this format so that i can understand better? Thanks!