Do you not see how you would replace $\displaystyle \frac{1}{1 - \cos (x)}$ in your line with the expression for it that I gave you? I can understand it might be hard to see by yourself, but given that I have pointed it out - three times now - do you not see that you multiply the numerator and denominator of your expression with $\displaystyle \frac{1 + \cos(x)}{1 + \cos (x)}$ ....?