<s>[INST] How to prove the identity $\frac{1}{\sin(z)} = \cot(z) + \tan(\frac{z}{2})$? $$\frac{1}{\sin(z)} = \cot (z) + \tan (\tfrac{z}{2})$$
I did this: 
First attempt: $$\displaystyle{\frac{1}{\sin (z)} = \frac{\cos (z)}{\sin (z)} + \frac{\sin (\frac{z}{2})}{ \cos (\frac{z}{2})} = \frac{\cos (z) }{\sin (z)} + \frac{2\sin(\frac{z}{4})\cos(\frac{z}{4})}{\cos^{2}(\frac{z}{4})-\sin^{2}(\frac{z}{4})}} = $$
$$\frac{\cos (z)(\cos^{2}(\frac{z}{4})-\sin^{2}(\frac{z}{4}))+2\sin z \sin(\frac{z}{4})\cos(\frac{z}{4})}{\sin (z)(\cos^{2}(\frac{z}{4})-\sin^{2}(\frac{z}{4}))}$$
Stuck.
Second attempt: 
$$\displaystyle{\frac{1}{\sin z} = \left(\frac{1}{2i}(e^{iz}-e^{-iz})\right)^{-1} = 2i\left(\frac{1}{e^{iz}-e^{-iz}}\right)}$$
Stuck.
Does anybody see a way to continue?
 [/INST] Let $w = \frac{z}{2}$. Then
$$
\cot(2w) + \tan(w) = \frac{\cos^2(w)-\sin^2(w)}{2 \sin(w) \cos(w)} + \frac{\sin(w)}{\cos(w)} = \frac{1}{\cos(w)} \left( \frac{\cos^2(w)-\sin^2(w) + 2 \sin^2(w)}{2 \sin(w)} \right)
$$
The numerator becomes 1, and we arrive at the result $\frac{1}{2 \sin(w) \cos(w)} = \frac{1}{\cos(2w)} = \frac{1}{\cos(z)}$.
</s>