Math Core

Lesson 6.7 · Integration and Accumulation of Change

Integration by substitution

The basic rules handle ∫cos⁡x dx\int \cos x\,dx, but what about ∫xcos⁡(x2) dx\int x\cos(x^2)\,dx? Integrands like this come from the chain rule, and substitution is the technique that runs the chain rule in reverse. It is the most important integration technique in AP Calculus AB.

The chain rule, backward

The chain rule says ddxF(u(x))=F′(u(x)) u′(x)\dfrac{d}{dx} F\big(u(x)\big) = F'\big(u(x)\big)\,u'(x). Reading that as an antiderivative statement,

∫f(u(x)) u′(x) dx=F(u(x))+C,where F′=f.\int f\big(u(x)\big)\,u'(x)\,dx = F\big(u(x)\big) + C, \quad \text{where } F' = f.

So look for an integrand that contains a function u(x)u(x) together with its derivative u′(x)u'(x) as a factor. Then rename u(x)u(x) as uu and replace u′(x) dxu'(x)\,dx with dudu:

∫f(u(x)) u′(x) dx=∫f(u) du.\int f\big(u(x)\big)\,u'(x)\,dx = \int f(u)\,du.

u-substitution steps

  1. Choose uu: usually the "inside" function, such as the expression inside a power, a root, a trig function or an exponent.
  2. Compute du=u′(x) dxdu = u'(x)\,dx.
  3. Rewrite the entire integral in terms of uu and dudu. No xx may be left over. Adjust constant factors if needed.
  4. Integrate with respect to uu.
  5. Substitute back to write the answer in terms of xx.

Worked example: A power of an inside function

Find ∫2x (x2+3)5 dx\displaystyle\int 2x\,(x^2 + 3)^5\,dx.

Let u=x2+3u = x^2 + 3. Then du=2x dxdu = 2x\,dx, which is exactly the rest of the integrand.

∫2x (x2+3)5 dx=∫u5 du=u66+C=(x2+3)66+C.\int 2x\,(x^2 + 3)^5\,dx = \int u^5\,du = \frac{u^6}{6} + C = \frac{(x^2 + 3)^6}{6} + C.

Check by differentiating: 6(x2+3)5⋅2x6=2x(x2+3)5\dfrac{6(x^2 + 3)^5 \cdot 2x}{6} = 2x(x^2 + 3)^5.

Adjusting for a constant factor

Often the derivative of uu is present except for a constant factor. Since constants can move in and out of an integral, you can fix this by solving for the piece you have.

Worked example: Fixing a missing constant

Find ∫xcos⁡(x2) dx\displaystyle\int x\cos(x^2)\,dx.

Let u=x2u = x^2, so du=2x dxdu = 2x\,dx. The integrand has x dxx\,dx, not 2x dx2x\,dx. Solve: x dx=12 dux\,dx = \dfrac{1}{2}\,du.

∫xcos⁡(x2) dx=∫cos⁡u⋅12 du=12sin⁡u+C=12sin⁡(x2)+C.\int x\cos(x^2)\,dx = \int \cos u \cdot \frac{1}{2}\,du = \frac{1}{2}\sin u + C = \frac{1}{2}\sin(x^2) + C.

A common special case is a linear inside function: ∫f(ax+b) dx=1aF(ax+b)+C\displaystyle\int f(ax + b)\,dx = \frac{1}{a}F(ax + b) + C. For example, ∫e3x dx=13e3x+C\displaystyle\int e^{3x}\,dx = \frac{1}{3}e^{3x} + C and ∫cos⁡(5x) dx=15sin⁡(5x)+C\displaystyle\int \cos(5x)\,dx = \frac{1}{5}\sin(5x) + C.

Common mistake

You can only adjust for a constant factor. In ∫cos⁡(x2) dx\displaystyle\int \cos(x^2)\,dx, the needed factor 2x2x is missing entirely, and you can't pull a variable out of the integral to fix it. Substitution doesn't work there. (That integral has no elementary antiderivative at all.)

Substitution in definite integrals

With a definite integral, the limits aa and bb are values of xx. When you switch to uu, you can change the limits to the matching values of uu and never go back to xx.

