Let $f(x) = x^{x^x}$. I checked the derivative of this function using Wolfram Alpha.
I know that we can find the derivative of this by using $$ f'(x) = e^{x^x \log(x)}, $$ to get $f'(x) = x^{x^x+x-1}(x\log^2(x) + x \log(x) + 1)$, which is the correct answer.
But if we instead use $$ f'(x) = e^{x \log(x^x)} $$ we get the wrong answer $f'(x) = (x^x)^x(\log(x^x) + x + x\log(x)).$
Why do we get the wrong answer using the second approach, it seems bringing the $x$ exponent out of the log should be equivalent to bringing the $x^x$ exponent out of the log..but for some reason it isn't. Why?

Note that $\log(x^x)=x\log x$, so $x\log(x^x)=x^2\log x\not=x^x\log x$ (except, of course, when $x=1$ or $2$). It follows that, as functions, $e^{x\log(x^x)}\not=e^{x^x\log x}$.