Arithmetic of complex numbers 
If $z = \cos x + i\sin x$ , show that 
  $$\frac{2}{1+z} =1-i\tan\left(\frac{x}{2}\right),$$ 

I get up to:
$$\frac{1+\cos x -i\sin x}{1+\cos x}.$$
 A: You can apply the Weierstrass substitutions (a bit of a misnomer, but that's how they're commonly known).
Note that if $\displaystyle t = \tan \frac x2$, then:
$$\sin x = \frac{2t}{1+t^2}$$
and
$$\cos x = \frac{1-t^2}{1+t^2}$$
So:
$$z = \frac{1}{1+t^2}(1-t^2 + i2t)$$
$$1 + z = \frac{1}{1+t^2}(1-t^2 + i2t) + \frac{1+t^2}{1+t^2} = \frac{2}{1+t^2}(1+it)$$
$$\frac{2}{1+z} = (1+t^2)\frac{1}{1+it} = (1+t^2)\frac{1-it}{1+t^2} = 1-it$$
as required.
A: Note that
\begin{align*}\frac{2}{1+z}&=\frac{2(1+\overline{z})}{|1+z|^2}=\frac{2(1+\cos x - i\sin x)}{(1+\cos x)^2 + (\sin x)^2}\\
&=\frac{2(1+\cos x - i\sin x)}{2(1+\cos x)}=1-i\cdot\frac{\sin x}{1+\cos x}
\end{align*}
and recall the tangent half-angle formula. 
A: Showing that the two numbers are equal can be done by showing that the magnitude and the argument for both numbers are the same.
Magnitude:
$$1+z = 1+\cos x + i\sin x$$
$$|1+z| = \sqrt{1 + 2 \cos x + \cos^2 x + \sin^2 x} = \sqrt{2+2\cos x}$$
$$| \frac{2}{1+z}| = \frac{\sqrt{2}}{\sqrt{1 + \cos x}} $$
$$|1-it| = \sqrt{1+t^2} = \sqrt{1 + \tan^2(x/2)} = \sec (x/2)$$
And the two are the same by trigonometric identity
Argument:
$$ \arg(1+z) = \tan^{-1} \frac{\sin x}{1+ \cos x} = \tan^{-1} \tan (x/2) = x/2$$
$$ \arg(\frac{2}{1+z}) = - x/2$$
$$ \arg(1-it) = \tan^{-1} (-\tan (x/2) = -x/2$$
