Integration by Parts

Trade the integral for an easier one.

The product rule, rearranged

The product rule says that for two functions u and v of x, (uv)' = u'v + uv'. Take u'v to the other side: uv' = (uv)' − u'v.

Now integrate both sides. Integrating (uv)' gives back uv, so ∫ uv' dx = uv − ∫ u'v dx. Writing dv for v' dx and du for u' dx, this is ∫ u dv = uv − ∫ v du. This is integration by parts.

It does not finish an integral by itself. It trades ∫ u dv for a different integral, ∫ v du, and the trade is worth making only when the new integral is easier than the old one.

uv∫u dv = 3.89∫v du = 1.94uv = 5.83

the area under the curve is ∫v du and the area to its left is ∫u dv; together they are the box uv, which is ∫u dv = uv − ∫v du

Drag the corner and try to make the two areas fail to fill the box

The curve v = u² drawn against u, inside the box from the origin to the corner (1.8, 3.24). The region under the curve is ∫ v du = 1.94 and the region to its left is ∫ u dv = 3.89; together they fill the box, uv = 1.8 × 3.24 = 5.83. Drag the corner: the two regions always fill the box, which is ∫ u dv = uv − ∫ v du.

A first example

Take ∫ x eˣ dx. Let u = x and dv = eˣ dx. Then du = dx, and v = eˣ, because eˣ differentiates to itself.

The formula gives ∫ x eˣ dx = x eˣ − ∫ eˣ dx = x eˣ − eˣ + c. The x has gone from the new integral, which is why it was easy.

Check by differentiating, with the product rule on x eˣ: eˣ + x eˣ − eˣ = x eˣ, the integrand.

Choosing u

Choose u as the part that becomes simpler when it is differentiated, and dv as a part you can integrate. A power of x is the usual u: differentiating it lowers the power.

The other choice for ∫ x eˣ dx is u = eˣ and dv = x dx. Then du = eˣ dx and v = x²/2, and the formula gives x²eˣ/2 − ∫ (x²/2) eˣ dx. The new integral has x² where the old one had x, so it is harder, and the trade has gone the wrong way.

In ∫ x cos x dx, take u = x and dv = cos x dx, so du = dx and v = sin x. Then ∫ x cos x dx = x sin x − ∫ sin x dx = x sin x + cos x + c, because −cos x is an antiderivative of sin x. Check: sin x + x cos x − sin x = x cos x.

∫ x³ ln x dx∫ x eˣ dx∫ x cos x dx∫ x eˣ dxu = x, dv = eˣ dxu = eˣ, dv = x dxuv − ∫ v du =eˣ · x²/2 − ∫ (x²/2) eˣ dxa harder integral

u = eˣ leaves uv − ∫ v du with a harder integral than the original — the power went up or the awkward factor stayed — so swap u and dv

Choose the u that leaves a simpler integral

For ∫ x eˣ dx this starts with u = eˣ and dv = x dx, which leaves ∫ (x²/2) eˣ dx, harder than the integral started with. Choose u = x instead, and the integral left is ∫ eˣ dx. The other two integrals at the top work the same way.

When dv is just dx

The integrand ln x is not a product, and no rule so far integrates it. Write it as ln x × 1 and take u = ln x and dv = dx. Then du = (1/x) dx and v = x.

The formula gives ∫ ln x dx = x ln x − ∫ x × (1/x) dx = x ln x − ∫ 1 dx = x ln x − x + c. Check: the derivative of x ln x is ln x + x × (1/x) = ln x + 1, and taking away the derivative of x leaves ln x.

Two rounds

For ∫ x²eˣ dx, take u = x² and dv = eˣ dx. Then du = 2x dx and v = eˣ, so ∫ x²eˣ dx = x²eˣ − ∫ 2x eˣ dx. The power has dropped from 2 to 1, but one integral by parts remains.

The first example gives ∫ 2x eˣ dx = 2(x eˣ − eˣ). So ∫ x²eˣ dx = x²eˣ − 2x eˣ + 2eˣ + c = (x² − 2x + 2)eˣ + c. Check: the derivative is (2x − 2)eˣ + (x² − 2x + 2)eˣ = x²eˣ.

Definite integrals

Evaluate the antiderivative at both ends as usual. From 0 to 1, x eˣ − eˣ gives (e − e) − (0 − 1) = 1, so the integral of x eˣ from 0 to 1 is 1. 1000 midpoint strips add to 0.9999998.

From 0 to π, x sin x + cos x gives (π × 0 − 1) − (0 + 1) = −2, so the integral of x cos x from 0 to π is −2: more of the region lies below the axis, where cos x is negative, than above it. 1000 midpoint strips add to −1.999999.

The usual mistakes

Adding the second integral instead of subtracting it. x eˣ + eˣ differentiates to 2eˣ + x eˣ, not x eˣ.

Integrating each factor separately. x²eˣ/2 differentiates to x eˣ + x²eˣ/2, because integrals do not split over a product; parts exists to handle the second term.

Choosing u = eˣ for ∫ x eˣ dx. eˣ never gets simpler when it is differentiated, and the leftover integral gains a power of x.

