Can $\log_a(-b)$ be solved using complex/imaginary numbers?

Write the value $x = a + b i = r e^{i \theta}$, i.e. in polar form ($r = \sqrt{a^2+b^2}, \theta$ is the angle of the complex number $x$).

Then, you can define $\log(x) = \log r + i \theta$.

(*) $\theta$ is not uniquely specified; if you add or subtract any multiple of $2 \pi$, you still get a valid definition of logarithm.

You can check that this agrees with the regular logarithm by noting for positive numbers $r=a,\theta = 0$. For negative numbers, $r=-a, \theta = \pi$.

For a more detailed discussion, see this wikipedia article.


Yes, it is: $\log_2(-5)=\frac{\ln(-5)}{\ln(2)}=\frac{1}{\ln(2)}(\ln(5)+i\pi)=\log_2(5)+i\frac{\pi}{\ln(2)}$

In general: $$\operatorname{Log} z=\log|z|+i\operatorname{Arg}(z)$$ where $\operatorname{Arg}$ is the principal value of the argument of $z$. For reals $\operatorname{Arg}(x)=\begin{cases}0\text{ if }x\ge0\\\pi\text{ if }x<0\end{cases}$