Calculate the $n^{th}$ derivative of this functions?
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.
$\endgroup$ 32 Answers
$\begingroup$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$$
$\endgroup$ $\begingroup$Lets focus on the more general case of $x^\alpha e^x$.
Assume that $D^nf(x)=f^{(n)}(x)$.$$D^0x^\alpha=x^\alpha$$$$D^1x^\alpha=\alpha x^{\alpha-1}$$$$D^2x^\alpha=\alpha(\alpha-1)x^{\alpha-2}$$$$...$$$$D^kx^\alpha=x^{\alpha-k}\prod_{i=1}^k(\alpha-i+1)\\=x^{\alpha-k}(\alpha-1+1)(\alpha-2+1)(\alpha-3+1)\cdots(\alpha-n+1)$$Note that if $\alpha$ is an natural number ($1,2,\dots$), we have that $k=\alpha+1$ is also a natural number, meaning that $D^kx^\alpha=0$. It then follows that $D^kx^\alpha=0$, provided that $k>\alpha$ is a natural number. This is the case because for such values of $k$,$$\prod_{i=1}^k(\alpha-i+1)=0$$My point is, it is sufficient to write $$D^kx^\alpha=x^{\alpha-k}\prod_{i=1}^k(\alpha-i+1)$$because the $\prod_{i=1}^k(\alpha-i+1)$ bit automatically encodes the cases of $k\leq \alpha$, and $k>\alpha$. Also, this formula for $D^kx^\alpha$ works even if $\alpha$ is not a whole number.
You already know that $D^ke^x=e^x$, so we may conclude with $$D^n(x^\alpha e^x)=\sum_{k=0}^n{n\choose k}e^xx^{\alpha-k}\prod_{i=1}^k(\alpha-i+1)$$We can simplify by noting that $${n\choose k}=\prod_{j=1}^k\frac{n-j+1}j$$Then combining products:$${n\choose k}\prod_{i=1}^k(\alpha-i+1)=\bigg(\prod_{j=1}^k\frac{n-j+1}j\bigg)\bigg(\prod_{i=1}^k(\alpha-i+1)\bigg)$$$${n\choose k}\prod_{i=1}^k(\alpha-i+1)=\prod_{i=1}^k\frac{(n-i+1)(\alpha-i+1)}{i}$$$${n\choose k}\prod_{i=1}^k(\alpha-i+1)=\frac1{k!}\prod_{i=1}^k(n-i+1)(\alpha-i+1)$$Which gives our simplified result:$$D^n(x^\alpha e^x)=e^x\sum_{k=0}^n\frac{x^{\alpha-k}}{k!}\prod_{i=1}^k(n-i+1)(\alpha-i+1)$$
If you are unfamiliar with $\prod$ notation, $$\prod_{i=1}^na_i=a_1\cdot a_2\cdot a_3\cdots a_n$$$$\prod_{i=1}^\infty a_i=a_1\cdot a_2\cdot a_3\cdots$$It is exactly the multiplication version of $\sum$ notation.
$\endgroup$