Why does it seem to be that I can raise negative numbers to the power i? I recently encountered the ided of raising a number to the imaginary unit, and I've been trying to figure out what that means and haven't really found any useful resources.
So, I came across this when my professor wrote,$$z^i=r^i(e^{i\theta})^i=r^ie^{-\theta}$$Problem is, I was so distracted by thinking about what was going with the exponential that I didn't even think about $r^i$.
If I'm not mistaken, the following is true:$$r^i=e^{ln(r^i)}=e^{iln(r)}$$
Checking online, $1^i$ is indeed equal to $1$.
However, when I type into WolframAlpha $(-2)^i$, I find that it spits me out an answer.
I always thought that the natural logarithm was undefined for negative number, but when I type in $ln(-2)$, I get $$ln(-2)=ln(2)+i\pi$$
Why is that? Can someone give me an explanation?
 A: By Euler's formula,
$$e^{ix}=cos(x)+i sin(x)$$
Let $z$ be any complex number.
So, $z=x+iy$ which can be represented in the complex plane. But $z$ can be also represented in the polar coordinate by $z=|z|(cos \phi+isin\phi)=re^{i\phi}$ by Euler's formula.  Note that $|z|=\sqrt{x^2+y^2}$ and $\phi=arg \{z\}$
Recall that $a=e^{ln(a)}$. So, we can also write
$$z=|z|e^{i\phi}=e^{ln|z|}e^{i\phi}=e^{ln|z|+i\phi}$$ for $z\neq 0$.
By taking the natural log of both sides,
$$ln(z)=ln|z|+i\phi$$
So, $ln(-2)=ln(-2+0\cdot i)=ln(2)+i\pi$
A: The reason why log of a negative number is usually taken to be undefined is because the inverse function of the exponential function is multiple valued. $1=e^{0}=e^{2\pi i}=e^{2\pi ik}$, for integer $k$, so it's unclear what we should map $1$ to with the logarithmic function. We settle this disputed by choosing the real value, $0$ to be the "correct" one, and define $\log(x)=y$ to be the (unique) real number to satisfy $x=e^y$. All the other possible values are complex numbers, and are usually discarded.
This doesn't work with negative numbers, because $e^x=-1$ has only complex valued solutions, and so we can't define $\log(-1)$ to be the real number that satisfies $e^x=-1$. Instead, we usually say it is undefined. Sometimes it is useful to consider $\log(x)$ to not be a function, but rather a relation that is multi valued. In these contexts, we define the principle value of $\log(x)$ to be the one with the lowest norm in the complex plane. This is the number that Wolfram Alpha is giving you.
Note: $\sqrt{x}$ suffers from this exact same problem.