Worked example: Changing the limits

Evaluate ∫02xx2+1 dx\displaystyle\int_0^2 \frac{x}{x^2 + 1}\,dx.

Let u=x2+1u = x^2 + 1, so du=2x dxdu = 2x\,dx and x dx=12 dux\,dx = \dfrac{1}{2}\,du. Change the limits:

  • when x=0x = 0, u=1u = 1;
  • when x=2x = 2, u=5u = 5.
∫02xx2+1 dx=12∫151u du=12[ln⁡∣u∣]15=12(ln⁡5−ln⁡1)=12ln⁡5.\int_0^2 \frac{x}{x^2 + 1}\,dx = \frac{1}{2}\int_1^5 \frac{1}{u}\,du = \frac{1}{2}\Big[\ln\lvert u\rvert\Big]_1^5 = \frac{1}{2}(\ln 5 - \ln 1) = \frac{1}{2}\ln 5.

Tip

If you'd rather not change the limits, you can find the antiderivative in terms of uu, substitute back to xx, and then use the original limits. What you can't do is mix them: uu-limits with an xx-antiderivative, or the reverse, gives a wrong answer.

Algebra first: long division and completing the square

Some integrands need to be rearranged before any rule or substitution applies.

Long division. When a rational function's numerator has degree at least as large as its denominator's, divide first.

Worked example: Divide, then integrate

Find ∫x2+2x+3x+1 dx\displaystyle\int \frac{x^2 + 2x + 3}{x + 1}\,dx.

Rewrite the numerator: x2+2x+3=(x+1)2+2=(x+1)(x+1)+2x^2 + 2x + 3 = (x + 1)^2 + 2 = (x + 1)(x + 1) + 2. So

x2+2x+3x+1=x+1+2x+1.\frac{x^2 + 2x + 3}{x + 1} = x + 1 + \frac{2}{x + 1}.

Integrate each piece (the last one with u=x+1u = x + 1):

∫(x+1+2x+1)dx=x22+x+2ln⁡∣x+1∣+C.\int \left(x + 1 + \frac{2}{x + 1}\right) dx = \frac{x^2}{2} + x + 2\ln\lvert x + 1\rvert + C.

Completing the square. A quadratic denominator with no real roots can be rewritten as (x−h)2+k2(x - h)^2 + k^2, which leads to arctangent. When k=1k = 1, the substitution u=x−hu = x - h gives

∫1(x−h)2+1 dx=arctan⁡(x−h)+C.\int \frac{1}{(x - h)^2 + 1}\,dx = \arctan(x - h) + C.

For instance, x2+4x+5=(x+2)2+1x^2 + 4x + 5 = (x + 2)^2 + 1, so ∫dxx2+4x+5=arctan⁡(x+2)+C\displaystyle\int \frac{dx}{x^2 + 4x + 5} = \arctan(x + 2) + C.

Practice

Practice 1

Find the antiderivative FF of f(x)=3x2(x3+1)4f(x) = 3x^2(x^3 + 1)^4 that satisfies F(0)=0F(0) = 0.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 2

∫cos⁡(5x) dx=\displaystyle\int \cos(5x)\,dx =

Practice 3

Evaluate ∫0π/2sin⁡3xcos⁡x dx\displaystyle\int_0^{\pi/2} \sin^3 x \cos x\,dx.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Evaluate ∫01xex2 dx\displaystyle\int_0^1 x e^{x^2}\,dx. Give an exact answer or a decimal accurate to three places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Evaluate ∫122xx2+1 dx\displaystyle\int_1^2 \frac{2x}{x^2 + 1}\,dx. Give an exact answer or a decimal accurate to three places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Using the substitution u=2x+1u = 2x + 1, the integral ∫01(2x+1)3 dx\displaystyle\int_0^1 (2x + 1)^3\,dx is equal to which of the following?

Practice 7

Evaluate ∫25xx−1 dx\displaystyle\int_2^5 x\sqrt{x - 1}\,dx.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Evaluate ∫011x2+2x+2 dx\displaystyle\int_0^1 \frac{1}{x^2 + 2x + 2}\,dx. Give an exact answer or a decimal accurate to three places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.