# Calculus/Integration techniques/Integration by Parts

 ← Integration techniques/Recognizing Derivatives and the Substitution Rule Calculus Integration techniques/Trigonometric Substitution → Integration techniques/Integration by Parts

Continuing on the path of reversing derivative rules in order to make them useful for integration, we reverse the product rule.

## Integration by parts

If ${\displaystyle y=uv}$ where ${\displaystyle u}$ and ${\displaystyle v}$ are functions of ${\displaystyle x}$ , then

${\displaystyle y'=(uv)'=u'v+uv'}$

Rearranging,

${\displaystyle uv'=(uv)'-u'v}$

Therefore,

${\displaystyle \int uv'dx=\int (uv)'\ dx-\int u'v\ dx}$

Therefore,

${\displaystyle \int uv'\ dx=uv-\int vu'\ dx}$

or

${\displaystyle \int u\ dv=uv-\int v\ du}$

This is the integration by-parts formula. It is very useful in many integrals involving products of functions and others.

For instance, to treat

${\displaystyle \int x\sin(x)dx}$

we choose ${\displaystyle u=x}$ and ${\displaystyle dv=\sin(x)dx}$ . With these choices, we have ${\displaystyle du=dx}$ and ${\displaystyle v=-\cos(x)}$ , and we have

${\displaystyle \int x\sin(x)dx=-x\cos(x)-\int {\big (}-\cos(x){\big )}dx=-x\cos(x)+\int \cos(x)dx=\sin(x)-x\cos(x)+C}$

Note that the choice of ${\displaystyle u}$ and ${\displaystyle dv}$ was critical. Had we chosen the reverse, so that ${\displaystyle u=\sin(x)}$ and ${\displaystyle dv=x\ dx}$ , the result would have been

${\displaystyle {\frac {x^{2}\sin(x)}{2}}-\int {\frac {x^{2}\cos(x)}{2}}dx}$

The resulting integral is no easier to work with than the original; we might say that this application of integration by parts took us in the wrong direction.

So the choice is important. One general guideline to help us make that choice is, if possible, to choose ${\displaystyle u}$ as the factor of the integrated, which becomes simpler when we differentiate it. In the last example, we see that ${\displaystyle \sin(x)}$ does not become simpler when we differentiate it: ${\displaystyle \cos(x)}$ is no more straightforward than ${\displaystyle \sin(x)}$.

An important feature of the integration-by-parts method is that we often need to apply it more than once. For instance, to integrate

${\displaystyle \int x^{2}e^{x}dx}$

we start by choosing ${\displaystyle u=x^{2}}$ and ${\displaystyle dv=e^{x}dx}$ to get

${\displaystyle \int x^{2}e^{x}dx=x^{2}e^{x}-2\int xe^{x}dx}$

Note that we still have an integral to take care of, and we do this by applying integration by parts again, with ${\displaystyle u=x}$ and ${\displaystyle dv=e^{x}dx}$, which gives us

${\displaystyle \int x^{2}e^{x}dx=x^{2}e^{x}-2\int xe^{x}dx=x^{2}e^{x}-2(xe^{x}-e^{x})+C=x^{2}e^{x}-2xe^{x}+2e^{x}+C}$

So, two applications of integration by parts were necessary, owing to the power of ${\displaystyle x^{2}}$ in the integrand.

Note that any power of x does become simpler when we differentiate it, so when we see an integral of the form

${\displaystyle \int x^{n}f(x)dx}$

one of our first thoughts ought to be to consider using integration by parts with ${\displaystyle u=x^{n}}$. Of course, for it to work, we need to be able to write down an antiderivative for ${\displaystyle dv}$.

### Example

Use integration by parts to evaluate the integral

${\displaystyle \int e^{x}\sin(x)dx}$

Solution: If we let ${\displaystyle u=\sin(x)}$ and ${\displaystyle v'=e^{x}dx}$ , then we have ${\displaystyle u'=\cos(x)dx}$ and ${\displaystyle v=e^{x}}$ . Using our rule for integration by parts gives

${\displaystyle \int e^{x}\sin(x)dx=e^{x}\sin(x)-\int e^{x}\cos(x)dx}$

We do not seem to have made much progress.

But if we integrate by parts again with ${\displaystyle u=\cos(x)}$ and ${\displaystyle v'=e^{x}dx}$ and hence ${\displaystyle u'=-\sin(x)dx}$ and ${\displaystyle v=e^{x}}$ , we obtain

${\displaystyle \int e^{x}\sin(x)dx=e^{x}\sin(x)-e^{x}\cos(x)-\int e^{x}\sin(x)dx}$

We may solve this identity to find the anti-derivative of ${\displaystyle \sin(x)e^{x}}$ and obtain

${\displaystyle \int e^{x}\sin(x)dx={\frac {e^{x}{\big (}\sin(x)-\cos(x){\big )}}{2}}+C}$

### With definite integral

The rule is essentially the same for definite integrals as long as we keep the endpoints.

Integration by parts for definite integrals Suppose f and g are differentiable and their derivatives are continuous. Then

${\displaystyle \int \limits _{a}^{b}f(x)g'(x)dx={\big (}f(x)g(x){\big )}{\bigg |}_{a}^{b}-\int \limits _{a}^{b}f'(x)g(x)dx}$
${\displaystyle =f(b)g(b)-f(a)g(a)-\int \limits _{a}^{b}f'(x)g(x)dx}$ .

This can also be expressed in Leibniz notation.

${\displaystyle \int \limits _{a}^{b}u\ dv=(uv){\Big |}_{a}^{b}-\int \limits _{a}^{b}v\ du.}$

## Exercises

Evaluate the following using integration by parts.

1. ${\displaystyle \int -4\ln(x)dx}$
${\displaystyle 4x-4x\ln(x)+C}$
${\displaystyle 4x-4x\ln(x)+C}$
2. ${\displaystyle \int (38-7x)\cos(x)dx}$
${\displaystyle (38-7x)\sin(x)-7\cos(x)+C}$
${\displaystyle (38-7x)\sin(x)-7\cos(x)+C}$
3. ${\displaystyle \int \limits _{0}^{\tfrac {\pi }{2}}(-6x+45)\cos(x)dx}$
${\displaystyle 51-3\pi }$
${\displaystyle 51-3\pi }$
4. ${\displaystyle \int (5x+1)(x-6)^{4}dx}$
${\displaystyle {\frac {(5x+1)(x-6)^{5}}{5}}-{\frac {(x-6)^{6}}{6}}+C}$
${\displaystyle {\frac {(5x+1)(x-6)^{5}}{5}}-{\frac {(x-6)^{6}}{6}}+C}$
5. ${\displaystyle \int \limits _{-1}^{1}(2x+8)^{3}(2-x)dx}$
${\displaystyle 1916.8}$
${\displaystyle 1916.8}$