# Is $2^{\log_2(-5)}$ defined?

As far as I know for $\log_2 x$ to be defined $x$ must be higher than 0. However when I enter $2^{\log_2(-5)}$ into wolframalpha it gives result $-5$. Is it mistake?

• It's being interpreted as complex logarithm. See en.wikipedia.org/wiki/Complex_logarithm . – data May 28 '12 at 12:54
• I just entered 2^(log_2(0)) into Wolfram Alpha and it gave me $0$. Then I tried 1^(log_1(2)) and it said it's indeterminate. Then I tried log_1(2) and it said $\tilde{\infty}$, i.e. $\infty$ with a tilde over it. – Michael Hardy May 28 '12 at 16:17

Yes...and, no.

There are ways to define $\log_2(-5)$. They require knowing something about complex numbers. And if you use one of those ways to define $\log_2(-5)$, then $2^{\log_2(-5)}=-5$.

Now, if WA says $2^{\log_2(0)}=0$, then I'll be worried.

• it does So I should treat it as incorrect if we didn't learn about complex numbers? – Templar May 28 '12 at 12:58
• "Now, if WA says $2^{\log_2 (0)} =0$ , then I'll be worried. " ...and it actually does! It is a huge mistake, both the OP's input and yours, based on the fact that $\,\displaystyle{a^{\log_ax}}=x...\forall x >0$ !! – DonAntonio May 28 '12 at 13:01
• I'm not too bothered by this, personally. The function $z\mapsto 2^{\log_2 z}$ is defined and equal to the identity away from $0$, so it is natural to remove the hole at $0$ by defining $2^{\log_2 0} = 0$. I guess one should be aware that this has been done, though. – froggie May 28 '12 at 13:05
• If you haven't done complex numbers, then there is no sensible way for you to define $\log_2(-5)$, hence, no sensible way for you to define $2^{\log_2(-5)}$. The answer WA gives is --- for your purposes --- incorrect. – Gerry Myerson May 28 '12 at 13:12
• Indeed, yet WA call $\log$ the natural logarithm. No mention of the complex one, which should also make clear, imo, what branch it is choosing. Thus I assume WA is taking real logarithms and then it is a mistake. – DonAntonio May 28 '12 at 13:16

It is not a mistake, though you are right to be worried. What they are using is the complex logarithm. It is possible to define logarithms $\log z$ of any nonzero complex number $z$, just by saying that $\log z$ is a complex number $w$ with the property that $e^{w} = z$. Unfortunately there are infinitely many such solutions, so there are infinitely many logarithms $\log z$ of $z$. By definition, though, they all have the property that $e^{\log z} = z$, which is what wolframalpha gave you.

• With slight modifications to deal with base-2 logarithms rather than the natural logarithm that froggie is writing about. – Gerry Myerson May 28 '12 at 13:01