<s>[INST] Evaluate $\int e^{-3x} \cos^3x\,dx$ 
Evaluate $\int e^{-3x}\cos^3x\,dx$

My Attempt
\begin{align}
& \int e^{-3x} \cos^3x\,dx=\cos^3x \cdot \frac{e^{-3x}}{-3}-\int3\cos^2x\sin x \cdot \frac{e^{-3x}}{-3} \, dx \\
= {} &\frac{-1}{3}\cos^3x \cdot e^{-3x}+\int\cos^2x\sin x \cdot e^{-3x} \, dx\\
= {} & \frac{-1}{3}\cos^3x\cdot e^{-3x}+\cos^3x\cdot e^{-3x} - \int\bigg[-2\cos x\sin x\cdot e^{-3x}-3\cos^2x\cdot e^{-3x}\bigg](-\cos x)\,dx\\
= {} & \frac{-1}{3}\cos^3x\cdot e^{-3x}+\cos^3x\cdot e^{-3x}+2\int \cos^2x\sin x \cdot e^{-3x} \, dx-3\int\cos^3x\cdot e^{-3x}\,dx
\end{align}
How do I solve this integral ?
 [/INST] $$\int e^{-3x}\cos^{3}x dx$$
For this type of integrals use the reduction formula 
$$\int \exp(\alpha \ x)cos^{n}(\beta\ x)dx=\frac{\beta\ n\ \sin(\beta\ x)+\alpha\ \cos(\beta \ x)}{\alpha^2+\beta^2\ n^2}+\frac{\beta^2\ (n-1)n\ \int\ \exp(\alpha \ x)\cos^{n-2} (\beta\ x)dx}{{\alpha^2+\beta^2\ n^2}}$$ where $\alpha=-3, \beta=1, n=3$
$$=-\frac16 e^{-3x}\cos^{3}(x)+\frac16 e^{-3x}\sin(x)\cos^{2}(x)+\frac13\int e^{-3x}\cos(x)dx$$
Then solve $\int e^{-3x}\cos(x)dx$ using Integration By Parts
Then we get $$\int e^{-3x}\cos(x)dx=-\frac{1}{10}e^{-3x}(3\cos(x)-\sin(x))$$
Finally,
$$\int e^{-3x}\cos^{3}x dx=\frac{1}{120}e^{-3x}(9\sin(x)+5\sin(3x)-27\cos(x)-5\cos(3x))+C$$
</s>