M5.5.5 Chapter 5

Substitution and integration by parts

How do I integrate a product, or a function with something more than x inside?

Your guess

Pick one before you read on. It is fine to be wrong.

Your guess
  • You picked A. Read on. At the end, the chapter comes back to your guess.

  • You picked B. Read on. At the end, the chapter comes back to your guess.

  • You picked C. Read on. At the end, the chapter comes back to your guess.

By the end you can

  • Integrate x(x² + 1)⁴ by substitution
  • Integrate x eˣ by parts
  • Choose between substitution and parts for an integral

Some integrals do not fit the rules so far. The function x(x² + 1)⁴ is a product, and it has x² + 1 inside a power. The function x eˣ is a product of two different kinds of function. Both can be done by reading a differentiation rule backwards. The chain rule gives substitution. The product rule gives integration by parts.

First, substitution. The chain rule says that the gradient of (x² + 1)⁵ is 5(x² + 1)⁴ × 2x. So the integrand, the function we integrate, x(x² + 1)⁴ is a fifth of a half of that, with a factor 2x that comes from the inside. Substitution makes this tidy. We replace the inside, x² + 1, by a single letter u.

Write u = x² + 1. Then du/dx = 2x, which we write as du = 2x dx. In the integral, the part x dx is half of 2x dx. So x dx = du/2. Everything in x is replaced by something in u, and the new integral is easier.

Worked example

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

  1. Let u = x² + 1. Then du/dx = 2x, so du = 2x dx and x dx = du/2.
  2. Replace x² + 1 by u, and x dx by du/2. The integral becomes ∫ u⁴ × du/2.
  3. Take the 1/2 out: (1/2) ∫ u⁴ du = (1/2) × u⁵/5 + c = u⁵/10 + c.
  4. Put back u = x² + 1. The answer is (x² + 1)⁵/10 + c.
  5. Check: differentiating gives 5(x² + 1)⁴ × 2x ÷ 10 = x(x² + 1)⁴. This agrees.

Answer: (x² + 1)⁵/10 + c

When does substitution work? When the integrand has an inside function g(x), and also its derivative g′(x), up to a number. Here g(x) = x² + 1 and g′(x) = 2x, and the integrand has x, which is half of 2x. If the derivative is not there, substitution does not help.

In a definite integral, change the limits too. The limits were values of x. After the substitution they must be values of u. Put each limit into u = g(x). Then you do not have to go back to x at the end.

A table with the heads in x and in u. The rows read x = 0 and u = 1, x = 2 and u = 5, x² + 1 and u, x dx and du/2.in xin ux = 0u = 1x = 2u = 5x² + 1ux dxdu/2
Everything in x on the left has a partner in u on the right. Use u = x² + 1.

Worked example

Find ∫ from 0 to 2 of x(x² + 1)³ dx.

  1. Let u = x² + 1, so x dx = du/2.
  2. The limits change. At x = 0, u = 0² + 1 = 1. At x = 2, u = 2² + 1 = 5.
  3. The integral becomes (1/2) ∫ u³ du, with u from 1 to 5.
  4. An integral of u³ is u⁴/4. So the value is (1/2) × [u⁴/4] from 1 to 5, which is [u⁴/8].
  5. At u = 5: 625/8. At u = 1: 1/8. The difference is 624/8 = 78.
  6. The integral, and the area under the curve, is 78.

Answer: 78

A graph with the x axis named x from 0 to 2 and a y axis from 0 to 250 named y. A curve named y = x(x² + 1)³ rises from the origin, slowly at first, to 250 at x = 2. The region under the curve from x = 0 to x = 2 is hatched and named A.00.511.520100200xyy = x(x² + 1)³A
The area A is 78. The rest of the rectangle, 2 wide and 250 high, is much larger.

