TITLE: Finding result of composing operations many times
QUESTION [8 upvotes]: Consider the operator given by,
$$ P = x \frac{d}{dx}$$
with,
$$ P^2 = x \frac{d}{dx} ( x\frac{d}{dx}) = x \frac{d}{dx} + x^2 \frac{d^2}{dx^2}$$
or,
$$ P^2 = x \frac{d}{dx} ( x\frac{d}{dx}) = x \frac{d}{dx} + x^2 \frac{d^2}{dx^2}$$
and on another application of the operator,
$$ P^3 = [x \frac{d}{dx}] P^2 = x\frac{d}{dx}(x \frac{d}{dx}) + x \frac{d}{dx}( x^2 \frac{d^2}{dx^2}) = x \frac{d}{dx} + 3x^2 \frac{d^2}{dx^2} + x^3 \frac{d^3}{dx^3}  $$
I tried writing more iterations but I can't find / a general form of what $P^k$ should be. So my question is if you are given an operator as the one shown, is there any standard procedure to find the a formula for the kth iteration of the operator?
The actual reason why I want to know about this
Any help would be appreciated :D

REPLY [6 votes]: The coefficients are Stirling numbers of the second kind.
We can write
$$P^n=\sum_{k=1}^n a_{n,k}x^k D^k$$
where $D=\frac d{dx}$. Then
$$P^{n+1}=\sum_{k=1}^n a_{n,k}(xD)(x^k D^k)
=\sum_{k=1}^n a_{n,k}(kx^k D^k+ x^{k+1} D^{k+1})$$
so that
$$a_{n+1,1}=a_{n,1},$$
$$a_{n+1,n+1}=a_{n,n}$$
and
$$a_{n+1,k}=a_{n,k-1}+ka_{n,k}$$
These recurrences are the same as for the Stirling numbers, so
$$a_{n,k}=S(n,k).$$