Why is $\ln(x^x)=x\ln(x)$ valid?

I know that $\ln(x^k)=k\ln(x)$ for any constant $k$, but why is $\ln(x^x)=x\ln(x)$. The exponent $x$ is not constant.

• My textbook uses this equality to differentiate $y = x^x$. (This comment was an answer to a question that was deleted, asking where I saw this). Commented Feb 12, 2015 at 19:38
• How do you define 'constant'? Commented Feb 12, 2015 at 19:40
• $e^{x\ln x}=\left(e^{\ln x}\right)^{x}=x^{x}=e^{\ln x^{x}}$ This for every $x>0$. Do you agree? Commented Feb 12, 2015 at 19:41
• You have no problems to accept $\ln 3^2$ is $2\ln 3$ and $\ln 3^4$ is $4\ln 3$, but find it odd that it can hold that $\ln 3^3$ is $3\ln 3$? Commented Feb 12, 2015 at 19:41
• @drhab yes, as exponentiation is 1-1 (in particular injective), would you post it as an answer so I can qualify it as such? Commented Feb 12, 2015 at 19:47

As $x$ is probably not an integer, $x^x$ is defined as : $$x^x = e^{x\ln(x)}$$

Hence, taking the logarithm give you $\ln{x^x}=x\ln(x)$

• "not an integer" or rational number, I'm sure you mean. Though of course this definitions works for those, too, so what am I complaining about? Commented Feb 12, 2015 at 19:51
• @GFauxPas : Basically, for integer, $a^n = \overbrace{a\cdot ... \cdot a}^{n \text{ times }}$. Or at least it is the definition I was always given (while for any number not being an integer, $a^x = e^{x \ln{a}}$) Commented Feb 12, 2015 at 19:53
• This answer is ok, I get it. But I'm not accepting it as an answer because it invokes a "mysterious" definition. In other words, drhab's comment is a much more elegant answer. Thank you for your time. Commented Feb 12, 2015 at 19:56
• @servabat Yes but consider $4^{1/2}$. But it doesn't matter in this context because $a^x = e^{x \ln a}$ is true anyway. Commented Feb 12, 2015 at 19:59
• @Larede What non-mysterious definition do you use to define $2^{\pi}$? Commented Feb 12, 2015 at 19:59

The general rule for logarithms is $\log(a^b)=b\log(a)$ for any real numbers $a$ and $b$ (as long as $a$ is positive). In particular, it holds when $a=b=x$ (assuming, again, that $x$ is positive).

For any positive real number $x$, $x\ln x = \ln (x^x)$. This is a statement about very many "constants" $x$. It means $3\ln 3 = \ln (3^3)$, $4\ln 4 = \ln (4^4)$, etc. The only difference between this and $k\ln x = \ln (x^k)$ is the latter is allowed to have $k$ be different from $x$.

For all $y > 0$, $\ln y$ is by definition the power that $e$ must be raised by to give the value $y$. So,

$$e^{\ln y} = y.$$

In particular it is true for any $x$ such that $x^x > 0$. So substituting $x^x$ for $y$,

$$e^{\ln x^x} = x^x.$$

But we also have from the exponent laws and the definition of $\ln$ that,

$$e^{x \ln x} = (e^{\ln x})^x = x^x$$

Comparing the left and right hand sides of the above two equations it follows that $\ln x^x = x \ln x$.

another way to think about it, for positive real $x,y$:

$$\ln y = \log_x y \cdot \ln x \tag{1}$$ and, again by definition $$\log_x x^x= x$$

For every $x>0$ we have: $$e^{x\ln x}=(e^{\ln x})^x=x^x=e^{\ln x^x}$$ Next to that function $x\mapsto e^x$ is injective, so we are allowed to conclude: $$x\ln x=\ln x^x$$