Now integration by parts. The product rule says that the gradient of uv is u(dv/dx) + v(du/dx). Integrate both sides: uv = ∫ u (dv/dx) dx + ∫ v (du/dx) dx. Rearranging gives the formula, ∫ u (dv/dx) dx = uv − ∫ v (du/dx) dx. It turns one integral into another, which we hope is easier.

To use it, split the integrand into two parts. Call one u and the other dv/dx. Choose u to be the part that gets simpler when you differentiate it. A power of x is a good u, because differentiating lowers the power. Choose dv/dx to be a part you can integrate. Then work out du/dx and v, and put all four into the formula.

Worked example

Find ∫ x eˣ dx.

  1. Choose u = x, because it becomes 1 when differentiated. Then dv/dx = eˣ.
  2. Differentiate u: du/dx = 1. Integrate dv/dx: v = eˣ. We leave out the constant here.
  3. The formula gives ∫ x eˣ dx = x eˣ − ∫ eˣ × 1 dx.
  4. The new integral is one we know: ∫ eˣ dx = eˣ.
  5. So the answer is x eˣ − eˣ + c, which is (x − 1)eˣ + c.
  6. Check: differentiating (x − 1)eˣ gives eˣ + (x − 1)eˣ = x eˣ. This agrees.

Answer: (x − 1)eˣ + c

A table with the heads u, dv/dx, du/dx and v. The first row reads x, eˣ, 1 and eˣ. The second row reads x, cos x, 1 and sin x.udv/dxdu/dxvxeˣ1eˣxcos x1sin x
Setting out the four parts for x eˣ (first row) and x cos x (second row).

Worked example

Find ∫ x cos x dx.

  1. Choose u = x and dv/dx = cos x. Then du/dx = 1 and v = sin x.
  2. The formula gives ∫ x cos x dx = x sin x − ∫ sin x dx.
  3. The integral of sin x is −cos x. So −∫ sin x dx = +cos x.
  4. The answer is x sin x + cos x + c.
  5. Check: differentiating x sin x gives sin x + x cos x, and differentiating cos x gives −sin x. The sum is x cos x.

Answer: x sin x + cos x + c

Worked example

Find ∫ from 0 to 1 of x eˣ dx.

  1. An integral of x eˣ is (x − 1)eˣ, from the example above.
  2. At x = 1: (1 − 1)e¹ = 0.
  3. At x = 0: (0 − 1)e⁰ = −1.
  4. Subtract: 0 − (−1) = 1.
  5. The area under y = x eˣ from 0 to 1 is exactly 1.

Answer: 1

A graph with the x axis named x from 0 to 1 and a y axis from 0 to 3 named y. A curve named y = x eˣ rises from the origin to about 2.7 at x = 1. The region under the curve is hatched and named A.00.510123xyy = x eˣA
The area A is exactly 1.

How do you choose? Look at the integrand. If it has a function of x inside another function, and the derivative of the inside is also there, use substitution. If it is a product of two parts that do not fit that pattern, such as x with eˣ, use parts. The table gives examples.

A table with the heads integral and method. The rows read x(x² + 1)⁴ and substitution, x eˣ and parts, x e^(x²) and substitution, x cos x and parts.integralmethodx(x² + 1)⁴substitutionx eˣpartsx e^(x²)substitutionx cos xparts
In x e^(x²) the derivative of x² is 2x, so substitution works. In x eˣ the inside is x, and its derivative is 1. The extra factor x is not the derivative of the inside, so nothing cancels. Use parts.

See it three ways

With things

Rebuilding a wall: first you take it down in one order, then you put it back in the reverse order. Differentiating e²ˣ with the chain rule gives a factor 2. Substitution reverses it, and divides by that factor. The product rule and parts are another pair.

As a picture

Two boxes. The left box is labelled e²ˣ and the right box is labelled 2e²ˣ. A top arrow from the left box to the right box is labelled differentiate. A lower arrow from the right box back to the left box is labelled integrate.e²ˣ2e²ˣdifferentiateintegrate

