Advanced level

Integration by parts and substitution

The table of integrals stops at polynomials, sine and cosine — and ∫ x·eˣ dx already has no row in it. Two techniques close the gap, because each of them is a differentiation rule read backwards: the product rule gives integration by parts, and the chain rule gives integration by substitution.

Before you start

This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:

Where this is used

Real situations where you count exactly the way this lesson teaches:

  • Work done stretching a resistance band
    The force needed to stretch a rubber band is not constant — it builds up and levels off: F(x) = 150(1 − e^(−4x)) newtons. Work is the integral of force along the distance, so stretching it by 0.5 m takes 150·(0.5 + 0.25·e^(−2) − 0.25) ≈ 42.6 joules. The exponential term has no row in the table of integrals — the linear substitution u = −4x is what handles it.
  • Energy drawn by a machine on start-up
    An electrician records the instantaneous power of a start-up as P(t) = 40·t·e^(−t/2) kilowatts. The energy is the area under that curve, and a variable times an exponential has no row in the table: integration by parts gives the antiderivative −2t·e^(−t/2) − 4e^(−t/2), so over the first 4 hours the machine eats 40·(4 − 12·e^(−2)) ≈ 95 kilowatt-hours.
  • How much water leaves the tank
    Flow through an opening falls off with the pressure behind it: q(t) = 30·e^(−t/10) litres per minute. The volume that leaves over 20 minutes is the integral of that flow rate, namely 300·(1 − e^(−2)) ≈ 259 litres. The substitution u = −t/10 turns it into the exponential integral you already know.
  • A patient exposure to a drug
    A pharmacologist computes the area under the concentration curve for the model C(t) = 8t·e^(−0.5t) milligrams per litre. Over the first 6 hours, integration by parts gives 32·(1 − 4·e^(−3)) ≈ 25.6 mg·h/l — the number compared against the exposure of a reference dose. The same variable-times-exponential product, the same technique.

All formulas

  • Integration by parts

    u(x)v(x)dx=u(x)v(x)u(x)v(x)dx\int u(x)\,v'(x)\,dx = u(x)\,v(x) - \int u'(x)\,v(x)\,dx

    the product rule, reversed

  • Parts, definite

    abuvdx=[uv]ababuvdx\int_a^b u\,v'\,dx = \Big[u\,v\Big]_a^b - \int_a^b u'\,v\,dx

    the uv term is evaluated at the bounds, the rest stays an integral

  • Integration by substitution

    f(g(x))g(x)dx=F(g(x))+C\int f\big(g(x)\big)\,g'(x)\,dx = F\big(g(x)\big) + C

    the chain rule, reversed

  • The bounds travel

    abf(g(x))g(x)dx=g(a)g(b)f(u)du\int_a^b f\big(g(x)\big)\,g'(x)\,dx = \int_{g(a)}^{g(b)} f(u)\,du

    a substitution moves the limits too

  • Linear substitution

    f(ax+b)dx=1aF(ax+b)+C\int f(ax+b)\,dx = \frac{1}{a}\,F(ax+b) + C

    the commonest case: divide by a

  • The exponential integral

    exdx=ex+C\int e^x\,dx = e^x + C

    needed by the worked examples on parts

The table of integrals in the lesson on the integral stops at polynomials, sine and cosine. Yet xexdx\int x e^x\,dx and (2x+1)5dx\int (2x+1)^5\,dx have no row in it — and both are integrals of functions you know how to differentiate. That is where both techniques in this lesson come from: each of them is one differentiation rule read backwards.

differentiation ruleintegration technique
product rule (uv)=uv+uv(uv)' = u'v + uv'integration by parts
chain rule (F(g(x)))=f(g(x))g(x)\big(F(g(x))\big)' = f(g(x))\,g'(x)integration by substitution

One antiderivative from outside the table will be needed along the way, straight from the lesson on exponential and logarithmic functions: since (ex)=ex(e^x)' = e^x,

exdx=ex+C\int e^x\,dx = e^x + C

Integration by substitution

The chain rule says that the derivative of a composition F(g(x))F(g(x)) is f(g(x))g(x)f(g(x)) \cdot g'(x). Read that equality from right to left:

f(g(x))g(x)dx=F(g(x))+C\int f\big(g(x)\big)\,g'(x)\,dx = F\big(g(x)\big) + C

