Finding the $n$-th derivative of $f(x) =e^x \sin x$, solving the recurrence relation I am trying to find a closed solution for the nth derivative of the function:
$f(x) = e^x \sin x$
So far I have been able to obtain the derivative as:
$f^{(n)}(x) = e^x S_n \sin x + e^x C_n \cos x$
The sequences S and C are defined as below:
$S_n = S_{n-1} - C_{n-1}$
$C_n = S_{n-1} + C_{n-1}$
$S_0 = 1$,
$C_0 = 0$
I have been able to further simplify this by combining the two equations and obtaining:
$C_n = 2S_{n-2}$
$S_n = S_{n-1} - 2 S_{n-3}$
However, I have no idea what to do now. Can anyone help me find the closed form solution?

The recurrence $S_n=S_{n-1}-2S_{n-3}$ can be solved mechanically. Its auxiliary equation is $x^3-x^2+2=0$. By inspection $-1$ is a solution, so $x+1$ is a factor of the cubic: $$x^3-x^2+2=(x+1)(x^2-2x+2)\;.$$ The other roots are $$\frac{2\pm\sqrt{-4}}2=1\pm i\;,$$ so the solution is of the form $S_n=A(-1)^n+B(1+i)^n+C(1-i)^n$. From the initial values $S_0=S_1=1$ and $S_2=0$ we get
$$\left\{\begin{align*}
&A+B+C=1\\
&-A+B+C+Bi-Ci=1\\
&A+2Bi-2Ci=0
\end{align*}\right.$$
This system has the solution $A=0,B=C=\frac12$, so $$S_n=\frac12\left((1+i)^n+(1-i)^n\right)$$ and $$C_n=(1+i)^{n-2}+(1-i)^{n-2}\;.$$
Now $1+i=\sqrt2 e^{i\pi/4}$ and $1-i=\sqrt2 e^{-i\pi/4}$, so 
$$\left\{\begin{align*}
&S_n=2^{(n-2)/2}\left(e^{in\pi/4}+e^{-in\pi/4}\right)=2^{n/2}\cos\frac{n\pi}4\\
&C_n=2^{(n-2)/2}\left(e^{i(n-2)\pi/4}+e^{-i(n-2)\pi/4}\right)=2^{n/2}\cos\frac{(n-2)\pi}4=2^{n/2}\sin\frac{n\pi}4\;.
\end{align*}\right.$$
