Nth derivative of $x^x$

Hint: We can find an elaboration of the $n$-th derivative of $x^x$ in an example (p. 139) of Advanced Combinatorics by L. Comtet. The idea is based upon a clever Taylor series expansion. Using the differential operator $D_x^j:=\frac{d^j}{dx^j}$ the following holds:

The $n$-th derivative of $x^x$ is

\begin{align*} D_x^n x^x=x^x\sum_{i=0}^n\binom{n}{i}(\ln(x))^i\sum_{j=0}^{n-i}b_{n-i,n-i-j}x^{-j}\tag{1} \end{align*} with $b_{n,j}$ the Lehmer-Comtet numbers.

These numbers follow the recurrence relation \begin{align*} b_{n+1,j}=(j-n)b_{n,j}+b_{n,j-1}+nb_{n-1,j-1}\qquad\qquad n,j\geq 1 \end{align*} and the first values, together with initial values are listed below.

\begin{array}{c|cccccc} n\setminus k&1&2&3&4&5&6\\ \hline 1&1\\ 2&1&1\\ 3&-1&3&1\\ 4&2&-1&6&1\\ 5&-6&0&5&10&1\\ 6&24&4&-15&25&15&1\\ \end{array}

The values can be found in OEIS as A008296. They are called Lehmer-Comtet numbers and were stored in the archive by N.J.A.Sloane by referring precisely to the example we can see here.

Example: $n=2$

Let's look at a small example. Letting $n=2$ we obtain from (1) and the table with $b_{n,j}$: \begin{align*} D_x^2x^x&=x^x\sum_{i=0}^2\binom{2}{i}(\ln(x))^i\sum_{j=0}^{2-i}b_{2-i,2-i-j}x^{-j}\\ &=x^x\left(\binom{2}{0}\sum_{j=0}^2b_{2,2-j}x^{-j}+\binom{2}{1}\ln(x)\sum_{j=0}^1b_{1,1-j}x^{-j}\right.\\ &\qquad\qquad\left.+\binom{2}{2}\left(\ln(x)\right)^2\sum_{j=0}^0b_{0,0-j}x^{-j}\right)\\ &=x^x\left(\left(b_{2,2}+b_{2,1}\frac{1}{x}+b_{2,0}\frac{1}{x^2}\right)+2\ln(x)\left(b_{1,1}+b_{1,0}\frac{1}{x}\right) +(\ln(x))^2b_{0,0}\right)\\ &=x^x\left(1+\frac{1}{x}+2\ln(x)+\left(\ln(x)\right)^2\right) \end{align*} in accordance with the result of Wolfram Alpha.

Note: A detailed answer is provided in this MSE post.


Another variation of the $n$-th derivative of $x^x$ is stated as Remark 7.4 in section 7.8 of Combinatorial Identities, Vol. 5 by H.W. Gould.

Let $\{F_x(k)\}_{k=0}^\infty$ be a sequence with $F_0(x)=1, F_1(x)=1$, and \begin{align*} F_k(x)=-D_xF_{k-1}(x)+\frac{k-1}{x}F_{k-2}(x)\qquad k\geq 2. \end{align*} Assuming $x\neq 0$ the following holds \begin{align*} D_x^n(x^x)=x^x\sum_{k=0}^n(-1)^k\binom{n}{k}(1+\ln x)^{n-k}F_k(x) \end{align*}


Using logarithmic differentiation seems like a nice route: $$ y = x^x \implies \ln(y) = x \ln(x) \implies\\ \frac{y'}{y} = (\ln(x) + 1) \implies \\ y' = (\ln(x) + 1)y $$ Differentiating further, we get: $$ y'' = \frac 1x y + (\ln(x) + 1)y' = \frac 1x y + (\ln(x) + 1)^2 y = \\ \left[ \frac 1x + (\ln(x) + 1)^2\right]y\\ y''' = \left[ -\frac 1{x^2} + 2\frac 1x (\ln(x) + 1)\right]y + \left[ \frac 1x + (\ln(x) + 1)^2\right]y' =\\ \left[ -\frac 1{x^2} + 2\frac 1x (\ln(x) + 1)\right]y + \left[ \frac 1x(\ln(x) + 1) + (\ln(x) + 1)^3\right]y = \\ \left[ -\frac 1{x^2} + 3\frac 1x (\ln(x) + 1) + (\ln(x) + 1)^3\right]y $$ Perhaps this could explain your recurrence.


This is not exactly what you are after, but it is a series expansion which may possibly be useful (as you say you are interested in considering a series expansion for the function).

$f\left( x \right)={{x}^{x}}={{e}^{x\log \left( x \right)}}=\sum\limits_{k=0}^{\infty }{\frac{{{x}^{k}}}{k!}{{\log }^{k}}\left( x \right)}$

after that you can transform the powers of log to perhaps get the expansion you are after (possibly in terms of Stirling numbers). For example, note:

$\ln {{\left( x+1 \right)}^{k}}=k!\sum\limits_{n=k}^{\infty }{S_{n}^{k}\frac{{{x}^{n}}}{n!}}$