Nth Derivative of x^x

derivativesexponential function

A few days ago, I was wondering about a series expansion for $$f(x) = \ x^x$$ so I tried taking a couple derivatives. From these I was able to guess at some formulas for the general coefficients of the first few terms of the nth derivative as well as the last term (where I put the terms of the derivative in the order $$f^{(n)}(x) = c_1x^x + c_2x^{x-1} + c_3x^{x-2}\ + \ … \ +\ c_nx^{x-(n-1)}$$

Please let me know if there is a general formula for the coefficients as a function of n. In my own fooling around, I found that $$\ln(x)+1$$ appears quite a bit, so I called this $a$ in my work. Since I would like to center my expansion at $1$, and this expression evaluated to $1$, at $x=0$, I was interested in writing my formulas as functions of $n$ and $a$. I found that you get something of the form (this could very well be completely incorrect): $$f^{(n)}(x) = ax^x + a^{n-2}{\binom n2}x^{x-1} + a^{n-4}(3{\binom n4}-a{\binom n3})x^{x-2}\\ + a^{n-6}(15{\binom n6}-10{\binom n5}a+2{\binom n4}a^2)x^{x-3}\ + \ … \ +\ (-1)^n(n-2)! \ x^{x-(n-1)}$$

An interesting property that seemed to recur for the various coefficients was that once I found a recursion formula for the coefficient in question and plugged in my initial value, it always seemed to be the same as taking the integral of the previous coefficient with respect to $a$. That is to say, if I plugged in the nth coefficient (a polynomial of $a$) into my recursion formula for the $(n+1)$th coefficient, this gave me the same result as integrating. In general, as reflected by the few coefficient formulas above, the formula for the coefficient of $$x^{x-c}$$ where c is an integer such that $$0\le c<n$$ "Stabilized" to a polynomial of a with c terms after the first few applications of the recursion formula. This stabilization occurred when $$n=2c$$ Also, as a direct result of the tentative and incomplete formula I have written above, the first nonzero-value for the coefficient of $$x^{x-c}$$ is $$(-1)^{c+1}(c-1)!$$ and appears in $$f^{(c+1)}(x)$$ If these various properties are indeed true, can anyone explain why this would be the case? I am aware that this function can be expanded using the expansion for $$e^x$$ with $$x\ln(x)$$ in the exponent. This does not strike me as particularly enlightening (let me know if I'm missing something). I am most interested in the coefficients on the binomial coefficients, since these are the only things that stand between me and a general formula for the coefficients (since the form is quite standard). These are: $$1$$ then $$3,-1$$ then $$15, -10,2$$The sum of these coefficients should also give the nth derivative evaluated at zero since $$f(1) = 1$$ and $$a(1) = 1$$

Anyway, please let me know what you think! I am currently stuck due to an inability to brute force my way any further and a complete lack of cleverness. My knowledge of mathematics is quite elementary, so please explain any higher level concepts if they are necessary to explain this problem.

Best Answer

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*}