Given the following function: $$ f_1(x)=x^3e^x,\quad\quad f_2(x)=x^2(1+x)^n$$ How to calculate the $n^{th}$ derivative using the General Leibniz rule: $$ (fg)^{(n)}(x)=\sum_{k=0}^n\binom{n}{k}f^{(k)}(x)g^{(n-k)}(x)$$
My work:
let $g(x)=x^3$ and $h(x)=e^x$ and for $k\in\Bbb{N}^*$; $$ g^{(k)}(x)= \begin{cases}\frac{3!}{(3-k)!} x^{3-k}& k\leq 3\\ 0 & k> 3\end{cases}$$ and, $$ h^{(k)}(x)=e^x$$ then, $$ f_1^{(n)}(x)=\begin{cases}\sum_{k=0}^{n}\binom{n}{k}\frac{3!}{(3-k)!} x^{3-k}e^x & n\leq 3 \\ \sum_{k=0}^{3}\binom{3}{k}\frac{3!}{(3-k)!} x^{3-k}e^x & n>3 \end{cases}$$
The second function i couldn't do it since it involves the power of $n$ and i want to calculate the $n^{th}$ derivative.
Thanks you for your answers and hints.
You can only take $2$ derivatives of $x^2$, so you need to take $n-2,n-1,$ or $n$ of the second term. So we have $$\left(x^2(1+x)^n\right)^{(n)}=x^2\left((1+x)^n\right)^{(n)}+2nx\left((1+x)^n\right)^{(n-1)}+2{n \choose 2}\left((1+x)^n\right)^{(n-2)}\\ =x^2n!+2nxn!(1+x)+2n(n-1)\frac {n!}2(1+x)^2$$