general formula for $\log_x(y)$ when $y$ is negative I'm looking for a general formula for solving a problem of the form $\log_x(y)$ when $y&lt;0$. It seems like the formula is $\frac{\ln(|y|)+\pi i}{\ln(x)}$, but I would like to know how this is derived, or a proof for it. I got this this from looking at the answer of wolfram alpha, so this formula may not be correct.
The complex logarithm function is defined as 

$$\text{Log}\,z:=\log|z|+i\arg z\;\;,\;\;0\neq z\in\Bbb C$$

with $\;\log\;$ the usual, real logarithm.

But, as we know, the argument of a complex number is defined only up to an integer multiple of $\;2\pi\;$, so the above definition in fact gives us infinite possibilities.

Another fact, way more advanced, is that $\;z=0\;$ is an acute problem here, and every time we "go around" the origin we add (substract) a multiple of $\;2\pi\;$ to the number's argument, so in order to have a more or less nice logarithm function we must choose a complex "branch" for the function, and in this case this means to choose a chunck of the complex plane that we're going to "throw away" so that in the remaining domain the function's well and nicely defined. The main branch here is the non-negative real axis $\;\Bbb R_-:=\{z\in\Bbb C\;;\;\text{Re}\,z\le 0\}\;$ , and in $\;\Bbb C\setminus \Bbb R_-\;$ the function is well defined, continuous and all.

Please do observe then that $\;\text{Log}\,y:=\log|y|\;$ , for any real $\;y\;$
There are problems when you try to $\log$ a negative value, and you will not be able to escape them. Look at the example when $x=e$. The problem is that $\ln y$ is defined as the real number $a$ for which $e^a=y$. As you may know, there is no real number $a$ for which $e^a$ would be negative, meaning that on the reals, $\ln y$ does not exist for negative indices.

If you look at complex values of $z$ and see which values $e^z$ can reach, things get complicated. Because $$e^{a+bi} = e^a(\cos b + i\sin b),$$ you can see that any number, except for $0$, can be reached with this function. However, because $$e^{a+(b+2\pi) i} =e^a(\cos (b+2\pi) + i \sin(b+2\pi))=e^a(\cos b + i\sin b) = e^{a+bi},$$ you now face a different problem. Unlike the real exponent function, this new complex function is not injective. This means it iw hard to define a function $\log$ to work on the whole convex plain. For example, if you are solving the equation $$e^z=y$$ where $y&lt;0$ is a real number, then one solution is $\ln|y| + i\pi,$ but $\ln |y| + 3\pi i$, $\ln|y| + 5\pi i$ and $\ln |y| + (2k+1)\pi i$ in general all solve the same equation.