Find the coefficient of $f(x)=e^x \sin x$ for the 5th derivative $f^{(5)}(0)$ using maclaurin series 
Find the coefficient of $f(x)=e^x \sin x$ for the 5th derivative $f^{(5)}(0)$ using maclaurin series


the maclaurin polynomial is supposed to be $M_5(0)=f(0)+ \frac{f'(0)}{1!}+...+ \frac{f^{(5)}(0)}{5!}$
We know that $e^x=1+x+ \frac{x^2}{2!}+...$
we also know $\sin x = x-\frac{x^3}{3!}+\frac{x^5}{5!}+...$
the answer is supposed to be $-4$ and the solution it shows is just $(\frac{1}{5!}- \frac{1}{12}+\frac{1}{4!})x^5$ and then $(\frac{1}{5!}- \frac{1}{12}+\frac{1}{4!})=\frac{f^{(5)}(0)}{5!}$
but I do not understand how they got to this? I assumed they took the expansion of each $e^x$ and $sinx$ till the fifth order and multiplied but that didn't work for me
there has to be a simple way and I am unable to figure it
Thanks for any tips and help!
 A: You have that
$$e^x=1+x+\frac{1}{2!}x^2+\frac{1}{3!}x^3+\frac{1}{4!}x^4+\text{higher order terms}$$
and
$$\sin x=x-\frac{1}{3!}x^3+\frac{1}{5!}x^5+\text{higher order terms}.$$
If we multiply these together and just look at the resulting $x^5$-term, we get
$$e^x\sin x=\text{lower order terms}+\left(\frac{1}{4!}\cdot1-\frac{1}{2!}\cdot\frac{1}{3!}+1\cdot\frac{1}{5!}\right)x^5+\text{higher order terms}.$$
Now since the factor in front of the $5$'th order term in the expansion corresponds to $\frac{1}{5!}f^{(5)}(0)$ (with $f(x)=e^x\sin x$), we get that
$$f^{(5)}(0)=5!\left(\frac{1}{4!}\cdot1-\frac{1}{2!}\cdot\frac{1}{3!}+1\cdot\frac{1}{5!}\right)=-4.$$
A: An alternative to the provided solution: rewrite $\sin$ in exponential form and expand $e^x$ into a series:
$$\sin(x) = \frac{e^{ix}-e^{-ix}}{2i} = \frac1{2i} \sum_{n=0}^\infty \frac{i^n-(-i)^n}{n!} x^n$$
Multiplying by $e^x$ gives
$$f(x) = e^x \sin(x) = \frac1{2i} \sum_{n=0}^\infty \frac{(1+i)^n-(1-i)^n}{n!} x^n \\
\implies f^{(n)}(0) = \frac{(1+i)^n-(1-i)^n}{2i}$$

We may also use the Cauchy product:
$$e^x \sin(x) = \sum_{m=0}^\infty \frac1{m!} x^m \cdot \sum_{n=0}^\infty \frac{i^n - (-i)^n}{2i\cdot n!} x^n = \frac1{2i} \sum_{m=0}^\infty \sum_{n=0}^m \frac{i^n-(-i)^n}{n!(m-n)!} x^m$$
The coefficient of the $m^{\rm th}$-order term is
$$\frac1{2i} \sum_{n=0}^m \frac{i^n-(-i)^n}{n!(m-n)!} = \frac1{2i\cdot m!} \sum_{n=0}^m \binom mn (i^n - (-i)^n) = \frac{(1+i)^n-(1-i)^n}{2i\cdot m!}$$
and we recover the $m^{\rm th}$ derivative after multiplying by $m!$.
A: We have $$e^x\sin x={e^x-e^{-x}\over 2}\sin x+x{e^x+e^{-x}\over 2}{\sin x\over x}$$ The first summand is an even function so it does not contain $x^5$ in its Maclaurin series. The second function can be represented as $$x\left (1+{x^2\over 2!}+{x^4\over 4!}+\ldots \right )\left (1-{x^2\over 3!}+{x^4\over 5!}+\ldots \right )$$ Therefore we look for the coefficient of $x^4$ in the product of the sums and multiply the result by $5!.$ $$f^{(5)}(0)=5!\left [{1\over 5!}-{1\over 2!\,3!} +{1\over 4!}\right ]=1-10+5=-4$$
