<s>[INST] De Moivre Theorem Express the following function in the form of $a+ib$, $z$ being written for $\cos \theta+i \sin \theta$
$$\frac{1}{1+z^2}$$
My attempt, 
$$\frac{1}{1+z^2}=\frac{1}{1+(\cos \theta +i \sin \theta)^2}
  =\frac{1}{1+\cos 2\theta+i \sin 2\theta}$$
How to proceed? The given answer is $\frac{1}{2}(1-i \tan \theta)$
 [/INST] Continuing from where you stopped:
$$\begin{align}
\frac 1 {1+\cos 2\theta + {\rm i} \sin 2\theta} = \\
\frac {1+\cos 2\theta - {\rm i} \sin 2\theta} {(1+\cos 2\theta + {\rm i} \sin 2\theta) (1+\cos 2\theta - {\rm i} \sin 2\theta)} = \\
\frac {1+\cos 2\theta - {\rm i} \sin 2\theta} {(1+\cos 2\theta)^2 + \sin^2 2\theta} = \\
\frac {1+\cos 2\theta - {\rm i} \sin 2\theta} {1 + 2 \cos 2 \theta + \cos^2 2 \theta + \sin^2 2 \theta} = \\
\frac {1+\cos 2\theta - {\rm i} \sin 2\theta} {2 + 2 \cos 2 \theta} = \\
\frac {1+\cos 2\theta} {2 + 2 \cos 2 \theta} - {\rm i} \frac {\sin 2\theta} {2 + 2 \cos 2 \theta} = \\
\frac 1 2 - {\rm i} \frac 1 2 \frac {\sin 2\theta} {1 + \cos 2 \theta} = \\
\frac 1 2 \left( 1 - {\rm i} \frac {\sin 2\theta} {1 + \cos 2 \theta} \right) = \\
\frac 1 2 \left( 1 - {\rm i} \frac {2 \sin \theta \cos \theta} {1 + 2 \cos^2 \theta - 1} \right) = \\
\frac 1 2 \left( 1 - {\rm i} \tan \theta \right)
\end{align}$$
</s>