How can we calculate $(x^x)'$

I don't mean to bring this question back from the dead, but Elias' answer is quite wrong, and Anders seems to have been to only one to notice, but he was ignored. Testing any of $n=1,2,3$, for example, all give wrong answers, so I'll give my own answer, which is a similar approach.

A power tower with $n$ $x$s total can be described for $n\in\mathbb{N}^0$ as $$\varphi_{n}(x)= \left\{ \begin{array}{rcl} 1, & \mbox{ if } & n=0\\ x^{\varphi_{n-1}(x)}, & \mbox{ if } & n> 0 \end{array} \right.$$ Then $$\log{\varphi_n(x)}=\varphi_{n-1}(x) \log(x) $$$$ \implies\varphi_n'(x)=\frac{\varphi_n(x)\varphi_{n-1}(x)}{x}+\varphi_n(x)\varphi_{n-1}'(x)\log(x)$$ Recursively using this identity, $$\varphi_n'(x)=\frac{\varphi_n(x)\varphi_{n-1}(x)}{x}+\varphi_n(x)\left(\frac{\varphi_{n-1}(x)\varphi_{n-2}(x)}{x}+\varphi_{n-1}(x)\varphi_{n-2}'(x)\log(x)\right)\log(x)$$ $$=\frac{\varphi_n(x)\varphi_{n-1}(x)}{x}+\frac{\varphi_n(x)\varphi_{n-1}(x)\varphi_{n-2}(x)\log(x)}{x}+\varphi_n(x)\varphi_{n-1}(x)\varphi_{n-2}'(x)\log^2(x)$$ $$=\frac{\varphi_n(x)\varphi_{n-1}(x)}{x}+\frac{\varphi_n(x)\varphi_{n-1}(x)\varphi_{n-2}(x)\log(x)}{x}+\frac{\varphi_n(x)\varphi_{n-1}(x)\varphi_{n-2}(x)\varphi_{n-3}(x)\log^2(x)}{x}+\varphi_n(x)\varphi_{n-1}(x)\varphi_{n-2}(x)\varphi_{n-3}'(x)\log^3(x)$$ Continuing this pattern, we have $$\varphi_n'(x)=\frac1x\sum_{k=1}^{n}\left(\prod_{i=0}^k\varphi_{n-i}(x)\right)\log^{k-1}(x)$$

Remark: If we take an infinite power tower, we essentially have $\varphi_n(x)=\varphi_{n-1}(x)$, so that the derivative of an infinite power tower is $$\varphi_\infty'(x)=\frac1x\sum_{k=1}^{\infty}\left(\prod_{i=0}^k\varphi_{\infty}(x)\right)\log^{k-1}(x)=\frac1x\sum_{k=1}^{\infty}\varphi_{\infty}^{k+1}(x)\log^{k-1}(x)$$ $$\frac{\varphi_{\infty}^2(x)}{x}\sum_{k=0}^\infty\left(\varphi_\infty(x)\log(x)\right)^k=\frac{\varphi_{\infty}^2(x)}{x\left(1-\varphi_{\infty}(x)\log(x)\right)}$$ This is valid for all $x$ such that $\varphi_\infty(x)$ is finite (which is the interval $[e^{-e},e^{\frac1e}]$), because in that interval, $\left| \varphi_\infty(x) \log(x)\right|=\left|W(-\log(x))\right|\leq 1$, with equality only on the endpoints, so the series above converges.


You simply combine the two formulas you already mentioned to get:

$$(x^x)'=(x^n)'_{n=x}+(a^x)'_{a=x}=(nx^{n-1})_{n=x}+(a^x\ln a)_{a=x}=x\cdot x^{x-1}+x^x\ln x=x^x(1+\ln x)$$


$$x>0\implies x^x=e^{x\log x}\implies (x^x)'=e^{x\log x}\left(\log x+1\right)=x^x(\log x+1)$$