<s>[INST] Understanding Leibniz formula: $D^n (f g) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}f D^kg$ I would like some clarification for better understanding of Leibniz formula: $$D^n (f g) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}f D^kg$$
If I use the formula with the following expression: $f(x)= x^3e^x$
$$D^n (f g) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}x^3 D^k e^x = \binom{n}{0} 6e^x + \binom{n}{1} 6x e^x + \binom{n}{2} 3x^2e^x + \binom{n}{3} x^3 e^x$$
But when using the commutative law I get a different result...
$$D^n (gf) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}e^x D^k x^3 = \binom{n}{0} e^x x^3 + \binom{n}{1} e^x 3x^2 + \binom{n}{2} e^x 6x + \binom{n}{3} e^x6$$
Since my question was to calculate $D^nf$ of $f(x) = x^3e^x$ I get two different expressions depending on which "order" I use which seems strange...
 [/INST] $$D^n (gf) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}e^x D^k x^3 = \binom{n}{0} e^x x^3 + \binom{n}{1} e^x 3x^2 + \binom{n}{2} e^x 6x + \binom{n}{3} e^x6$$
Second expression you wrote  is correct but the first formula you wrote you  made mistake.
Let me show where you made mistake
$$D^n (f g) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}x^3 D^k e^x \neq \binom{n}{0} 6e^x + \binom{n}{1} 6x e^x + \binom{n}{2} 3x^2e^x + \binom{n}{3} x^3 e^x$$
The first expression you wrote  must be:
$$D^n (f g) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}x^3 D^k e^x =\binom{n}{0} \frac{d^n(x^3)}{dx^n} e^x + \binom{n}{1} \frac{d^{n-1}(x^3)}{dx^{n-1}} e^x+\binom{n}{2} \frac{d^{n-2}(x^3)}{dx^{n-2}} e^x +....+\binom{n}{n-3} \frac{d^3(x^3)}{dx^3}e^x + \binom{n}{n-2} \frac{d^2(x^3)}{dx^2}e^x+\binom{n}{n-1} \frac{d(x^3)}{dx}e^x+\binom{n}{n} x^3e^x   $$
To use the fact:  $$\frac{d^m(x^3)}{dx^m}=0$$where $m>3$
You can get 
$$D^n (f g) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}x^3 D^k e^x =\binom{n}{n-3} \frac{d^3(x^3)}{dx^3}e^x + \binom{n}{n-2} \frac{d^2(x^3)}{dx^2}e^x+\binom{n}{n-1} \frac{d(x^3)}{dx}e^x+\binom{n}{n} x^3e^x   $$
To use the fact: $$\binom{n}{n-k}=\binom{n}{k}=\frac{n!}{k!(n-k)!}$$
$$D^n (f g) = \sum\limits_{k=0}^{n} \binom{n}{k} D^{n-k}x^3 D^k e^x =\binom{n}{3} \frac{d^3(x^3)}{dx^3}e^x + \binom{n}{2} \frac{d^2(x^3)}{dx^2}e^x+\binom{n}{1} \frac{d(x^3)}{dx}e^x+\binom{n}{0} x^3e^x   $$
</s>