<s>[INST] What is the square root of $3 + 2\sqrt{10}i$? I need to compute the square root of $3 + 2\sqrt{10}i$.
I know how to solve it, but for some reason I'm not getting the correct answer. I attempted to solve it like this: 
$$
  \sqrt{3 + 2\sqrt{10}i} = x + iy
    \quad \longrightarrow \quad
  3 + 2\sqrt{10}i = x^2 - y^2 +2xyi
$$
and so forth, but my answer isn't correct.
 [/INST] $z=3+2i\sqrt{10}$ is a complex number with modulus $7=\sqrt{9+40}$ in the first quadrant ($\text{Re}(x),\text{Re}(y)>0$), hence we have
$$ z=7 e^{i\theta} $$
with 
$$\theta = \arctan\frac{2\sqrt{10}}{3}=2\arctan t.$$
Since $\tan(2u)=\frac{2\tan(u)}{1-\tan^2(u)}$, by solving $\frac{2t}{1-t^2}=\frac{2\sqrt{10}}{3}$ with the constraint $t>0$  we get $t=\sqrt{\frac{2}{5}}$, hence the square root of $z$ in the first quadrant is given by:
$$ \sqrt{z} = \sqrt{7} e^{it} = \sqrt{7}\left(\cos\arctan\sqrt{\frac{2}{5}}+i\sin\arctan\sqrt{\frac{2}{5}}\right) $$
or:
$$ \sqrt{z} = \sqrt{7}\left(\sqrt{\frac{5}{7}}+i\sqrt{\frac{2}{7}}\right) = \color{red}{\sqrt{5}+i\sqrt{2}}. $$
Let we check the solution so found:
$$ (\sqrt{5}+i\sqrt{2})^2 = 5-2+2i\sqrt{2\cdot 5} = 3+2i\sqrt{10}.$$
</s>