In words

Substitution undoes the chain rule. Parts undoes the product rule.

In symbols

∫ f(g(x)) g′(x) dx = ∫ f(u) du. ∫ u (dv/dx) dx = uv − ∫ v (du/dx) dx.

Try it

Check an answer with a calculator

You need: a calculator.

  1. Let F(x) = (x² + 1)⁵ ÷ 10. Work out F(0.49), F(0.50) and F(0.51).
  2. Subtract F(0.49) from F(0.51), and divide by 0.02. This is the gradient of F at x = 0.5, near enough.
  3. Work out x(x² + 1)⁴ at x = 0.5.
  4. Compare the two numbers.

What you will see: The gradient of F at 0.5 comes to 1.221, and x(x² + 1)⁴ at 0.5 is 1.221. They agree, so F is an integral of x(x² + 1)⁴. A numerical check like this finds a wrong factor, such as a missing 2.

If you cannot try it, this is what happens.
A table with the heads x and F(x). The rows read 0.49 and 0.293281, 0.5 and 0.305176, 0.51 and 0.317706.xF(x)0.490.2932810.50.3051760.510.317706

A wrong idea many people have

To integrate x eˣ, I integrate each factor, to get x²/2 times eˣ.

Why it feels right: A sum is integrated term by term, so a product seems to work factor by factor.

The test that breaks it: Differentiate (x²/2) eˣ. The product rule gives x eˣ + (x²/2) eˣ, not x eˣ.

What is true: There is no rule for the integral of a product of two factors. Use parts, which gives (x − 1)eˣ + c.

A wrong idea many people have

In a definite integral with substitution, I change the integrand to u but keep the limits as x values.

Why it feels right: The limits belong to the question, so it seems they should stay the same.

The test that breaks it: In the example with x from 0 to 2, the limits for u are 1 and 5. Using 0 and 2 for u would give (2⁴ − 0⁴)/8 = 2, not the true 78.

What is true: The limits are values of the variable you are integrating with. After u = x² + 1 they are values of u: put each x limit into the substitution.

Key words

substitution
replacing an inside function by u, so the integral becomes simpler. It undoes the chain rule.
integration by parts
the formula ∫ u (dv/dx) dx = uv − ∫ v (du/dx) dx. It undoes the product rule.

Back to your guess

The answer is B: The integral of x(x² + 1)⁴ is (x² + 1)⁵ ÷ 10, because the bracket has an inside that differentiates to 2x.

Differentiate (x² + 1)⁵ ÷ 10. The chain rule gives 5(x² + 1)⁴ × 2x ÷ 10, which is x(x² + 1)⁴. The first idea is missing the 2x from the inside, so it is out by a factor 2. Multiplying the integrals of two factors never works. This chapter gives two methods that do.

Check yourself

