Calculate $\int e^{2x}(\cos x)^3 dx$

Linearise $\cos^3 x$ first: $\;\cos 3x=4\cos^3x-3\cos x$, so $\;\cos^3x=\frac14(\cos 3x+3\cos x)$, whence $$\mathrm e^{2x}\cos ^3 x=\tfrac14\operatorname{Re}\Bigl(\mathrm e^{(2+3i)x}+3\mathrm e^{(2+i)x}\Bigl)$$ so calculate $\;\frac14\displaystyle\int\bigl(\mathrm e^{(2+3i)x}+3\mathrm e^{(2+i)x}\bigl) \mathrm dx$ and take its real part.


$$\cos^3 x = \dfrac{1}{4}\left(\cos(3x)+3\cos x\right)$$

Plugging in gives:

$$\int e^{2x}\cos^3 x dx = \dfrac{1}{4}\int e^{2x}\cos(3x)dx + \dfrac{3}{4}\int e^{2x}\cos x dx$$

Looking at the first integral and performing IBP twice:

$$\int e^{2x}\cos(3x)dx = \dfrac{2}{13}e^{2x}\cos(3x)+\dfrac{3}{13}e^{2x}\sin(3x)$$

Then, the second integral and performing IBP twice:

$$\int e^{2x}\cos x dx = \dfrac{2}{5}e^{2x}\cos x + \dfrac{1}{5}e^{2x}\sin x$$

So, returning to the initial problem:

$$\int e^{2x}\cos^3 x dx = e^{2x}\left(\dfrac{1}{26}\cos(3x)+\dfrac{3}{52}\sin(3x) + \dfrac{3}{10}\cos x + \dfrac{3}{20}\sin x\right)+C$$