I am having troubles understanding how to calculate the n-th root of a negative number.
To explain what exactly I am struggling with, let me demonstrate my thought process alongside the calculation of the n-th root of a positive number (in $\mathbb{C}$), for example
$$\tilde{z}^4 = 2 \implies \tilde{z} = \sqrt[4]{2}, \text{ where } \tilde{z} \in \mathbb{C}$$
To my understanding, this can be solved by the following formula, among others:
$$\sqrt[n]{z} = \sqrt[n]{r} \times e^{i\frac{\phi + 2k\pi}{n}}, k \in \{ 0, 1, ..., n-1 \}$$
where $r = |z| = \sqrt{a^2 + b^2}$ and $\phi = \arctan \frac{b}{a}$. Given the equation from above, this gives
$$\sqrt[4]{2} = \sqrt[4]{2} \times e^{i\frac{k\pi}{2}}, k \in \{ 0, 1, ..., n-1 \}$$
since $a = 2, b = 0 \implies r = \sqrt{2^2 + 0^2} = 2, \phi = \arctan \frac{0}{2} = 0$. This results in
$$z = \left\{ \sqrt[4]{2}, \sqrt[4]{2} \times e^{\frac{i\pi}{2}}, \sqrt[4]{2} \times e^{-\frac{i\pi}{2}} , -\sqrt[4]{2} \right\} $$ which is correct.
However, this approach seemingly fails for negative numbers $z$, as this would produce the same (now obviously wrong) results. I have found that for negative numbers, the result is correct if $\phi = \pi$, but either way there is a mistake in my thinking when applying the above formula to negative numbers, and I need help figuring out where exactly I am going wrong.
This is not necessarily related to the main question asked, but what would happen if I were to take the n-th root of a purely imaginary number (or rather, a number $k \in \mathbb{C}, \text{where } \mathfrak{R}(k) = 0$), as this would lead to $\phi = \arctan \frac{b}{0}$.
You can still apply the same method to obtain the roots:
Set $$z=re^{i\phi}$$
and obtain $$\sqrt[n]{z}=\sqrt[n]{re^{i\phi}}=\sqrt[n]{r}\cdot e^{\frac{i\phi}{n}}$$ where $$r=|z| \text{ and } \phi=\arctan{\frac{\Im (z)}{\Re (z)}}+2\pi k$$
Now for example if $z =-2$, a "negative" number (note that $\mathbb{C}$ is not a ordered Field, so negative complex numbers don't really exist), and $$\sqrt[n]{-2}=\sqrt[n]{2e^{i(\pi+2\pi k)}}=\sqrt[n]{2}\cdot e^{\frac{i(\pi+2\pi k)}{n}}, k\in\{0,1,...,n-1\}$$ which obviously exists.
If the real part of $z$ is 0, we just set $\phi=\pm\frac{\pi}{2}$, depending on whether the imaginary part of $z$ is positive or negative.