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

Apr 11, 2017

If this is what you meant, then:

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

#### Explanation:

If you meant $\int {e}^{x} {\sin}^{2} \left(x\right) \mathrm{dx}$, then this can be integrated.

We have to use the identity ${\sin}^{2} \left(x\right) = \frac{1}{2} \left(1 - \cos \left(2 x\right)\right)$. The integral is then equal to:

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

$\textcolor{w h i t e}{I} = \frac{1}{2} \int {e}^{x} \mathrm{dx} - \frac{1}{2} \int {e}^{x} \cos \left(2 x\right) \mathrm{dx}$

The first integral is elementary. We'll call the second one $J$ and find it by itself:

$I = \frac{1}{2} {e}^{x} - \frac{1}{2} J$

For $J = \int {e}^{x} \cos \left(2 x\right) \mathrm{dx}$, we should use integration by parts. Let:

$\left\{\begin{matrix}u = \cos \left(2 x\right) & \implies & \mathrm{du} = - 2 \sin \left(2 x\right) \mathrm{dx} \\ \mathrm{dv} = {e}^{x} \mathrm{dx} & \implies & v = {e}^{x}\end{matrix}\right.$

So:

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

Perform integration by parts again.

$\left\{\begin{matrix}u = 2 \sin \left(2 x\right) & \implies & \mathrm{du} = 4 \cos \left(2 x\right) \mathrm{dx} \\ \mathrm{dv} = {e}^{x} \mathrm{dx} & \implies & v = {e}^{x}\end{matrix}\right.$

Then:

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

Notice that $J$ has reappeared on the right-hand side. We can add $4 J$ to both sides of the equation and then solve for $J$:

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

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

Returning to our original expression:

$I = \frac{1}{2} {e}^{x} - \frac{1}{2} J$

$\textcolor{w h i t e}{I} = \frac{1}{2} {e}^{x} - \frac{1}{2} \left(\frac{1}{5} {e}^{x} \cos \left(2 x\right) + \frac{2}{5} {e}^{x} \sin \left(2 x\right)\right)$

$\textcolor{w h i t e}{I} = \frac{1}{2} {e}^{x} - \frac{1}{10} {e}^{x} \cos \left(2 x\right) - \frac{1}{5} {e}^{x} \sin \left(2 x\right) + C$