In practice the inner function is given a name. Substitute u=g(x)u = g(x), so that du=g(x)dxdu = g'(x)\,dx — and the whole integral moves over to uu:

f(u)du=F(u)+C\int f(u)\,du = F(u) + C
Evaluate ∫ 2x·cos(x²) dx.

What to substitute

There is one rule: substitute the inner function of a composition, provided its derivative stands in the integral as a factor. A constant multiple is fine — the missing factor moves out in front of the integral.

integralsubstitutewhy
xx2+1dx\int x\sqrt{x^2+1}\,dxu=x2+1u = x^2+1du=2xdxdu = 2x\,dx, and xdxx\,dx is there
lnxxdx\int \dfrac{\ln x}{x}\,dxu=lnxu = \ln xdu=1xdxdu = \tfrac{1}{x}\,dx, and 1x\tfrac{1}{x} is there
sin3xcosxdx\int \sin^3 x \cos x\,dxu=sinxu = \sin xdu=cosxdxdu = \cos x\,dx, and cosx\cos x is there
(2x+1)5dx\int (2x+1)^5\,dxu=2x+1u = 2x+1du=2dxdu = 2\,dx, a bare constant

The last row is so common that it has a shortcut of its own. When the inside is a linear expression:

f(ax+b)dx=1aF(ax+b)+C\int f(ax+b)\,dx = \frac{1}{a}\,F(ax+b) + C

Dividing by aa is unavoidable: the chain rule multiplies by aa, so integration has to take it back. Hence sin3xdx=13cos3x+C\int \sin 3x\,dx = -\tfrac{1}{3}\cos 3x + C, not cos3x-\cos 3x.

A definite integral: the bounds are substituted too

In a definite integral a substitution changes not only the function but the limits of integration as well — because the variable being integrated over is now a different one:

abf(g(x))g(x)dx=g(a)g(b)f(u)du\int_a^b f\big(g(x)\big)\,g'(x)\,dx = \int_{g(a)}^{g(b)} f(u)\,du
Evaluate ∫₀¹ (2x + 1)² dx by changing the limits of integration.

The drawings show what actually happened: the region changed shape, not size.

−0.500.511.520246810xyy = (2x + 1)²
Before the substitution: a narrow, tall region under y = (2x + 1)² between x = 0 and x = 1.
01234012345uyy = u²/2
After the substitution: the region has stretched sideways and flattened, because the bounds moved to 1 and 3 and the function to u²/2. Both regions have area 13/3.

Integration by parts

The second technique reverses the product rule. Start from it and integrate both sides:

(uv)=uv+uvuv=uvdx+uvdx\big(u\,v\big)' = u'v + u\,v' \quad \Longrightarrow \quad u\,v = \int u'v\,dx + \int u\,v'\,dx

Move one integral across and the formula is there:

u(x)v(x)dx=u(x)v(x)u(x)v(x)dx\int u(x)\,v'(x)\,dx = u(x)\,v(x) - \int u'(x)\,v(x)\,dx

The formula does not evaluate the integral — it trades it for another one. All the effort goes into making that second one easier than the first.

Choosing u

Take as uu the factor that gets simpler when differentiated; as vv', the one you know how to integrate.

integranduuvv'what it buys
xexx\,e^xxxexe^xu=1u' = 1, the product disappears
xsinxx\sin xxxsinx\sin xas above
lnx\ln xlnx\ln x11the logarithm turns into 1x\tfrac{1}{x}
x2exx^2 e^xx2x^2exe^xthe degree drops by one per step
Evaluate ∫ x·eˣ dx.
Evaluate ∫ ln x dx.

When it takes two rounds

If a product is still standing after the first step, the technique is applied again. A polynomial of degree nn against an exponential takes exactly nn steps — each one drops the degree by one.

Evaluate ∫ x²·eˣ dx.

The formula as a picture

For an increasing function that starts at zero, the parts formula can be drawn. Take y=x2y = x^2 on 0;1\langle 0;\, 1 \rangle together with its inverse y=xy = \sqrt{x}:

00.511.500.511.5xyy = x²y = √x
The curve y = x² cuts the unit square in two. The shaded part lies below it; the other one, above it, is at the same time the region under the inverse curve y = √x.

The area under the parabola is 01x2dx=13\int_0^1 x^2\,dx = \tfrac{1}{3}, the area above it is 01xdx=23\int_0^1 \sqrt{x}\,dx = \tfrac{2}{3}. Together they make 11, the area of the whole square — and that is the integration-by-parts formula written without a single letter:

