# Doubt about the domain in logarithmic functions.

According to my book, the logarithmic function $$\log_{a}x=y$$ is defined if both $x$ and $a$ are positive and $x\neq 0$ and $a\neq 1$.

So are these not correct? $$\log_{-3}9=2$$ $$\log_{-2}-8=3$$

• Are you allowing $a$ and $x$ to be complex numbers or strictly real? Commented May 26, 2015 at 15:14
• No. As far as I know, $-3$ and $-2$ aren't positive and these LHS's aren't defined.
– user65203
Commented May 26, 2015 at 15:17
• Look up complex logarithm. Commented May 26, 2015 at 18:25
• Obviously the answer depends on how you define $log_a(x)$. Most likely your book is defining $log(x)$ only for $x$ positive and is defining $log_a(x)=log(x)/log(a)$ so that this is defined only for $x,a$ positive and $a\neq 1$, per your post. (Note that $x\neq 0$ is redundant.) Commented May 26, 2015 at 18:32
• Yes, my book is defining $\log_{a}x$ only for $x$ positive. I was just curious if $x$ could take negative values. Commented May 27, 2015 at 4:33

The easy argument is that the two equations are incorrect because they violate the definition. The logarithm function permits a base that is strictly positive and not equal to one, and a domain that is strictly positive.

Another way to see that your two examples can lead us to trouble is that you lose two very important properties of the logarithm. Namely,

$$\log_a(xy) = \log_a(x)+\log_a(y) \qquad \text{and} \qquad \log_a\left(x^p\right) = p\log_a(x)$$ To put this into practice, let's start with the first equation you provided, $\log_{-3}(9)=2$. Supposing for the sake of contradiction that that equation is valid, we should also be able to apply the logarithm property $$\log_{-3}(9) = \log_{-3}(3^2) = 2\log_{-3}(3)$$ This means we should find that $\log_{-3}(3)=1$. Yet clearly it is not true that $(-3)^1 = 3$, so $\log_{-3}(3)=1$ is an invalid equation, meaning we have the following contradiction: $$2\log_{-3}(3) \neq 2 = \log_{-3}(9)= 2\log_{-3}(3)$$ At this point we can either choose to allow negative values of $a$ (which if we do will almost assuredly mean the logarithm will produce complex numbers), or choose to keep the logarithm property $\log_a\left(x^p\right) = p\log_a(x)$. But we cannot have both. You can derive a similar contradiction with your second equation as well. Ultimately it is much more beneficial to keep $a$ positive and not equal to one than it is to lose those nice logarithm properties. The same can be said for allowing negative arguments in the logarithm. This is all from the perspective that you are working with real numbers, as things must be handled differently with complex numbers.

• I agree that this shows that if you permit $a<0$ then the "usual" logarithm rules do not hold, but this doesn't necessarily mean that you cannot define log for values of $a<0$. Commented May 26, 2015 at 15:10
• @TravisJ can we define log for $a<0$ with a strictly real domain though? I think it would be tricky... Commented May 26, 2015 at 15:12
• domain could be real, but the range certainly would not be... Commented May 26, 2015 at 15:12
• @TravisJ okay that makes sense. I was assuming the user that asked this question is not allowing for input/output of the log function with nonzero complex parts Commented May 26, 2015 at 15:13
• My point was just that if you want to allow negative values of $a$ then you don't have real values as outputs any more (hadn't thought about the rules still applying, so this is good). Commented May 26, 2015 at 15:20

They are correct in the sense that $(-3)^{2}=9$ and $(-2)^{3}=-8$. The difficulty arises because you want to think of $\log_{a}(x)$ as the inverse function of $a^{x}$. If $a>0$ (and $a\neq 1$) then $a^{x}$ is a continuous, real-valued (whenever $x$ is real), injective function (so $\log_{a}(x)$ makes sense). If $a=1$ then $a^{x}$ is not injective and so it does not have an inverse. If $a<0$ then you no longer have a real valued function (when $x$ is real). For example, $(-3)^{1/2}$ where $x=1/2$ is not a real number. Generally, the restrictions they give ensure that for real inputs (domain) you get real outputs (range)--and the goal is to have the domain be as large as possible. Also, as pointed out by @graydad, the usual logarithm rules fail if $a<0$.

So the long story short is: you can define logarithms with negative base, but you really don't want to (because nothing works the way you want/expect).

• Could you explain how $x=1/2$ is not a real number? Commented Nov 18, 2020 at 21:10
• @wl_ I wasn't saying $x=1/2$ isn't a real number... but $(-3)^x$ is not a real number when (for example) $x=1/2$. Commented Nov 19, 2020 at 14:00

Absolutely not. What would then be $\log _{-3} 7$?

In the real numbers the domain of the logarithm function ehich is defined as:

$a^{x}=b$ implies, $x=\log_{a}(b)$.

If we are talking about the real numbers, the domain of the the logarithm function is:

$x\in[-\infty,\infty]$

$b\in[1,\infty]$

$a\in[2,\infty$]

In the complex numbers the only thing that changes is the domain of $b$ it extends to $b<0$ and to numbers, $b$ s.t. $Im(b)\neq0$. The first one is right although the second one:

$log_{2}(-8)=3$ Is not, it is actually in the complex numbers. For the future,

$log_{2}(-8)=\frac{(log(8)+i\pi)}{log(2)}$

Hope this helps,

Aleksandar