Calculus/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 $$y=uv$$ where $$u$$ and $$v$$ are functions of $$x$$, then
 * $$y'=(uv)'=u'v+uv'$$

Rearranging,
 * $$uv'=(uv)'-u'v$$

Therefore,
 * $$\int uv'dx=\int (uv)'\ dx-\int u'v\ dx$$

Therefore,
 * $$\int uv'\ dx=uv-\int vu'\ dx$$

or
 * $$\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
 * $$\int x\sin(x)dx$$

we choose $$u=x$$ and $$dv=\sin(x)dx$$. With these choices, we have $$du=dx$$ and $$v=-\cos(x)$$, and we have
 * $$\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 $$u$$ and $$dv$$ was critical. Had we chosen the reverse, so that $$u=\sin(x)$$ and $$dv=x\ dx$$, the result would have been
 * $$\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 $$u$$ as the factor of the integrated, which becomes simpler when we differentiate it. In the last example, we see that $$\sin(x)$$ does not become simpler when we differentiate it: $$\cos(x)$$ is no more straightforward than $$\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
 * $$\int x^2e^xdx$$

we start by choosing $$u=x^2$$ and $$dv=e^xdx$$ to get
 * $$\int x^2e^xdx=x^2e^x-2\int xe^xdx$$

Note that we still have an integral to take care of, and we do this by applying integration by parts again, with $$u=x$$ and $$dv=e^xdx$$, which gives us
 * $$\int x^2e^xdx=x^2e^x-2\int xe^xdx=x^2e^x-2(xe^x-e^x)+C=x^2e^x-2xe^x+2e^x+C$$

So, two applications of integration by parts were necessary, owing to the power of $$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
 * $$\int x^nf(x)dx$$

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

Example
Use integration by parts to evaluate the integral
 * $$\int e^x\sin(x)dx$$

Solution: If we let $$u=\sin(x)$$ and $$v'=e^xdx$$, then we have $$u'=\cos(x)dx$$ and $$v=e^x$$. Using our rule for integration by parts gives
 * $$\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 $$u=\cos(x)$$ and $$v'=e^xdx$$ and hence $$u'=-\sin(x)dx$$ and $$v=e^x$$, we obtain
 * $$\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 $$\sin(x)e^x$$ and obtain
 * $$\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
 * $$\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$$
 * $$=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. 
 * $$\int\limits_a^b u\ dv=(uv)\Big|_a^b-\int\limits_a^b v\ du.$$

More Examples
Examples Set 1: Integration by Parts

Exercises
Evaluate the following using integration by parts.

=External links=
 * Videos and exercises on integration by parts at Khan Academy