$n$th derivative of $e^x \sin x$

Solution 1:

Yes, your work is correct. But there is an easier way. Put $g(x)= e^{(1+i)x}$ and note that $f(x)$ is the imaginary part of $g(x)$ for real $x$. Now $g^{(n)}(x) =(1+i)^n e^{(1+i)x}$. Since $1+i=2^{1/2} e^{\pi i/4}$, we have $g^{(n)}(x) =2^{n/2}e^{n\pi i/4}e^{(1+i)x}=2^{n/2}e^{x + i(x +n\pi /4)}$. Thus $f^{(n)}(x)$ is the imaginary part of $g^{(n)}(x)$, which is $2^{n/2}e^x \sin (x +n\pi /4)$ as desired.

Solution 2:

Yes. Your derivation is correct. Here is a distillation that might make it simpler to see what is going on: $$ \begin{align} \frac{\mathrm{d}^n}{\mathrm{d}x^n}e^x\sin(x) &=\frac{\mathrm{d}^n}{\mathrm{d}x^n}\frac1{2i}\left(e^{(1+i)x}-e^{(1-i)x}\right)\\ &=\frac1{2i}\left((1+i)^ne^{(1+i)x}-(1-i)^ne^{(1-i)x}\right)\\ &=\frac1{2i}2^{n/2}\left(e^{in\pi/4}e^{(1+i)x}-e^{-in\pi/4}e^{(1-i)x}\right)\\[4pt] &=2^{n/2}e^x\sin(x+n\pi/4) \end{align} $$

Solution 3:

There is a nice point that tells $$D^n\{e^{kx}f(x)\}=e^{kx}(D+k)^nf(x)$$ It can be proved by an inductive approach on $n$. By using it we get: $$D\left(e^x\sin x\right)=e^x(D+1)\sin x=e^x(\cos x+\sin x)=\sqrt{2}e^x\sin(x+\pi/4)\\D^2\left(e^x\sin x\right)=D(\sqrt{2}e^x\sin(x+\pi/4))=\sqrt{2}e^x(D+1)\sin(x+\pi/4)=\sqrt{2}e^x[\cos(x+\pi/4)+\sin(x+\pi/4)]=(\sqrt{2})^2e^x\sin(x+2\pi/4)$$ So we can guess that $D^n(e^x\sin x)=(\sqrt{2})^ne^x\sin(x+n\pi/4)$. What is remained is to prove it by induction on $n$. If $D^k(e^x\sin x)=(\sqrt{2})^ke^x\sin(x+k\pi/4)$ then $$D^{k+1}(e^x\sin x)=D[(\sqrt{2})^ke^x\sin(x+k\pi/4)]=(\sqrt{2})^ke^x(D+1)\sin(x+k\pi/4)=\cdots=(\sqrt{2})^{k+1}e^x\sin(x+(k+1)\pi/4)$$