# Why is it possible that $f(x)$ has real outputs, but $\exp(\ln(f(x))$ has complex outputs?

This is probably a trivial question, but I can't seem to wrap my head around it.

Say I have a function: $$f(x)=x(x-6)^{1/5}$$. Is the output of the function just the real numbers?

Desmos tells me yes, but my friend told me that it isn't, because $$f(x)=\exp(\ln(x(x-6)^{1/5})=\exp(\ln(x)+\frac15\ln(x-6))$$, and because $$\ln$$ of a negative number will yield a complex output, $$f(x)$$ should give complex answers as well.

Plotting $$f(x)=\exp(\ln(x)+\frac15\ln(x-6))$$, I see that it only gives real values from 6 to infinity.

Or does this mean that $$x(x-6)^{1/5}$$and $$\exp(\ln(x)+\frac15\ln(x-6))$$ are actually different functions after all?

I thought about when $$(-1)^n$$ is imaginary and real. When $$n=0.2$$, $$(-1)^n=-1$$ and so my function $$f(x)$$ should be able to handle negative $$x$$'s perfectly well.

However, I found that $$f(x)=x(x-6)^{1/10}$$ outputs real values only from 6 to infinity. This is probably because $$(-1)^n$$ is imaginary when $$n=0.1$$.

This is my question. Why is my friend's logic sound when $$f(x)=x(x-6)^{1/10}$$ but it breaks down when $$f(x)=x(x-6)^{1/5}$$? Does it have anything to do with when $$(-1)^n$$ is real or is there something else about the exponential/logarithmic function that I don't know about?

I feel like this might be in the realm of complex analysis, but I haven't studied that topic yet.

Edit: Let's say the domain of $$f$$ is $$\mathbb{R}$$.

• What is the domain of $f$? We can't talk about the range without knowing the domain of the function. – SL_MathGuy Jan 11 '20 at 16:58
• The whole real numbers. I've put in an edit. – Yip Jung Hon Jan 11 '20 at 16:59
• The product to sum property of logs only works (in the reals) if both arguments are posiitve. In other words $\log(fg) \neq \log f + \log g$ if there is a place where both functions are negative. Second, $(-1)^{0.2} = -1$ is only $1$ of $5$ solutions to that equation. The others are complex valued. Generally speaking, the complex logarithm breaks the "vertical line test" i.e. each input has multiple outputs , unless you choose ahead of time which output to restrict to (like how we choose the positive square root as the convention). – Ninad Munshi Jan 11 '20 at 17:00
• Dealing with logs and exponents in the complex world is tricky because the property we take for granted all the time $(a^b)^c = a^{bc}$ is not true for complex numbers. – Ninad Munshi Jan 11 '20 at 17:02
• $ln(x)$ is not defined for $x \leq 0$ (non-complex) – SL_MathGuy Jan 11 '20 at 17:17

In the complex field the logarithm is a multivalued function, let's designate it by $$Log$$: $$Log(z) = \ln (\left| z \right|) + i\,\arg \left( z \right) + i2k\pi$$

When you take the principal branch of that function $$\log (z) = \ln (\left| z \right|) + i\,\arg \left( z \right)$$ and apply it to a real $$z$$, you get $$\log (x) = \left\{ {\matrix{ {\ln (\left| x \right|) + i\,\pi } & {x < 0} \cr {\ln (\left| x \right|)} & {0 < x} \cr } } \right.$$

Understanding by $$e^z$$ the exponential function $$e^{|z|} (\cos (\arg(z))+i \sin(\arg(z))$$, then you have for instance \eqalign{ & - 1 = e^{\,\log ( - 1)} = e^{\,0} \left( {\cos \pi + i\sin \pi } \right) = - 1 \cr & \left( { - 1} \right)^{\,1/5} = e^{\,\,1/5\,\log ( - 1)} = \cos \pi /5 + i\sin \pi /5 = i^{\,2/5} \cr} That, keeping on the principal branch of the logarithm.

But $$\left( { - 1} \right)^{\,1/5}$$ has five different solutions in total, which correspond to the various branches of the multivalued $$Log$$.
If you take the branch corresponding to $$k=2$$ you get $$\left( { - 1} \right)^{\,1/5} = e^{\,\,1/5\,\ln 1 + 1/5i5\pi } = e^{\,\,i\pi } = - 1$$

But you do not have any branch that can provide $$\left( { - 1} \right)^{\,1/10} =-1$$.

The matter is that if you choose a branch of the logarithm and remain within it, then you can reverse - to a certain extent- the exponentiation keeping the results congruent, while if you "jump among the branches" you end with incongruencies.

$$\forall x>0,e^{\ln x}=x$$, and $$\forall x<0,e^{\ln x}=e^{\ln -1}e^{\ln |x|}= |x|\cdot e^{(2k+1)\pi i} = |x|\cdot e^{2k\pi i}e^{\pi i}=|x|\cdot 1\cdot(-1)=x$$ $$\left(e^{(2k+1)\pi i}=-1, \therefore \ln -1=(2k+1)\pi i\right)$$

So I think they are the same function, just your friend and Desmos can’t do it.

(It’s just the second day I use English to write an answer, if there are any wrong expression, please tell me, I am very appreciated.)

The answer (to the titular question) is simple. Whereas the equation $$e^{\log x}=x$$ is true when $$x>0$$ (and therefore $$\log x$$ is well-defined and real), it fails to be true when $$x<0.$$

In more detail, we provide answers to the body of your question. You say,

Say I have a function: $$f(x)=x(x-6)^{1/5}.$$ Is the output of the function just the real numbers?

Yes, $$f(x)$$ always takes a real value whenever $$x$$ is real, since we can always extract the fifth root of any real number (which is again always real, by definition), and the product of any two real numbers is again a real number.

Then your friend's redefinition of $$f(x),$$ and the attendant consequences, is explained by my answer above to your titular question.

• This is not completely true. By all means, every definition on the table of $\log z$ in the complex variable satisfies $e^{\log z}=z$. – Gae. S. Jan 11 '20 at 17:07
• In my opinion, any answer to this question should at least mention that there is no such thing as the logarithm for negative numbers. So before talking about wether an equation is true or false one has to clarify the meaning of $\operatorname{log}$ – Bruno Krams Jan 11 '20 at 17:14
• @BrunoKrams That's implicit in the claim that the equality $e^{\log x}=x$ fails for negative values of $x.$ – Allawonder Jan 11 '20 at 18:47
• @Gae.S. So you mean to say that $e^{\log(-1)}=-1,$ whatever $\log (-1)$ means anyway? – Allawonder Jan 12 '20 at 11:15
• I mean that (to the best of my knowledge) whenever one defines a logarithm function/multifunction on a subset of $\Bbb C$, it is done so that it satisfies $e^{\log z}=z$ when the expression makes sense. – Gae. S. Jan 12 '20 at 13:12