Integration by Substitution

The chain rule, read backwards, is a way to integrate: an integrand of the form g(u(x))·u′(x) is the derivative of G(u(x)). Below, the area under such an integrand is cut into slices, and each slice is carried to the u-axis, where it covers a different interval with exactly the same area. Then step through one substitution, and try your own.

Indefinite
Definite: the limits move with u
Loading interactive simulation...

Lesson

The theory — Integration by Substitution

Integration by substitution is the chain rule read backwards. If an integrand has the form g(u(x))·u′(x) and G is an antiderivative of g, then G(u(x)) is an antiderivative of the integrand, because its derivative is G′(u(x))·u′(x). For a definite integral the limits move with the variable: ∫ab g(u(x)) u′(x) dx = ∫u(a)u(b) g(u) du.

What each symbol means

u
the inside function, which becomes the new variable
du
u′(x) dx, the factor that must already stand in the integrand, up to a constant

Where the formula comes from

  1. Why the slices match. Over one slice [xi, xi+1] the area under g(u(x))·u′(x) is G(u(xi+1)) − G(u(xi)), because G(u(x)) is an antiderivative, and that is also the area under g from u(xi) to u(xi+1), whichever way round those two numbers are. Add the slices and the inner terms cancel in pairs, leaving G(u(b)) − G(u(a)).
Assumes
The x-side area is computed numerically, by Simpson's rule refined wherever the curve bends sharply, and the u-side from G, so the two agreeing is a check rather than an identity. They agree to four decimal places at every setting the controls allow.

Problems solved in full

  1. A linear inside 3 steps

    Find ∫(3x − 2)⁵ dx.

    Open this problem in the tool

    1. The inside is linear. Call it u; its derivative is the constant 3, so dx is du/3:

    2. Integrate the power of u:

    3. Put x back:

    Answer

    (3x − 2)⁶/18 + C. Forgetting the 3 gives (3x − 2)⁶/6. Open the problem in the tool and type that, and the verdict reports a derivative three times the integrand.

  2. The derivative is already there 3 steps

    Find ∫x(x² + 1)⁴ dx.

    Open this problem in the tool

    Show solution
    1. The x beside the bracket is half of the bracket’s derivative, 2x:

    2. So the whole integral is a power of u:

    3. Back to x:

    Answer

    (x² + 1)⁵/10 + C. The x is what makes this work. Without it, ∫(x² + 1)⁴ dx has no du to use, and the way through is to expand the bracket.

  3. The top is the derivative of the bottom 3 steps

    Find ∫(2x + 1)/(x² + x + 3) dx.

    Open this problem in the tool

    Show solution
    1. The numerator is exactly the derivative of the denominator:

    2. So the integral is ∫du/u:

    3. The bars can go, because the denominator is never negative:

    Answer

    ln(x² + x + 3) + C. Look for this in every fraction: ∫f′/f dx = ln|f| + C. Had the top been x + ½, the answer would be half of this.

  4. ∫tan x 3 steps

    Find ∫tan x dx.

    Open this problem in the tool

    Show solution
    1. Write tan x as a fraction. Its top is the derivative of its bottom, apart from the sign:

    2. So the integral is minus ∫du/u:

    3. Put x back. The two forms are one answer, because −ln a = ln(1/a):

    Answer

    −ln|cos x| + C, also written ln|sec x| + C. The minus sign is the part that goes missing: ln|cos x| differentiates to −tan x, and the tool calls that a wrong sign.

  5. u = ln x 3 steps

    Find ∫(ln x)²/x dx for x > 0.

    Open this problem in the tool

    Show solution
    1. The 1/x is the derivative of ln x, so it is the du:

    2. What is left is a power of u:

    3. Back to x:

    Answer

    (ln x)³/3 + C. Every integrand of the shape g(ln x)/x falls the same way.

  6. When x has to be written in u 4 steps

    Find ∫x√(x + 1) dx.

    Open this problem in the tool

    Show solution
    1. Take u = x + 1, so du = dx. The x in front is not part of du, so write it in u:

    2. Multiply out, so that every term is a power of u:

    3. Integrate each power:

    4. Put x back:

    Answer

    (2/5)(x + 1)5/2 − (2/3)(x + 1)3/2 + C. Integrating x and √(x + 1) separately and multiplying the results is the slip to avoid: the integral of a product is not the product of the integrals.

  7. Move the limits with the variable 3 steps

    Evaluate ∫01 2x(x² + 1)³ dx.

    Show solution
    1. The 2x is du for u = x² + 1:

    2. Move the limits with the variable:

    3. Integrate between the new limits:

    Answer

    15/4 = 3.75. Keeping the old limits, 0 to 1, gives 1/4. The other safe route is to put x back first and use the old limits; mixing u with the old limits is the error.

  8. How far out does the area reach 5? 4 steps

    The curve x/(1 + x²) falls towards 0 as x grows. How far from 0 must b be for the area from 0 to b to reach 5, and how high is the curve there? Press A slow logarithm: from 0 to 3 the area is 1.1513.

    Open this problem in the tool

    Show solution
    1. With u = 1 + x², du = 2x dx, so x dx = du/2 and the area is half a logarithm:

    2. At b = 3 that is ½ ln 10, the page's figure. Set it equal to 5:

    3. There the curve stands only

    4. Doubling the area to 10 needs

    Answer

    b ≈ 148.4, where the curve is 0.0067 high. The area never stops growing, but for large b it grows like ln b, so each further unit of area multiplies b by about e ≈ 2.72. The page's slider stops at b = 5.

