# Proving $\sum_{k=0}^\infty x^kk^n/k!=(x\, \mathrm d/\mathrm dx)^n e^x$

On this tweet the following equality is shown:

$$\sum_{k=0}^\infty \left( \frac{x^k}{k!} \right)k^n=\left( x \frac{\mathrm d}{\mathrm dx}\right)^n e^x$$

I can see that on the RHS the derivative of $$e^x$$ is always $$e^x,$$ and I don't know whether the idea symbolized in there is to take $$n$$ consecutive derivatives, or the effect of keeping the $$x$$ within the parenthesis in $$\left( x\frac{\mathrm d}{\mathrm dx} \right)^n.$$

On the LHS I see the expansion of $$e^x= 1+x+\frac{e^2}{2!}+\cdots,$$ but the $$k^n$$ is a mystery.

What are the missing pieces to understand this equality?

The $$x \frac{\mathrm{d}}{\mathrm{d}x}$$ is a linear map, which we will call $$T$$. We have, for example \begin{align*} T(e^x) &= xe^x \\ T(\log x) &= 1 \\ T(x^n) &= nx^n \\ T(\cos(x)) &= -x\sin(x), \end{align*} etc. The question is, if you apply $$T$$ to $$e^x$$ $$n$$ times, do you obtain the function represented by the given power series?
The clear solution in my mind is induction on $$n$$. When $$n = 0$$, we apply $$T$$ to $$e^x$$ $$0$$ times, leaving just $$e^x$$ on the left side. On the right side, we get the usual series for $$e^x$$, thus our base case is true.
Now, assume that $$\sum_{k=0}^\infty \frac{x^k}{k!}k^n= T^n (e^x)$$ for some fixed $$n$$. Then, \begin{align*} T^{n+1}(e^x) &= T(T^n(e^x)) \\ &= T\left( \sum_{k=0}^\infty \frac{x^k}{k!} k^n\right) \\ &= x\sum_{k=0}^\infty k\frac{x^{k-1}}{k!} k^n \\ &= \sum_{k=0}^\infty \frac{x^k}{k!} k^{n+1}, \end{align*} as required. Thus the result holds, by induction, for all $$n$$.
First, note that $$x\frac d{dx} x^k = nx^k.$$ Repeating, it follows that $$\left(x\frac{d}{dx}\right)^n x^k = k^nx^k.$$ Now, ignoring convergence issues (there aren't any), \begin{aligned} \left(x\frac{d}{dx}\right)^n e^x &= \left(x\frac{d}{dx}\right)^n \sum_{k=0}^\infty \frac{x^k}{k!}\\ &= \sum_{k=0}^\infty \frac1{k!}\left(x\frac{d}{dx}\right)^n x^k\\ &= \sum_{k=0}^\infty \frac1{k!}k^nx^k\\ &= \sum_{k=0}^\infty \frac{x^k}{k!}k^n. \end{aligned}