<s>[INST] Finding square roots of $\sqrt 3 +3i$ I was reading an example, where it is calculating the square roots of $\sqrt 3 +3i$.
$w=\sqrt 3 +3i=2\sqrt 3\left(\frac{1}{2}+\frac{1}{2}\sqrt3i\right)\\=2\sqrt 3(\cos\frac{\pi}{3}+i\sin\frac{\pi}{3})$
Let $z^2=w \Rightarrow r^2(\cos(2\theta)+i\sin(2\theta))=2\sqrt 3(\cos\frac{\pi}{3}+i\sin\frac{\pi}{3})$.
But how did they get from $\sqrt 3 +3i=2\sqrt 3\left(\frac{1}{2}+\frac{1}{2}\sqrt3i\right)=2\sqrt 3(\cos\frac{\pi}{3}+i\sin\frac{\pi}{3})$?
And can one just 'let $z^2=w$' as above?
Edit:
$w=2\sqrt 3(\cos\frac{\pi}{3}+i\sin\frac{\pi}{3})=z^2\\ \Rightarrow z=\sqrt{2\sqrt 3}(\cos\frac{\pi}{6}+i\sin\frac{\pi}{6})\\ \Rightarrow \sqrt{2\sqrt 3}\frac{\sqrt 3}{2} +i \sqrt{2\sqrt 3} \frac{1}{2}$
 [/INST] Wikipedia page on polar form of complex numbers is quite good.
Given a complex number $z = a + i b$, its absolute value $|z| = \sqrt{a^2+b^2}$, naturally the quotient $\frac{z}{|z|}$ has unit absolutely value, hence $\frac{z}{|z|} = \mathrm{e}^{i \theta} = \cos(\theta) + i \sin(\theta)$ for some angle $\theta$.
In the case at $a=\sqrt{3}$ and $b=3$, thus $\sqrt{a^2+b^2} = \sqrt{3+3^2} = 2 \sqrt{3}$. Therefore $\frac{z}{|z|} = \frac{\sqrt{3}}{2 \sqrt{3}} + i \frac{3}{2 \sqrt{3}} = \frac{1}{2} + i \frac{\sqrt{3}}{2}$. Solving for $\cos(\theta) = \frac{1}{2}$ and $\sin(\theta) = \frac{\sqrt{3}}{2}$ for $0 \leqslant \theta < 2\pi$ gives $\theta = \frac{\pi}{3}$.
Finding the square root proceeds as follows. Let $w = |w| \mathrm{e}^{i \phi}$, then
$$
   |w|^2 \mathrm{e}^{2 i \phi} = 2 \sqrt{3} \mathrm{e}^{i \pi/3}
$$
Taking the absolute value we must have $|w|^2 = 2 \sqrt{3}$, hence $|w| = \sqrt{2} 3^{1/4}$. When solving for the angle $\phi$, remember that there are two roots for $0 \leqslant \phi <2 \pi$.
</s>