Unit 6 · Topic 6.11 · BC

Integration by parts

Builds on the product rule and basic antiderivatives. 12 minutes.

  1. Example 1Choose the parts of the integral
  2. Example 2Apply integration by parts
  3. Example 3Evaluate the resulting integral
  4. Example 4Use endpoint and integral data

The substitution of topic 6.9 reverses the chain rule. Integration by parts reverses the product rule. It replaces the integral of a product, such as \(\int x\,e^x\,dx\), with a product of two functions minus a new integral that can be easier. This topic derives the formula, shows how to split an integrand into its two parts, and shows how to finish the new integral.

The product rule, integrated

A curve in the u v plane rises from a point at x = a to an orange point at x = b. The teal region lies under the curve, down to the u-axis, and the green region lies beside it, across to the v-axis. A solid orange rectangle reaches from the origin to the orange point, and a dashed orange rectangle reaches from the origin to the point at x = a. The two regions fill the solid rectangle outside the dashed one. Just beyond the orange point, a thin brighter teal strip continues the teal region and a thin brighter green strip continues the green region. A button puts a jump in v, which makes the curve rise straight up at the jump and leaves a red strip between the two pieces of the green region.

Figure 1As \(x\) runs from \(a\) to \(b\), the point \(\big(u(x),v(x)\big)\) traces the curve. The teal region under the curve and the green region beside it fill the orange rectangle outside the dashed one. The brighter strips show what each region gains when \(b\) increases, and with a jump in \(v\), the red strip lies in neither region.

Let \(u\) and \(v\) be differentiable functions of \(x\). In Figure 1 they are positive and increasing, and as \(x\) runs from \(a\) to \(b\), the point \(\big(u(x),v(x)\big)\) traces the curve. The orange rectangle reaches from the origin to the orange point at \(x=b\), so its area is \(\cy{u(b)\,v(b)}\). The dashed rectangle reaches to the point at \(x=a\), and its area is \(\cy{u(a)\,v(a)}\). The teal region lies under the curve, down to the \(u\)-axis. The green region lies beside the curve, across to the \(v\)-axis.

