Tutorials › Real Analysis › Integration by Parts

Riemann Integration · Tutorial 496 of 1000

Integration by Parts

Derive integration by parts from the product rule, then use it to evaluate definite integrals and reduce integrals involving higher derivatives.

Advanced 10 min read

What You'll Learn

  • State integration by parts for continuously differentiable functions on a closed interval
  • Prove the formula using the product rule and the Fundamental Theorem of Calculus, Part II
  • Choose factors strategically when evaluating a definite integral
  • Keep track of endpoint terms and signed integrals
  • Apply integration by parts twice to obtain a second-derivative identity

From Substitution to Integration by Parts

Integration by substitution uses the chain rule to recognize the derivative of a composite function. Integration by parts uses a different differentiation rule: the product rule. It transfers a derivative from one factor to another, while recording the values of their product at the endpoints.

The formula is useful when an integrand is a product and one factor becomes simpler when differentiated, while the other has an accessible antiderivative. Its endpoint term is essential: omitting it generally changes the value of the integral.

As in the previous tutorial, integrals are signed, and reversing the endpoints reverses the sign. We use “continuously differentiable on \([a,b]\)” in the same sense: the function is continuous on \([a,b]\), differentiable in the interior, and its derivative extends continuously to the endpoints. This condition ensures that the functions and derivatives used below are continuous and Riemann integrable.

The Integration by Parts Formula

Theorem (Integration by Parts): Let \(a<b\), and let \(u,v:[a,b]\to\mathbb{R}\) be continuously differentiable. Then
$$ \int_a^b u(x)v'(x)\,dx = u(b)v(b)-u(a)v(a)-\int_a^b u'(x)v(x)\,dx. $$
Equivalently, writing \([uv]_a^b=u(b)v(b)-u(a)v(a)\),
$$ \int_a^b u(x)v'(x)\,dx=[u(x)v(x)]_a^b-\int_a^b u'(x)v(x)\,dx. $$

Proof. The product \(uv\) is continuous on \([a,b]\) and differentiable in the interior. By the product rule, at each \(x\in(a,b)\),

$$ (uv)'(x)=u'(x)v(x)+u(x)v'(x). $$

The right-hand side is continuous on \([a,b]\), because \(u,v,u'\), and \(v'\) are continuous there. Apply the Fundamental Theorem of Calculus, Part II, to \(uv\). It gives

$$ u(b)v(b)-u(a)v(a) = \int_a^b \bigl(u'(x)v(x)+u(x)v'(x)\bigr)\,dx. $$

Both terms in the integrand are continuous and hence Riemann integrable. By linearity of the Riemann integral,

$$ u(b)v(b)-u(a)v(a) = \int_a^b u'(x)v(x)\,dx+\int_a^b u(x)v'(x)\,dx. $$

Rearranging proves the stated formula. \(\square\)

This proof shows exactly what integration by parts depends on: the product rule supplies an identity for a derivative, and FTC Part II converts that identity into an identity for definite integrals. The formula does not require either factor to be positive or monotone.

Choosing the Factors

To use the theorem on an integrand written as a product, identify one factor with \(u\) and the other with \(v'\). Then \(u'\) should be manageable, and \(v\) should be an antiderivative of the other factor. A reliable calculation keeps the three resulting pieces visible:

