This was an answer provided to a question I asked previously. I followed the other approaches to the question; however, I couldn't seem to follow this one:
$$\frac{1-z}{1+z}=\dfrac{1-e^{i\theta}}{1+e^{i\theta}}=\dfrac{e^{-\frac{i\theta}{2}}-e^{\frac{i\theta}{2}}}{e^{-\frac{i\theta}{2}}+e^{\frac{i\theta}{2}}}=\dfrac{-2i\sin\frac{\theta}{2}}{2\cos\frac{\theta}{2}}=-i\tan\frac{\theta}{2}$$
How do you progress from the 2nd term to the 3rd term and then from the 3rd term to the 4th? What identity/logic is used etc.?