When \(b\) increases by a small amount \(\Delta x\), \(u\) and \(v\) increase by small amounts \(\Delta u\) and \(\Delta v\). The orange rectangle then grows by the two brighter strips at its edges. The teal strip lies under the curve, \(\Delta u\) wide and about \(v\) tall. The green strip lies beside the curve, \(\Delta v\) tall and about \(u\) long. Divided by \(\Delta x\), their areas are about \(v\,\frac{\Delta u}{\Delta x}\) and \(u\,\frac{\Delta v}{\Delta x}\), which approach \(u'v\) and \(uv'\) as \(\Delta x\) approaches 0. These are the two terms of the product rule, which topic 2.8 found from the same rectangle: \((uv)'=u'v+uv'\).

If \(u'\) and \(v'\) are continuous on \([a,b]\), each term of the product rule is continuous there. Each term then has a definite integral, so integrate both sides from \(a\) to \(b\). By the Fundamental Theorem of Calculus, Part 2 (topic 6.7), the integral of \((uv)'\) is the change in \(uv\). The integral of the sum splits into two integrals (topic 6.6):

\[\begin{aligned}u(b)\,v(b)-u(a)\,v(a)&=\int_a^b (uv)'\,dx\\&=\int_a^b v\,u'\,dx\\&\quad+\int_a^b u\,v'\,dx\end{aligned}\]

The teal strips for \(x\) from \(a\) to \(b\) fill the teal region. Each has an area of about \(v\,u'\,\Delta x\), so as the strips narrow, their total approaches the first integral. The first integral is therefore the area of the teal region. In the same way, the second integral is the area of the green region. The two regions fill the orange rectangle outside the dashed one.

Subtract the first integral from both sides. With the shorthand \(du=u'(x)\,dx\) and \(dv=v'(x)\,dx\), the result is \(\int_a^b u\,dv=\big[uv\big]_a^b-\int_a^b v\,du\), where \(\big[uv\big]_a^b\) stands for \(u(b)\,v(b)-u(a)\,v(a)\). This formula is integration by parts. It replaces \(\cg{\int_a^b u\,dv}\), the green region, with the product term \(\cy{\big[uv\big]_a^b}\), the orange rectangle outside the dashed one, minus \(\cb{\int_a^b v\,du}\), the teal region. Some books call the product term the boundary term.

Without bounds, the product rule makes \(uv\) an antiderivative of \(u'v+uv'\), and the same steps give \(\int u\,dv=uv-\int v\,du\). Any antiderivative of \(v'\) can serve as \(v\). If you add a constant to \(v\), the product term gains that constant times \(u\). The new integral gains the integral of that constant times \(u'\). This is the same amount plus a constant, so the two changes cancel up to a constant. Write \(v\) without a constant. Add one constant \(C\) at the end of the work.

The argument needs \(v\) to be differentiable on \([a,b]\). Use the button under Figure 1 to put a jump in \(v\) at \(x=c\). The curve then rises straight up at the jump, and a red strip appears between the two pieces of the green region. The strip is \(u(c)\) long and as tall as the jump. It lies in the orange rectangle outside the dashed one, but above the teal region. It is not part of the green region, because \(v'\) does not exist at \(c\). The product \(uv\) jumps at \(c\), so it has no derivative there, and the Fundamental Theorem does not apply. The product term exceeds the sum of the two integrals by the area of the red strip, so the formula fails.

The figure shows positive, increasing functions, so both integrals are areas. The steps from the product rule to the formula need neither property, so the formula holds whenever \(u'\) and \(v'\) are continuous.

Choosing the two parts

To use the formula, split the integrand into two factors. The factor \(u\) is the one you differentiate. The other factor, with \(dx\), is \(dv=v'(x)\,dx\), and you integrate it to find \(v\). The formula replaces \(\int u\,dv\) with \(\int v\,du\), so a choice helps if you can find \(v\) and if \(\int v\,du\) is easier than the original integral.

Differentiation lowers a power \(x^n\) to \(n\,x^{n-1}\) and turns \(\ln x\) into \(\frac{1}{x}\). An antiderivative of \(e^{kx}\), \(\sin kx\) or \(\cos kx\), for a constant \(k\ne0\), is a function of the same form, no more difficult. A power of \(x\) therefore usually goes in \(u\), with \(e^{kx}\), \(\sin kx\) or \(\cos kx\) in \(dv\). For \(\int x\,e^x\,dx\), the choice \(u=x\) leaves \(\int e^x\,dx\), but \(u=e^x\) leaves \(\int\frac{x^2}{2}\,e^x\,dx\), with a higher power of \(x\).

A factor whose antiderivative you cannot find must go in \(u\). The basic antiderivatives of topic 6.8 include none for \(\ln x\), so a logarithm goes in \(u\). If \(\ln x\) is the whole integrand, take \(dv=dx\), so that \(v=x\) and \(\int\ln x\,dx=x\ln x-\int dx\).

Finishing the new integral

If the new integral is a basic integral, integrate it. If it is again a product with a factor that becomes simpler, use parts again, with \(u\) chosen in the same way. For \(\int x^2e^x\,dx\), the first use leaves \(\int 2x\,e^x\,dx\) and the second leaves \(\int 2e^x\,dx\), because each use lowers the power of \(x\) by one.

For a product of an exponential and a sine or cosine, neither factor becomes simpler. Two uses of parts, with the exponential as \(u\) both times, return a multiple of the integral you started with. Call that integral \(I\). If the result is \(I=A-mI\), where \(A\) stands for the other terms and \(m\ne-1\) is a number, add \(mI\) to both sides. Then divide by \(1+m\). Each equation between indefinite integrals holds up to a constant, so the answer ends with one constant \(C\).

For a definite integral, evaluate the product term at both bounds. Give the new integral the same bounds, which are values of \(x\), not of \(u\). This form needs only the values of \(u\) and \(v\) at \(a\) and \(b\) and the value of \(\int_a^b v\,du\). A table of values and a given integral can supply them in place of formulas for \(u\) and \(v\).

Example 1

Choose the parts of the integral

Find \(\displaystyle\int x^2\ln x\,dx\).

Solution

The integrand is defined for \(x>0\). Of its two factors, \(x^2\) has a basic antiderivative and \(\ln x\) has none, while the derivative of \(\ln x\) is \(\frac{1}{x}\), with no logarithm. Take \(u=\ln x\) and \(dv=x^2\,dx\):

\[\begin{aligned}u&=\ln x, & du&=\frac{1}{x}\,dx\\ dv&=x^2\,dx, & v&=\frac{x^3}{3}\end{aligned}\]

Both \(u\) and \(v\) have continuous derivatives for \(x>0\). In the new integral, the factor \(\frac{1}{x}\) lowers the power of \(x\), and no logarithm remains:

\[\begin{aligned}\int x^2\ln x\,dx&=\frac{x^3}{3}\ln x-\int\frac{x^3}{3}\cdot\frac{1}{x}\,dx\\&=\frac{x^3}{3}\ln x-\int\frac{x^2}{3}\,dx\\&=\frac{x^3}{3}\ln x-\frac{x^3}{9}+C\end{aligned}\]

Example 2

Apply integration by parts

Find \(\displaystyle\int_0^{\pi/3} x\sin x\,dx\).

Solution

The functions \(x\), \(\sin x\) and \(\cos x\) have continuous derivatives for every \(x\). Take \(u=x\), whose derivative is 1, and \(dv=\sin x\,dx\). An antiderivative of \(\sin x\) is \(-\cos x\), so \(v\) carries a minus sign:

\[\begin{aligned}u&=x, & du&=dx\\ dv&=\sin x\,dx, & v&=-\cos x\end{aligned}\]

The formula subtracts \(\int v\,du=\int(-\cos x)\,dx\), and the two minus signs make a plus. At the lower bound the product \(-x\cos x\) is 0, and at the upper bound \(\cos\frac{\pi}{3}=\frac{1}{2}\):

\[\begin{aligned}&\int_0^{\pi/3} x\sin x\,dx\\&=\Big[-x\cos x\Big]_0^{\pi/3}+\int_0^{\pi/3}\cos x\,dx\\&=-\frac{\pi}{3}\cdot\frac{1}{2}+\Big[\sin x\Big]_0^{\pi/3}\\&=\frac{\sqrt{3}}{2}-\frac{\pi}{6}\end{aligned}\]

Example 3

Evaluate the resulting integral

Find \(\displaystyle\int e^{2x}\cos x\,dx\).

Solution

Call the integral \(I\). The functions \(e^{2x}\), \(\sin x\) and \(\cos x\) have continuous derivatives for every \(x\), and neither factor becomes simpler when you differentiate it. Take \(u=e^{2x}\) and \(dv=\cos x\,dx\), so \(du=2e^{2x}\,dx\) and \(v=\sin x\):

\[I=e^{2x}\sin x-2\int e^{2x}\sin x\,dx\]

The new integral has the same form. Use parts again with \(u=e^{2x}\), and now \(dv=\sin x\,dx\), so \(v=-\cos x\):

\[\begin{aligned}\int e^{2x}\sin x\,dx&=-e^{2x}\cos x\\&\quad+2\int e^{2x}\cos x\,dx\\&=-e^{2x}\cos x+2I\end{aligned}\]

The original integral returns. Substitute this result into the first equation. Then collect the copies of \(I\) on the left:

\[\begin{aligned}I&=e^{2x}\sin x+2e^{2x}\cos x-4I\\5I&=e^{2x}(\sin x+2\cos x)\end{aligned}\]

Divide by 5. Each equation holds up to a constant, so add one constant at the end:

\[I=\frac{e^{2x}(\sin x+2\cos x)}{5}+C\]

As a check, the product rule gives the derivative of \(e^{2x}(\sin x+2\cos x)\) as \(e^{2x}(2\sin x+4\cos x+\cos x-2\sin x)\), which is \(5e^{2x}\cos x\). The derivative of \(I\) is therefore the integrand.

Example 4

Use endpoint and integral data

The functions \(f\) and \(g\) have continuous derivatives. The table gives values of \(f\) and \(g\), and \(\displaystyle\int_1^4 f'(x)\,g(x)\,dx=8\). Find \(\displaystyle\int_1^4 f(x)\,g'(x)\,dx\). \[\begin{array}{c|cc} x & 1 & 4\\ \hline f(x) & 2 & 3\\ g(x) & 7 & 9 \end{array}\]

Solution

The derivatives of \(f\) and \(g\) are continuous on \([1,4]\). The given integral contains \(f'\), so take \(u=f(x)\) and \(dv=g'(x)\,dx\). Then \(du=f'(x)\,dx\) and \(v=g(x)\), and the new integral is the given one:

\[\int_1^4 f(x)\,g'(x)\,dx=\Big[f(x)\,g(x)\Big]_1^4-8\]

The product term needs both functions at both bounds, so it uses all four values in the table:

\[\begin{aligned}\Big[f(x)\,g(x)\Big]_1^4&=f(4)\,g(4)-f(1)\,g(1)\\&=(3)(9)-(2)(7)=13\end{aligned}\]

Subtract the given integral:

\[\int_1^4 f(x)\,g'(x)\,dx=13-8=5\]

Each example is one of the four skills of topic 6.11 in Which & Why: AP Calculus.