You can divide out a missing constant, never a missing x 🖖

Press A missing −2. The integrand is x·e−x² and e−x² has been typed. By the chain rule its derivative is e−x²·(−2x), which is −2 times the integrand at every point, and the verdict says exactly that. With u = −x², du = −2x dx: the integrand's x is the du you need apart from the −2, and a constant passes through the integral sign, so divide by it. −½e−x² is right. Now press A missing x. The integrand is e−x² with no x beside it, and dividing by the missing −2x anyway gives e−x²/(−2x). The quotient rule takes that apart: its derivative is the integrand times 1 + 1/(2x²), half as big again at x = 1, still 1.0556 times too big at x = 3, and equal nowhere. A constant can be moved through ∫, and x cannot, because x is what the integral runs over: dividing an answer by a missing x is never a substitution. No formula built from powers, exponentials, logarithms and trigonometric functions differentiates to e−x²; Liouville proved that, and the last rung of this chapter shows what it means.

Keep x's limits and the area can change sign 🖖

Press Keep the limits?. The integrand 2x cos(x²) is cos u times du for u = x², so the slices of [0, 2] land on [0, 4] of the u-axis, since 2² = 4. Both panels give −0.7568, which is sin 4. The dashed outline in the lower panel is the slip: substitute into the integrand but keep the old limits, so cos u is integrated from 0 to 2. That gives sin 2 = 0.9093, positive, where the true area is negative. cos u is below zero from u = π/2 onwards, which is more than half of the interval [0, 4], and the old limits stop at 2, before most of it. Press Map the slices and each slice's area enters both running totals at the same moment, because over one slice both sides are G(u(xᵢ₊₁)) − G(u(xᵢ)).

u does not have to be one-to-one 🖖

Press Back and forth. On [0, π], u = sin x climbs from 0 to 1 and comes back down to 0. The slices of the first half land on [0, 1] travelling right and carry 1.7183, which is e − 1. The slices of the second half land on the same [0, 1] travelling left, hatched in red, and carry −1.7183, because u′ = cos x is negative there and so is every du. They cancel, and ∫0π cos x·esin x dx = 0, the same as the empty integral from u(0) = 0 to u(π) = 0. The substitution rule asks that u′ be continuous, and that g be continuous at every value u passes through; it never asks u to keep going one way. A slice that runs back is subtracted, and that is the whole of the bookkeeping. Keep x's limits here instead and you integrate eᵘ from 0 to π: 22.1407.

Learning path

Techniques of integration

References (2)