Solution (source code)

= Solution

The <polar form> is $1+i\sqrt3=2e^{i\pi/3}$. By <De Moivre's theorem>,
$$
(1+i\sqrt3)^3=8e^{i\pi}=-8.
$$
Therefore the <real part> and <imaginary part> are
$$
\boxed{\operatorname{Re}=-8,\qquad\operatorname{Im}=0.}
$$