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}$.