I am in high school, and we started learning De Moivre's formula. I had some problems with my homework concerning rooting of z. So far, this is what I know about the formula:
$\sqrt[n]{z}= \sqrt[n]{r}\left (\cos \left(\dfrac{\phi+2k\pi}{n} \right)+i\sin \left(\dfrac{\phi+2k\pi}{n} \right) \right)$
where $z = a + bi$ and $r = \sqrt{a^2 + b^2}$
Now here's the problem. What is $\phi$ equal to? My professor told us that $\phi = \arctan \left(\dfrac ba \right)$ but this seems incorrect to me. In my homework I had a simple equation of $x^2 + 1 = 0$ where $x = \sqrt{-1}$ and if you try solving $\phi$ with the above formula, you will get it to be 0, whereas the correct answer is $\phi = \pi$
So is $\phi = \arctan \left(\dfrac ba \right)$ a wrong way to find $\phi$, or am I mistaking somewhere?