<s>[INST] From $\frac{1-\cos x}{\sin x}$ to $\tan\frac{x}{2}$ How can I write $\frac{1-\cos x}{\sin x}$ as $\tan\frac{x}{2}$? I wrote $\sin x$ as $2\sin\frac{x}{2} \cos\frac{x}{2}$ also used the double angle identity for $\cos$ but wasn't able to make much progress
 [/INST] $$\cos(a+b)=\cos a \cos b -sin a sin b\\cos(x+x)=cos x \cos x -\sin x \sin x\\cos(2x)=cos^2x-sin^2x\\cos(2x)=cos^2x-(1-cos^2x)=2cos^2x-1\\or =(1-\sin^2x)-\sin^2x\\so\\1-cos(2x)=2sin^2x\\$$put there x instead of 2x $$1-cos(x)=2sin^2(\frac{x}{2})\\\frac{1-cos(x)}{sinx}=\frac{2sin^2(\frac{x}{2})}{2sin(\frac{x}{2})cos(\frac{x}{2})}=\frac{sin(\frac{x}{2})}{cos(\frac{x}{2})}=\\tan(\frac{x}{2})$$
</s>