Solution (source code)

= Solution

<De Moivre's theorem> states that $(\cos\theta+i\sin\theta)^n=\cos(n\theta)+i\sin(n\theta)$ for integer $n$. For $z\ne0$, write its <polar form> as $z=re^{i\theta}$, where $r=|z|>0$. If $w=se^{i\varphi}$ and $w^n=z$, equality of moduli gives $s=r^{1/n}$ and equality of arguments gives $n\varphi=\theta+2\pi k$. Thus the distinct <roots of a complex number> are
$$
\boxed{w_k=r^{1/n}\left(\cos\frac{\theta+2\pi k}{n}+i\sin\frac{\theta+2\pi k}{n}\right),\qquad k=0,\ldots,n-1.}
$$
Changing the chosen argument of $z$ only permutes these roots. For $z=0$ the only root is zero. Taking $r=8$ and $\theta=\pi$ gives the cube roots
$$
\boxed{1+i\sqrt3,\quad-2,\quad1-i\sqrt3.}
$$
Cubing any of them returns $-8$; geometrically they are equally spaced on the circle of radius two.