Try each one before you look. A wrong answer tells you where to go next.

  1. To integrate x(x² + 1)⁴ by substitution, which substitution do you use?

    Tap your answer.
    1. Not this one. This does not simplify the bracket. The inside function, x² + 1, is what we replace. Read this page again. Try another.

    2. Not this one. Then du would be a complicated expression. Replace the inside, not the whole power. Read this page again. Try another.

    3. Not this one. 2x is the derivative of the inside, not the inside itself. Read this page again. Try another.

    4. Yes, that is right. Let u be the inside of the power, x² + 1. Its derivative is 2x, and x dx is half of 2x dx, so the substitution works.

    See the answer

    u = x² + 1

    Let u be the inside of the power, x² + 1. Its derivative is 2x, and x dx is half of 2x dx, so the substitution works.

    • If you chose A: This does not simplify the bracket. The inside function, x² + 1, is what we replace. Read this page again.
    • If you chose B: Then du would be a complicated expression. Replace the inside, not the whole power. Read this page again.
    • If you chose C: 2x is the derivative of the inside, not the inside itself. Read this page again.
  2. Which method suits ∫ x e^(x²) dx?

    Tap your answer.
    1. Not this one. We cannot write the integral of e^(x²) with the functions we know, so this fails. Substitution does the job. Read this page again. Try another.

    2. Not this one. There is no rule that integrates the factors one by one. Read this page again. Try another.

    3. Yes, that is right. The inside of the exponential is x². Its derivative is 2x, and the integrand has x. So u = x² gives x dx = du/2 and the integral is (1/2) ∫ e to the power u, du.

    See the answer

    Substitution, with u = x².

    The inside of the exponential is x². Its derivative is 2x, and the integrand has x. So u = x² gives x dx = du/2 and the integral is (1/2) ∫ e to the power u, du.

    • If you chose A: We cannot write the integral of e^(x²) with the functions we know, so this fails. Substitution does the job. Read this page again.
    • If you chose B: There is no rule that integrates the factors one by one. Read this page again.
  3. Which choice of u and dv/dx is best for ∫ x cos x dx?

    Tap your answer.
    1. Not this one. Then v = x²/2 and du/dx = −sin x. The new integral, of x² sin x, is harder than the one we started with. Read this page again. Try another.

    2. Yes, that is right. Choose u as the part that becomes simpler when differentiated: x becomes 1. Then dv/dx = cos x has integral sin x, and the new integral is ∫ sin x dx.

    3. Not this one. Then du/dx is a product again, so the new integral is not simpler. Read this page again. Try another.

    See the answer

    u = x and dv/dx = cos x

    Choose u as the part that becomes simpler when differentiated: x becomes 1. Then dv/dx = cos x has integral sin x, and the new integral is ∫ sin x dx.

    • If you chose A: Then v = x²/2 and du/dx = −sin x. The new integral, of x² sin x, is harder than the one we started with. Read this page again.
    • If you chose C: Then du/dx is a product again, so the new integral is not simpler. Read this page again.
  4. Find ∫ from 0 to 1 of 2x(x² + 1)³ dx. Give a fraction.

    See the answer

    15/4

    Let u = x² + 1, so 2x dx = du. The limits become 1 and 2. The integral is ∫ u³ du = [u⁴/4] from 1 to 2 = 16/4 − 1/4 = 15/4.

  5. Find ∫ from 0 to 1 of 2x(x² + 1)² dx. Give a fraction or a whole number.

    See the answer

    7/3

    Let u = x² + 1, so 2x dx = du, and the limits are 1 and b² + 1. The integral is [uⁿ⁺¹/(n + 1)] = ((b² + 1)ⁿ⁺¹ − 1)/(n + 1). For b = 1 and n = 2 this is (8 − 1)/3 = 7/3.

  6. Using parts for ∫ x eˣ dx, we get x eˣ − ∫ (something) dx. What goes in the brackets?

    Tap your answer.
    1. Yes, that is right. With u = x and dv/dx = eˣ we have du/dx = 1 and v = eˣ. The integral to subtract is ∫ v (du/dx) dx = ∫ eˣ dx.

    2. Not this one. That is the original integrand. The formula subtracts the integral of v × du/dx. Read this page again. Try another.

    3. Not this one. That is the integral of x, which is not part of the formula here. With u = x, the integral to subtract is of v × du/dx = eˣ × 1. Read this page again. Try another.

    See the answer

    eˣ

    With u = x and dv/dx = eˣ we have du/dx = 1 and v = eˣ. The integral to subtract is ∫ v (du/dx) dx = ∫ eˣ dx.

    • If you chose B: That is the original integrand. The formula subtracts the integral of v × du/dx. Read this page again.
    • If you chose C: That is the integral of x, which is not part of the formula here. With u = x, the integral to subtract is of v × du/dx = eˣ × 1. Read this page again.
  7. Find ∫ from 0 to 2 of x eˣ dx, to 3 significant figures.

    See the answer

    8.39

    An integral of x eˣ is (x − 1)eˣ. At 2 it is e² = 7.389, and at 0 it is −1. The difference is 7.389 − (−1) = 8.389, which is 8.39.

  8. Find ∫ x sin x dx.

    Tap your answer.
    1. Not this one. Differentiating gives cos x − x sin x − cos x = −x sin x. The whole answer has the wrong sign. Read this page again. Try another.

    2. Not this one. Differentiating gives −cos x + x sin x − cos x = x sin x − 2 cos x. The sin x term should be added, not taken away. Read this page again. Try another.

    3. Yes, that is right. With u = x and dv/dx = sin x we have du/dx = 1 and v = −cos x. The formula gives −x cos x − ∫ (−cos x) dx = −x cos x + sin x. Differentiating gives −cos x + x sin x + cos x = x sin x.

    4. Not this one. Differentiating needs the product rule and gives −x cos x + (x²/2) sin x, which is not x sin x. Read this page again. Try another.

    See the answer

    −x cos x + sin x + c

    With u = x and dv/dx = sin x we have du/dx = 1 and v = −cos x. The formula gives −x cos x − ∫ (−cos x) dx = −x cos x + sin x. Differentiating gives −cos x + x sin x + cos x = x sin x.

    • If you chose A: Differentiating gives cos x − x sin x − cos x = −x sin x. The whole answer has the wrong sign. Read this page again.
    • If you chose B: Differentiating gives −cos x + x sin x − cos x = x sin x − 2 cos x. The sin x term should be added, not taken away. Read this page again.
    • If you chose D: Differentiating needs the product rule and gives −x cos x + (x²/2) sin x, which is not x sin x. Read this page again.
  9. When we substitute u = x² + 1 in an integral from x = 0 to x = 2, what are the limits for u?

    Tap your answer.
    1. Yes, that is right. At x = 0, u = 0² + 1 = 1. At x = 2, u = 2² + 1 = 5.

    2. Not this one. These are the x limits. Put each into u = x² + 1 to get the u limits. Read this page again. Try another.

    3. Not this one. You forgot the +1 at the upper limit. At x = 2, u = 4 + 1 = 5. Read this page again. Try another.

    See the answer

    u = 1 and u = 5

    At x = 0, u = 0² + 1 = 1. At x = 2, u = 2² + 1 = 5.

    • If you chose B: These are the x limits. Put each into u = x² + 1 to get the u limits. Read this page again.
    • If you chose C: You forgot the +1 at the upper limit. At x = 2, u = 4 + 1 = 5. Read this page again.
  10. From an earlier chapter

    Find ∫ cos 5x dx. This is from chapter 4.

    Tap your answer.
    1. Not this one. Differentiating gives 5 cos 5x, so there is an extra factor 5. Divide by 5. Go to M5.5.4. Try another.

    2. Not this one. You multiplied by 5. The integral divides by the number before x. Go to M5.5.4. Try another.

    3. Yes, that is right. Differentiating sin 5x gives 5 cos 5x. To get cos 5x alone, divide by 5.

    See the answer

    sin 5x/5 + c

    Differentiating sin 5x gives 5 cos 5x. To get cos 5x alone, divide by 5.

    • If you chose A: Differentiating gives 5 cos 5x, so there is an extra factor 5. Divide by 5. Go to M5.5.4.
    • If you chose B: You multiplied by 5. The integral divides by the number before x. Go to M5.5.4.

Keep it

Copy this into your exercise book.

Substitution: let u be the inside, du = u′ dx, change the limits. Parts: ∫ u dv = uv − ∫ v du, with u the part that gets simpler. Check by differentiating.

Draw: Two boxes, e²ˣ and 2e²ˣ, with arrows differentiate and integrate.

Reading with a child? A short page for the adult: what this chapter teaches and three questions to ask.

No internet tomorrow? Save the whole book as one file (910 KB). It opens on any phone.