How to find $\frac{d^n}{dx^n} e^x\cos x$ How can I get a formula for the n-th derivative of this function? I know that it cycles every 4 derivatives with a factor of $-4$. $e^x(\cos x-\sin x) \to e^x(-2\sin x) \to -2e^x(\sin x+\cos x) \to -4e^x\cos x$

You can use the addition formula:
$$\cos x\cos y-\sin x\sin y=\cos(x+y)$$
Hence:
$$y=e^x\cos x\\
y'=e^x\cos x-e^x\sin x=\sqrt2\cdot e^x\left(\frac1{\sqrt2}\cos x-\frac1{\sqrt2}\sin x\right)=\\
\sqrt2\cdot e^x\left(\cos \frac{\pi}4\cos x-\sin \frac{\pi}4\sin x\right)=2^{\frac12}e^x\cos \left(x+\frac{\pi}{4}\right)\\
y''=2^{\frac22}e^x\cos \left(x+\frac{2\pi}{4}\right)\\
\vdots\\
y^{(n)}=2^{\frac n2}e^x\cos \left(x+\frac{n\pi}{4}\right).$$
