Integration by substitution

Changing the variable

The chain rule says the derivative of \sin(x^2) is \cos(x^2)\cdot2x. So what is \int 2x\cos(x^2)\,dx? How would you spot that answer if you had not just seen the derivative?

Substitution renames the inside of a composition as u. The two graphs below show the same integral before and after the change of variable. Move the upper limit and compare the two shaded areas.

Substitution
x runs over
u runs over
Area in x
Area in u

The method

If u=g(x), then du=g'(x)\,dx, and

\int f(g(x))\,g'(x)\,dx=\int f(u)\,du.

This is the chain rule read backwards. Look for an inside function whose derivative also appears as a factor, perhaps off by a constant.

1. Choose u

Usually the inside of a power, root, exponential or trigonometric function.

2. Find du

Differentiate: du=g'(x)\,dx. If a constant is missing, multiply and divide by it.

3. Rewrite and integrate

Every x must disappear. Integrate in u.

4. Finish

For an indefinite integral, put u=g(x) back. For a definite integral, change the limits to u=g(a) and u=g(b) instead, and never go back to x.

For example, with u=x^2+1 and du=2x\,dx,

\int_0^1 2x(x^2+1)^3\,dx=\int_1^2u^3\,du=\left[\frac{u^4}{4}\right]_1^2=\frac{16-1}{4}=\frac{15}{4}.

The graphs show why the areas agree: the substitution squeezes and stretches the strips, and the factor g'(x) exactly compensates. Where in the top graph is the stretching largest?

Solve it step by step

Choose u, find du, rewrite, and finish. For definite integrals, change the limits. The score counts steps you answer correctly on the first try.

Problems solved0
First-try steps0 of 0

    Common mistakes

    Leaving some x behind

    After substituting, the integral must contain only u and du. If an x is left, the choice of u needs rethinking.

    Forgetting to change the limits

    In \int_0^1, the limits 0 and 1 are values of x. After substituting, they must become values of u.

    Dropping the constant

    If du=2x\,dx but the integral has only x\,dx, then x\,dx=\tfrac12du. The \tfrac12 must stay.