<s>[INST] 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}.$$
 [/INST] 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.
</s>