General formula for Differentiation Operator I was considering the Operator
$$
x\,\frac{\rm d}{{\rm d}x}
$$
and applying it $n$ times to an arbitrary function $f(x)$.
Is there a general formula for it?
I started with the first few
\begin{align}
\left(x\,\frac{\rm d}{{\rm d}x}\right)^{1} f(x) &= x f' \\
\left(x\,\frac{\rm d}{{\rm d}x}\right)^{2} f(x) &= x f' + x^2 f'' \\
\left(x\,\frac{\rm d}{{\rm d}x}\right)^{3} f(x) &= x f' + 3x^2 f'' + x^3 f''' \\
\left(x\,\frac{\rm d}{{\rm d}x}\right)^{4} f(x) &= x f' + 7 x^2 f'' + 6x^3 f''' + x^4 f'''' \\
\vdots
\end{align}
but I don't see any pattern yet.
Obviously the first and last coefficients are always $1$.
I figured if I start with any $n$ of the form
$$
\left(x\,\frac{\rm d}{{\rm d}x}\right)^{n} f(x) = \sum_{k=1}^n a_k \, x^k f^{(k)}(x) \tag{1}
$$
where $a_1=a_n=1$, then recursively
\begin{align}
\left(x\,\frac{\rm d}{{\rm d}x}\right)^{n+1} f(x) &= xf^{(1)}(x) + \sum_{k=2}^n \left(k \, a_k + a_{k-1}\right) x^k f^{(k)}(x) + x^{n+1} f^{(n+1)}(x) \\
&= \sum_{k=1}^{n+1} \left(k \, a_k + a_{k-1}\right) x^k f^{(k)}(x) \tag{2}
\end{align}
where $a_0=a_{n+1}=0$.
From (1) and (2) we get for fixed $k$ the coupled recurrence
$$
a_k(n+1) = k\, a_k(n) + a_{k-1}(n)
$$
which can be put in matrix form
\begin{align}
\begin{pmatrix} a_1(n+1) \\ a_2(n+1) \\ a_3(n+1) \\ \vdots \\ a_{n-1}(n+1) \\ a_n(n+1) \end{pmatrix} &= \begin{pmatrix} 1 & 0 & 0 & \dots & 0 & 0 \\ 1 & 2 & 0 &  \dots & 0 & 0 \\ 0 & 1 & 3 &  \dots & 0 & 0 \\ \vdots & \vdots & \vdots & \dots & \vdots & \vdots \\ 0 & 0 & 0 & \dots & n-1 & 0 \\ 0 & 0 & 0 & \dots & 1 & n \end{pmatrix} \begin{pmatrix} a_1(n) \\ a_2(n) \\ a_3(n) \\ \vdots \\ a_{n-1}(n) \\ a_n(n) \end{pmatrix} \\
&=\begin{pmatrix} 1 & 0 & 0 & \dots & 0 & 0 \\ 1 & 2 & 0 &  \dots & 0 & 0 \\ 0 & 1 & 3 &  \dots & 0 & 0 \\ \vdots & \vdots & \vdots & \dots & \vdots & \vdots \\ 0 & 0 & 0 & \dots & n-1 & 0 \\ 0 & 0 & 0 & \dots & 1 & n \end{pmatrix}^n \begin{pmatrix} 1 \\ 0 \\ 0 \\ \vdots \\ 0 \\ 0 \end{pmatrix} \, .
\end{align}
So either I'm too stupid or there is no obvious one.

The coefficients are the Stirling numbers of the second kind.
