# When do you use integration by parts?

May 10, 2018

There are a few circumstances where there are clear "forms" which are appropriate for integrating by parts.

The first of these is when you have some the form $\int {x}^{n} f \left(x\right) \mathrm{dx}$, where $f \left(x\right)$ is some function that you can repeatedly integrate. For example, $\int \left({x}^{3} \sin \left(x\right)\right) \mathrm{dx}$ is a prime candidate for integration by parts. You will be repeatedly taking the derivative of ${x}^{3}$ and repeatedly integrating $\sin \left(x\right)$. After a few application of integration by parts, the ${x}^{3}$ will turn into a $0$, giving you a solvable integral.

Another case where integration by parts finds use is when you have the form $\int f \left(x\right) g \left(x\right) \mathrm{dx}$, where after repeated integration by parts, you end up with an integral which resembles your original integral. For example, $\int \left({e}^{x} \sin x\right) \mathrm{dx}$ is such a function. The integral of ${e}^{x}$ is ${e}^{x}$ and after taking the derivative of $\sin x$ twice, you end up with another instance of $\sin x$.

We'll solve an example of each.

$\int \left({x}^{2} \sin x\right) \mathrm{dx}$

After applying integration by parts once, we get:

$- {x}^{2} \cos x + \int \left(2 x \cos x\right) \mathrm{dx}$

Apply again to get:

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

The integral is now solvable, yielding the answer:

$- {x}^{2} \cos x + 2 x \sin x + 2 \cos x + C$

Now consider $\int \left({e}^{x} \sin x\right) \mathrm{dx}$.

After applying integration by parts twice, we get:

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

Let $I = \int \left({e}^{x} \sin x\right) \mathrm{dx}$ and we have

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

Since $I$ is our original integral, we've found our answer.