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.
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.
- Let u = x² + 1. Then du/dx = 2x, so du = 2x dx and x dx = du/2.
- Replace x² + 1 by u, and x dx by du/2. The integral becomes ∫ u⁴ × du/2.
- Take the 1/2 out: (1/2) ∫ u⁴ du = (1/2) × u⁵/5 + c = u⁵/10 + c.
- Put back u = x² + 1. The answer is (x² + 1)⁵/10 + c.
- 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.
Worked example
Find ∫ from 0 to 2 of x(x² + 1)³ dx.
- Let u = x² + 1, so x dx = du/2.
- The limits change. At x = 0, u = 0² + 1 = 1. At x = 2, u = 2² + 1 = 5.
- The integral becomes (1/2) ∫ u³ du, with u from 1 to 5.
- An integral of u³ is u⁴/4. So the value is (1/2) × [u⁴/4] from 1 to 5, which is [u⁴/8].
- At u = 5: 625/8. At u = 1: 1/8. The difference is 624/8 = 78.
- The integral, and the area under the curve, is 78.
Answer: 78
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.
- Choose u = x, because it becomes 1 when differentiated. Then dv/dx = eˣ.
- Differentiate u: du/dx = 1. Integrate dv/dx: v = eˣ. We leave out the constant here.
- The formula gives ∫ x eˣ dx = x eˣ − ∫ eˣ × 1 dx.
- The new integral is one we know: ∫ eˣ dx = eˣ.
- So the answer is x eˣ − eˣ + c, which is (x − 1)eˣ + c.
- Check: differentiating (x − 1)eˣ gives eˣ + (x − 1)eˣ = x eˣ. This agrees.
Answer: (x − 1)eˣ + c
Worked example
Find ∫ x cos x dx.
- Choose u = x and dv/dx = cos x. Then du/dx = 1 and v = sin x.
- The formula gives ∫ x cos x dx = x sin x − ∫ sin x dx.
- The integral of sin x is −cos x. So −∫ sin x dx = +cos x.
- The answer is x sin x + cos x + c.
- 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.
- An integral of x eˣ is (x − 1)eˣ, from the example above.
- At x = 1: (1 − 1)e¹ = 0.
- At x = 0: (0 − 1)e⁰ = −1.
- Subtract: 0 − (−1) = 1.
- The area under y = x eˣ from 0 to 1 is exactly 1.
Answer: 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.
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
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.
- Let F(x) = (x² + 1)⁵ ÷ 10. Work out F(0.49), F(0.50) and F(0.51).
- 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.
- Work out x(x² + 1)⁴ at x = 0.5.
- 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.
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.
To integrate x(x² + 1)⁴ by substitution, which substitution do you use?
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.
Which method suits ∫ x e^(x²) dx?
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.
Which choice of u and dv/dx is best for ∫ x cos x dx?
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.
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.
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.
Using parts for ∫ x eˣ dx, we get x eˣ − ∫ (something) dx. What goes in the brackets?
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.
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.
Find ∫ x sin x dx.
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.
When we substitute u = x² + 1 in an integral from x = 0 to x = 2, what are the limits for u?
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.
From an earlier chapter
Find ∫ cos 5x dx. This is from chapter 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.