01x2dx+01xdx=11\int_0^1 x^2\,dx + \int_0^1 \sqrt{x}\,dx = 1 \cdot 1

Which technique to reach for

  1. See a composition with the derivative of its inside next to it? Substitution.
  2. See a product of functions of different kinds — a polynomial times an exponential, a polynomial times a sine, a lone logarithm? Parts.
  3. See both at once? Take the one that leaves the shorter integral on the right; if one step made things worse, go back and try the other.
  4. See neither? Try reshaping the integrand first — split the fraction, use a trigonometric identity, pull a constant out in front.

It is worth remembering what all this is computed for: the work done by a variable force is the integral W=F(x)dxW = \int F(x)\,dx, and its result comes out in joules — a unit the energy converter will convert for you.

Exercises

The set mixes three skills: a linear substitution (the answer is graded up to the constant, so the +C+\,C may be left off), integration by parts across three families (xexx e^x, xsinxx\sin x, lnx\ln x), and a definite integral evaluated by substitution, where the answer is a number or a fraction. An indefinite integral is typed as a formula, e.g. (2x+1)^4/8 or x*e^x-e^x.

Practice

Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.

Exercise 1 of 8Score: 0
∫ (2x + 1)³ dx =

What the set deliberately does not ask is the choice of technique together with its justification: the answer to that is a sentence, not a number. You practise it by reading the four points above and checking, on each integral, which one applies.

Common mistakes

  • Forgetting to move the bounds in a definite integral — after a substitution the limits have to be values of uu, not of xx; otherwise you are measuring the area over a different interval entirely.
  • Substituting with no derivative inside — if g(x)g'(x) does not stand in the integral as a factor, the substitution leaves two variables in the expression at once and cannot be finished.
  • Skipping the division by aa in a linear substitutioncos5xdx\int\cos 5x\,dx is 15sin5x+C\tfrac{1}{5}\sin 5x + C, not sin5x+C\sin 5x + C.
  • Choosing uu the wrong way round — if the integral grew after the first step, the roles were reversed; go back and swap the factors.
  • Losing the minus in the parts formula — a minus follows the uvuv term, and with v=cosxv = -\cos x the two minus signs multiply, which is where a sign error is easiest to make.
  • Writing the constant mid-computation — with integration by parts, +C+\,C is written once, at the very end.

Formula card

Topic: Integration by parts and substitution

  • Integration by parts

    u(x)v(x)dx=u(x)v(x)u(x)v(x)dx\int u(x)\,v'(x)\,dx = u(x)\,v(x) - \int u'(x)\,v(x)\,dx

    the product rule, reversed

  • Parts, definite

    abuvdx=[uv]ababuvdx\int_a^b u\,v'\,dx = \Big[u\,v\Big]_a^b - \int_a^b u'\,v\,dx

    the uv term is evaluated at the bounds, the rest stays an integral

  • Integration by substitution

    f(g(x))g(x)dx=F(g(x))+C\int f\big(g(x)\big)\,g'(x)\,dx = F\big(g(x)\big) + C

    the chain rule, reversed

  • The bounds travel

    abf(g(x))g(x)dx=g(a)g(b)f(u)du\int_a^b f\big(g(x)\big)\,g'(x)\,dx = \int_{g(a)}^{g(b)} f(u)\,du

    a substitution moves the limits too

  • Linear substitution

    f(ax+b)dx=1aF(ax+b)+C\int f(ax+b)\,dx = \frac{1}{a}\,F(ax+b) + C

    the commonest case: divide by a

  • The exponential integral

    exdx=ex+C\int e^x\,dx = e^x + C

    needed by the worked examples on parts

−0.500.511.520246810xyy = (2x + 1)²
The region under y = (2x + 1)² between 0 and 1. The substitution u = 2x + 1 turns it into the region on the next drawing — the shape changes, the area does not.
01234012345uyy = u²/2
The same region after the substitution u = 2x + 1. The bounds moved from 0 and 1 to 1 and 3, and the integrand flattened into u²/2. Both areas equal 13/3.
00.511.500.511.5xyy = x²y = √x
The unit square cut in two by y = x². The area below it is 1/3, the area above it — which is the area under the inverse curve y = √x — is 2/3, and together they make the whole square. This is the integration-by-parts formula drawn rather than written.

Frequently asked questions

Related articles