1
Choose the factor to differentiate.
Set this factor equal to \(u\), with the aim that \(u'\) is simpler than \(u\).
2
Antidifferentiate the other factor.
Set the other factor equal to \(v'\), and choose \(v\) so that \(v'=\,\)that factor.
3
Evaluate the endpoint term.
Compute \(u(b)v(b)-u(a)v(a)\), and subtract the remaining integral \(\int_a^b u'v\).

This choice is not always unique. The theorem guarantees the identity for any valid choice, but a poor choice can make the remaining integral harder rather than easier. It is worth checking both the new integrand \(u'v\) and the endpoint values before proceeding.

Worked Applications

Worked Example: A Polynomial Factor and an Exponential

Evaluate \(\int_0^1 x e^x\,dx\). Choose \(u(x)=x\) and \(v'(x)=e^x\). Then \(u'(x)=1\) and \(v(x)=e^x\), since \(v'(x)=e^x\). The formula gives

$$ \begin{aligned} \int_0^1 x e^x\,dx &=[xe^x]_0^1-\int_0^1 e^x\,dx\\ &=(1\cdot e^1-0\cdot e^0)-(e^1-e^0)\\ &=e-(e-1)=1. \end{aligned} $$

The derivative of \(x\) is simpler than \(x\), and the exponential has the same antiderivative as itself. Those choices leave an elementary remaining integral.

Worked Example: A Polynomial Factor and a Trigonometric Function

Evaluate \(\int_0^{\pi/2}x\cos x\,dx\). Set \(u(x)=x\) and \(v'(x)=\cos x\). Then \(u'(x)=1\) and \(v(x)=\sin x\), because \((\sin x)'=\cos x\). Thus

$$ \begin{aligned} \int_0^{\pi/2}x\cos x\,dx &=[x\sin x]_0^{\pi/2}-\int_0^{\pi/2}\sin x\,dx\\ &=\left(\frac{\pi}{2}\sin\frac{\pi}{2}-0\sin0\right) -\left[-\cos x\right]_0^{\pi/2}\\ &=\frac{\pi}{2}-(0-(-1))\\ &=\frac{\pi}{2}-1. \end{aligned} $$

In the endpoint calculation, \(\sin(\pi/2)=1\), \(\sin 0=0\), \(\cos(\pi/2)=0\), and \(\cos 0=1\). These values account for both the boundary term and the remaining integral.

Worked Example: The Logarithm on a Closed Interval

Evaluate \(\int_1^2\ln x\,dx\). Use \(u(x)=\ln x\) and \(v'(x)=1\), so \(u'(x)=1/x\) and \(v(x)=x\). These functions and their derivatives are continuous on \([1,2]\). Integration by parts yields

$$ \begin{aligned} \int_1^2\ln x\,dx &=[x\ln x]_1^2-\int_1^2 x\frac{1}{x}\,dx\\ &=(2\ln 2-1\ln 1)-\int_1^2 1\,dx\\ &=2\ln 2-0-(2-1)\\ &=2\ln 2-1. \end{aligned} $$

The choice \(v'=1\) is important: it turns the remaining integrand \(u'v\) into \(1\). The interval starts at \(1\), so the logarithm is well-defined and continuously differentiable throughout the entire interval.

Applying the Formula Twice

If one application leaves a product involving a higher derivative, integration by parts can be applied again. The next identity makes that procedure explicit and is useful when the second derivative of one factor is simpler than the first.

Theorem (Second-Derivative Integration by Parts Identity): Let \(a<b\), and suppose \(u\) and \(v\) have continuous derivatives through order two on \([a,b]\). Then
$$ \int_a^b u(x)v''(x)\,dx = [u(x)v'(x)]_a^b-[u'(x)v(x)]_a^b+\int_a^b u''(x)v(x)\,dx. $$

Proof. Apply Integration by Parts first with the factors \(u\) and \(v'\). In the theorem’s notation, take \(u\) as the factor to differentiate and take \(v'\) as the derivative of the other factor. Since the antiderivative of \(v''\) is \(v'\), the result is

$$ \int_a^b u(x)v''(x)\,dx = [u(x)v'(x)]_a^b-\int_a^b u'(x)v'(x)\,dx. $$

Now apply Integration by Parts to the remaining integral, with \(u'\) as the factor to differentiate and \(v'\) as the other factor’s derivative. Its antiderivative is \(v\), so

$$ \int_a^b u'(x)v'(x)\,dx = [u'(x)v(x)]_a^b-\int_a^b u''(x)v(x)\,dx. $$

Substituting this equality into the first formula gives

$$ \begin{aligned} \int_a^b u(x)v''(x)\,dx &=[u(x)v'(x)]_a^b -\left([u'(x)v(x)]_a^b-\int_a^b u''(x)v(x)\,dx\right)\\ &=[u(x)v'(x)]_a^b-[u'(x)v(x)]_a^b +\int_a^b u''(x)v(x)\,dx. \end{aligned} $$

This proves the identity. Each application is valid because the assumed continuous derivatives make the functions and products in the formulas continuous on \([a,b]\). \(\square\)

Worked Example: Repeated Integration by Parts

Evaluate \(\int_0^1 x^2e^x\,dx\). Apply the main formula with \(u(x)=x^2\) and \(v'(x)=e^x\). Then

$$ \int_0^1 x^2e^x\,dx =[x^2e^x]_0^1-\int_0^1 2xe^x\,dx. $$

The remaining integral can be evaluated by the first worked example’s method, with the endpoints kept at \(0\) and \(1\):

$$ \begin{aligned} \int_0^1 2xe^x\,dx &=2\left([xe^x]_0^1-\int_0^1 e^x\,dx\right)\\ &=2\bigl(e-(e-1)\bigr)=2. \end{aligned} $$

The boundary term from the first application is

$$ [x^2e^x]_0^1=1^2e^1-0^2e^0=e. $$

Therefore,

$$ \int_0^1 x^2e^x\,dx=e-2. $$

The repeated step reduced the polynomial degree from two to one, and then from one to zero. The intermediate boundary terms are included in the calculation through the evaluated integration-by-parts expressions.

Endpoint Terms and Common Pitfalls

The formula can be remembered as “the product at the endpoints, minus the integral with the derivative transferred.” The minus sign and the endpoint term are both necessary. For example, in the logarithm calculation, dropping the endpoint term \(2\ln 2\) would leave only the negative of the interval length, which is not the value of the integral.

A second common error is to select \(v\) without checking that its derivative is the intended factor. If the integrand is \(u(x)w(x)\), then the substitution in the theorem is \(v'(x)=w(x)\), not \(v(x)=w(x)\). After choosing \(v\), verify \(v'=w\) before using the formula.

Finally, integration by parts is an identity for signed integrals. The endpoint term is always \(u(b)v(b)-u(a)v(a)\), in that order. If the integral is written with reversed limits, one may either apply the formula with those oriented limits and keep the same convention, or reverse the limits first and change the sign. Mixing the two approaches can introduce an incorrect sign.

The method matters because it converts a product integral into another integral whose factors may be easier to handle. It is especially effective when differentiation simplifies one factor and antidifferentiation preserves or simplifies the other. When neither choice improves the integral, the theorem remains true, but it may not be the useful method for that particular integrand.

Check Your Understanding

Use the formula and its proof to check your understanding of integration by parts.

  1. Which differentiation rule is the starting point for the proof, and where is the Fundamental Theorem of Calculus, Part II used?
  2. For \(\int_1^3 x\sin x\,dx\), identify a natural choice of \(u\) and \(v'\), and state the resulting endpoint term.
  3. Why must the endpoint contribution be \(u(b)v(b)-u(a)v(a)\), rather than a sum of the two endpoint products?
  4. What regularity assumptions allow the second-derivative identity to be obtained by applying integration by parts twice?
  5. When is choosing \(u\) to be the logarithm useful, and what factor is often chosen as \(v'\) in a definite integral involving \(\ln x\)?