# How do you integrate int e^x sin ^2 x dx  using integration by parts?

Oct 10, 2017

The answer is $= {e}^{x} / 2 - \frac{1}{10} {e}^{x} \cos 2 x - \frac{1}{5} {e}^{x} \sin 2 x + C$

#### Explanation:

We need

$\cos 2 x = 1 - 2 {\sin}^{2} x$, $\implies$, ${\sin}^{2} x = \frac{1 - \cos 2 x}{2}$

Therefore,

$I = \int {e}^{x} {\sin}^{2} x \mathrm{dx} = \int \frac{{e}^{x} \left(1 - \cos 2 x\right) \mathrm{dx}}{2}$

Now, perform the integration by parts

$u = 1 - \cos 2 x$, $\implies$, $u ' = 2 \sin 2 x$

$v ' = {e}^{x}$, $\implies$, $v = {e}^{x}$

Therefore,

$I = \frac{1}{2} \left({e}^{x} \left(1 - \cos 2 x\right) - \int {e}^{x} 2 \sin 2 x \mathrm{dx}\right)$

$= {e}^{x} / 2 \left(1 - \cos 2 x\right) - \int {e}^{x} \sin 2 x \mathrm{dx}$

Perform the integration by parts a second time

$u = \sin 2 x$, $\implies$, $u ' = 2 \cos 2 x$

$v ' = {e}^{x}$, $\implies$, $v = {e}^{x}$

$I = \frac{1}{2} \int {e}^{x} \mathrm{dx} - \frac{1}{2} \int {e}^{x} \cos 2 x = {e}^{x} / 2 \left(1 - \cos 2 x\right) - {e}^{x} \sin 2 x + 2 \int {e}^{x} \cos 2 x$

Therefore,

$\frac{5}{2} \int {e}^{x} \cos 2 x = {e}^{x} / 2 - {e}^{x} / 2 + \frac{1}{2} {e}^{x} \cos 2 x + {e}^{x} \sin 2 x$

$\int {e}^{x} \cos 2 x = \frac{2}{5} \left({e}^{x} / 2 - {e}^{x} / 2 + \frac{1}{2} {e}^{x} \cos 2 x + {e}^{x} \sin 2 x\right)$

$= \frac{2}{5} \left({e}^{x}\right) \left(\frac{1}{2} \cos 2 x + \sin 2 x\right)$

$\int {e}^{x} \left(\cos 2 x\right) = \int \left({e}^{x}\right) \left(1 - 2 {\sin}^{2} x\right) \mathrm{dx} = {e}^{x} - 2 \int {e}^{x} {\sin}^{2} x \mathrm{dx}$

So,

${e}^{x} - 2 \int {e}^{x} {\sin}^{2} x \mathrm{dx} = \frac{2}{5} \left({e}^{x}\right) \left(\frac{1}{2} \cos 2 x + \sin 2 x\right)$

$\int {e}^{x} {\sin}^{2} x \mathrm{dx} = {e}^{x} / 2 - \frac{1}{10} {e}^{x} \cos 2 x - \frac{1}{5} {e}^{x} \sin 2 x + C$