Question:
Evaluate the following integrals:
$\int e^{x} \sin ^{2} x d x$
Solution:
Let $I=\int e^{x} \sin ^{2} x d x$
$I=\frac{1}{2} \int e^{x} 2 \sin ^{2} x d x$
$=\frac{1}{2} \int \mathrm{e}^{\mathrm{x}}(1-\cos 2 \mathrm{x}) \mathrm{dx}$
Using integration by parts,
$=\frac{1}{2} \int e^{x} d x-\frac{1}{2} \int e^{x} \cos 2 x d x$
We know that, $\int e^{a x} \operatorname{cosbxdx}=\frac{e^{a x}}{a^{2}+b^{2}}\{a \cos b x-b \sin b x\}+c$
$I=\frac{1}{2}\left[e^{x}-\frac{e^{x}}{5}(\cos 2 x+2 \sin 2 x)\right]+c$
$=\frac{e^{x}}{2}-\frac{e^{x}}{10}(\cos 2 x+2 \sin 2 x)+c$