solving a basic complex equation but using de Moivres theorem I have a question which should be super super easy!
If I was to solve $z^2 = 1+i$ how would I do this using de-moivres theorem?
I have the answer here in front of me so I don't want the answer, I just dont understand the method very well!
Any help would be appreciated! I haven't had much experience with complex numbers and have just started a complex analysis course.
Many thanks

Let $1+i=r(\cos\theta+i\sin\theta)$ where  $r\ge0,\theta $ are real
Equating the real & the imaginary parts, $r\cos\theta=1,r\sin\theta=1$ 
Squaring and adding we get $r^2(\cos^2\theta+\sin^2\theta)=1^2+1^2\implies r^2=2\implies r=\sqrt2$ as $r\not<0$
So, $\cos\theta=\frac1{\sqrt2}>0$ and $\sin\theta=\frac1{\sqrt2}>0\implies \theta=\frac\pi4$
So, $z^2=\sqrt2(\cos\frac\pi4+i\sin\frac\pi4)$
Using de Moivre's formula, 
$z=(\sqrt2)^\frac12\left(\cos\left(\frac{2r\pi+\frac\pi4}2\right)+i\sin\left(\frac{2rpi+\frac\pi4}2\right)\right)$ where $r=0,2-1=1$
For $r=0,z=2^\frac14\left(\cos\left(\frac{\frac\pi4}2\right)+i\sin\left(\frac{\frac\pi4}2\right)\right)=2^\frac14\left(\cos\frac\pi8+i\sin\frac\pi8\right)$
For $r=1,z=2^\frac14\left(\cos\left(\pi+\frac{\frac\pi4}2\right)+i\sin\left(\pi+\frac{\frac\pi4}2\right)\right)=-2^\frac14\left(\cos\frac\pi8+i\sin\frac\pi8\right)$ as $\cos(\pi+x)=-\cos x$ and $\sin(\pi+x)=-\sin x$
Of course, $r$ can assume any $2$ in-congruent values $\pmod 2$ to produce the two different roots.
