Derivative of $x^{x^x}$ I need to compute the derivative of $$z=x^{x^x}$$
I made it like this:
$$y=x^x$$ so $$z=y^x$$
then $$\ln(z)=x\ln(y)$$ 
taking derivative from both sides:
$$\frac{z'}{z}=\ln(y)+x\left(\frac{1}{y}\right)y'$$
I know that $$(x^x)'=x^x(1+\ln(x))$$
So : $$z'=z*(\ln(x^x)+x*\left(\frac{1}{x^x}\right)*(x^x)'))=x^{x^x}(x\ln(x)+x\ln(x)+x)=x^{x^x}\left(2x\ln(x)+x\right)$$ I know I did something wrong. Where is my Mistake??
Thanks alot!
 A: I think your confusion stems from what you think $x^{x^x}$ means.
$x^{x^x}$ means taking $x$ to the power of $x^x$ which is distinctly different from taking $x^x$ to the power of $x$.
As an example, $3^{3^3} = 3^{(3^3)} = 3^{27}$. 
$3^{3^3} \neq (3^3)^3=27^3$.
So $z \neq y^x$. Instead, $z = x^y$.
A: Your only mistake is that $x^{x^x}=x^{(x^x)}\ne (x^x)^x=x^{x^2}$.
As to the derivative, it's simply the chain rule and product rule. First let's do
$$\frac{dx^x}{dx} = \frac{de^{x\ln x}}{dx} = x^x \left(x \frac{d\ln x}{dx} + \ln x\right) = x^x(1 + \ln x).$$
Then we can do the rest:
$$\frac{d x^{x^x}}{dx} = \frac{de^{x^x\ln x}}{dx} = x^{x^x}\left(x^x \frac{d\ln x}{dx} + \ln x \frac{d x^x}{dx}\right) = x^{x^x} \left[x^{x-1} + x^x(\ln x+\ln^2 x)\right].$$
A: Here is how I did it:
$f(x)=x^{x^x}$
$\ln f(x)=x^x\ln x$
$\ln \ln f(x)=\ln{x^x \ln x}=x\ln x+\ln \ln x$
Now I derive both sides:
$\frac{(\ln f(x))'}{\ln f(x)}=\ln x +1+\frac{(\ln x)'}{\ln x}$
using the fact that $(\ln f(x))'=\frac{f'(x)}{f(x)}$, we get:
$\frac{\frac{f'(x)}{f(x)}}{\ln f(x)}=\ln x +1 +\frac{1}{x\ln x}$, and equivalently:
$\frac{f'(x)}{f(x)\ln f(x)}=\ln x +1 +\frac{1}{x\ln x}$. Multiplying by $f(x)\ln f(x)$ both sides and using the fact that $f(x)=x^{x^x}$, we get that:
$f'(x)=x^{x^x}\ln x^{x^x}(\ln x+1+\frac{1}{x\ln x})=x^x x^{x^x}\ln x(\ln x +1 + \frac{1}{x\ln x})$. Taking $x\ln x$ into the parentheses gives
$f'(x)=x^{x-1}x^{x^x}(x\ln x +x\ln^2 x+1)=x^{x^x+x-1}(x\ln x +x\ln^2 x+1)$
A: What if you represented your function as 
$f(x) = x^{x^x} = \exp(x^x \cdot \ln x) = \exp(\,\exp(x\ln(x)) \cdot \ln x  \, )$
Then you can apply the chain rule with the product rule.
A: Let us first establish the derivative of $x^{f(x)}$ in general.
$$\left(x^{f(x)}\right)'=\left(e^{\ln x f(x)}\right)'=\left(\frac{f(x)}x+\ln x f'(x)\right)x^{f(x)}.$$
Then
$$(x^x)'=\color{blue}{\left(1+\ln x\right)x^{x}}$$
and
$$\left(x^{x^x}\right)'=\left(\frac{x^x}x+\ln x \color{blue}{\left(1+\ln x\right)x^{x}}\right)x^{{x^x}}=\color{green}{\left(\frac1x+\ln x+\ln^2x\right)x^xx^{x^x}}.$$

While we are at it:
$$\left(x^{x^{x^x}}\right)'=\left(\frac{x^{x^x}}x+\ln x \color{green}{\left(\frac1x+\ln x+\ln^2x\right)x^xx^{x^x}}\right)x^{x^{x^x}}.$$
A: It's $z=x^y$ not $z = y^x$ so $z= y\ln x$ not $z = x\ln y$
A: Here is the fancy way you would do it with multi-variate chain rule:
Let
$u=x\\v=x\\w=x\\y=u^v\\z=w^y$
We then have
$$\begin{align}\frac d{dx}z&=\frac{\partial z}{\partial w}\frac{dw}{dx}+\frac{\partial z}{\partial y}\frac{dy}{dx}\\&=yw^{y-1}+\ln(w)w^y\left(\frac{\partial y}{\partial u}\frac{du}{dx}+\frac{\partial y}{\partial v}\frac{dv}{dx}\right)\\&=x^x+\ln(x)x^x\left(vu^{v-1}+\ln(u)u^v\right)\\&=x^x+x^{2x}\ln(x)(1+\ln(x))\end{align}$$
