<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] Hint:
$$\cos(x)\cos(y) = \dfrac{\cos(y + x) + \cos(y - x)}2\tag{1}$$
Now, using $(1)$,
$$\begin{align}
\int e^{-3x}\cdot\cos^3x\,\mathrm dx &= \int e^{-3x}\cdot\cos x\cdot\cos^2x\,\mathrm dx \\
&= \int e^{-3x}\cdot\cos x\cdot\dfrac{1 + \cos 2x}2\,\mathrm dx \\
&= \dfrac12\int e^{-3x}\cdot\cos x\,\mathrm dx + \dfrac12\int e^{-3x}\cos x\cos 2x\,\mathrm dx\\
&= \dfrac12\int e^{-3x}\cdot\cos x\,\mathrm dx + \dfrac12\int e^{-3x}\cdot\dfrac{\cos3x + \cos x}2\,\mathrm dx \\
&= \dfrac34\int e^{-3x}\cdot\cos x\,\mathrm dx + \dfrac14\int e^{-3x}\cos3x\,\mathrm dx
\end{align}$$
From here onward, solve both integrals by parts.
</s>