<s>[INST] Number Theory - Modular arithmetic with complex numbers So I was looking at a problem that asked me to find an $x$ s.t $x^3 = -1 \pmod{199}$ given that $14^2 = -3 \pmod{199}$.
To do this I was given the hint to look at complex numbers so I did the following
$$2(-1)^{\frac{1}{3}} - 1 = \sqrt{-3} $$
so then I can say that
$$(-1)^{\frac{1}{3}} = (14 + 199 + 1)/2 = 107$$
which is indeed a solution to the problem.
I am looking for an explanation as to why I can do this and any additional information as to how to apply this trick to similar problems.
 [/INST] $x^3 + 1 = (x + 1)(x^2 - x + 1)$ and note that $199$ is a Prime, so 
$x + 1 = 0 \ \pmod{199}$ or $x^2 - x + 1 = 0 \ \pmod{199}$.
The hint $14^2 = -3 \ \pmod{199}$ to find the root of $x^2 - x + 1$ since:
$x^2 - x + 1 = (x - \frac{1}{2})^2 + \frac{3}{4} = 0 \ \pmod{199}$
then 
$(2x - 1)^2 = -3 \ \pmod{199}$

p.s.
there are $3$ roots : $\{-1, 107, -106\}$
</s>