Losing a sign in ∫ sin x dx. It is −cos x, so x sin x − ∫ sin x dx is x sin x + cos x; x sin x − cos x differentiates to 2 sin x + x cos x.

A timber kiln

In the application below, moisture leaves timber at a rate that is a power of time times a falling exponential. The power is differentiated and the exponential integrated, so the integral left over is an exponential alone.

Worked example: A Timber Kiln's Drying Curve: A Power Times an Exponential, Traded for an Easier Integral

Question Green timber is loaded into a kiln. Moisture leaves the boards at r = 50n e−n kilograms per hour, where n is the number of hours after the kiln is closed: the rate builds as the boards warm, peaks after one hour, then falls away. (a) How much moisture leaves in the first two hours? (b) How much leaves in the next two? Give each answer to three significant figures.

  1. 1.The integrand is a product of two quite different functions, n and e−n, so use parts: ∫ u dvdn dn = uv − ∫ v dudn dn. Take u = n, because differentiating it leaves 1 and kills the product, and dvdn = e−n, which integrates to v = −e−n.

    05101520012345n, hours after the kiln is closedkilograms per hourparts: u = n, dv = e−ndn, so v = −e−n
    05101520012345n, hours after the kiln is closedkilograms per hourparts: u = n, dv = e−ndn, so v = −e−n
    Integrate by parts with u = n, which differentiates to 1, and dvdn = e−n, which integrates to v = −e−n.
  2. 2.Then ∫ n e−ndn = −n e−n − ∫(−e−n)dn = −n e−n − e−n + C = −(n + 1)e−n + C. The integral left over was an exponential alone, which is the whole point of the choice.

    05101520012345n, hours after the kiln is closedkilograms per hourparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C
    05101520012345n, hours after the kiln is closedkilograms per hourparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C
    That gives ∫ n e−ndn = −n e−n − e−n + C = −(n+1)e−n + C: the integral left over was an exponential alone.
  3. 3.(a) ∫02 50n e−ndn = 50[−(n+1)e−n]02 = 50(1 − 3e−2) = 50(1 − 0.406006) = 29.7 kilograms.

    05101520012345n, hours after the kiln is closedkilograms per hour29.7 kgparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C(a) 50(1 − 3 × 0.135335) = 29.7 kg
    05101520012345n, hours after the kiln is closedkilograms per hour29.7 kgparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C(a) 50(1 − 3 × 0.135335) = 29.7 kg
    (a) 50[−(n+1)e−n]02 = 50(1 − 3e−2) = 29.7 kilograms in the first two hours.
  4. 4.Over the four hours, 50[−(n+1)e−n]04 = 50(1 − 5e−4) = 50(1 − 0.091578) = 45.4 kilograms.

    05101520012345n, hours after the kiln is closedkilograms per hour29.7 kg45.4 kgparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C(a) 50(1 − 3 × 0.135335) = 29.7 kgfour hours: 50(1 − 5 × 0.0183156) = 45.4 kg
    05101520012345n, hours after the kiln is closedkilograms per hour29.7 kg45.4 kgparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C(a) 50(1 − 3 × 0.135335) = 29.7 kgfour hours: 50(1 − 5 × 0.0183156) = 45.4 kg
    Over four hours the same antiderivative gives 50(1 − 5e−4) = 45.4 kilograms.
  5. 5.(b) The second two hours therefore give 45.4 − 29.7 = 15.7 kilograms, a little over half as much as the first two. Check: differentiating −(n+1)e−n gives −e−n + (n+1)e−n = n e−n, the integrand, so the antiderivative is right.

    05101520012345n, hours after the kiln is closedkilograms per hour29.7 kg15.7 kgparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C(a) 50(1 − 3 × 0.135335) = 29.7 kgfour hours: 50(1 − 5 × 0.0183156) = 45.4 kg(b) 45.4 − 29.7 = 15.7 kg
    05101520012345n, hours after the kiln is closedkilograms per hour29.7 kg15.7 kgparts: u = n, dv = e−ndn, so v = −e−nintegral = −(n + 1)e−n+ C(a) 50(1 − 3 × 0.135335) = 29.7 kgfour hours: 50(1 − 5 × 0.0183156) = 45.4 kg(b) 45.4 − 29.7 = 15.7 kg
    (b) The second two hours therefore give 45.4 − 29.7 = 15.7 kilograms.

Answer: (a) 50(1 − 3e−2) = 29.7 kilograms; (b) 15.7 kilograms, the four hours together giving 45.4 kilograms

Common mistakes

  • Choosing the parts the other way round, with u = e−n and dvdn = n. That gives v = n22 and leaves ∫n22e−ndn, a higher power than the one started with. Parts is worth doing only when the new integral is easier, so differentiate the power and integrate the exponential.
  • Reading ∫ n e−ndn as n22 × (−e−n), as though integration had a product rule. Differentiating that gives −n e−n + n22e−n, which is not the integrand; the second term is the one parts is designed to account for.

More techniques of integration problems, worked step by step →

Practice Integration by Parts in the app