Step 22: Integration by Substitution
- Substitution undoes the chain rule. Spot an inside function \( u = g(x) \) whose derivative \( g'(x) \) is also sitting in the integrand, then write everything, including \( dx \), in terms of \( u \).
- In a definite integral, change the limits to values of \( u \) as well, and never mix \( x \)-limits with a \( u \)-integral.
- Two patterns are worth knowing on sight: \( \int \frac{f'(x)}{f(x)}\,dx = \ln|f(x)| + C \) and \( \int f'(x)[f(x)]^n\,dx = \frac{[f(x)]^{n+1}}{n+1} + C \). Squares of sine and cosine need the double angle identities; \( \frac{1}{x^2 + a^2} \) and \( \frac{1}{\sqrt{a^2-x^2}} \) give \( \tan^{-1} \) and \( \sin^{-1} \).
- Exam point: Cambridge 9709 Paper 3 always tells you the substitution, and the line converting \( dx \) and the limits carries method marks. On AP you choose \( u \) yourself.
Undoing the chain rule
The rules in Step 21 handle powers, exponentials and trigonometric functions of \( ax + b \). They cannot touch \( \int 2x(x^2 + 1)^5\,dx \), because the inside, \( x^2 + 1 \), is not linear. But look at the shape: there is a bracket raised to a power, and next to it sits \( 2x \), which is exactly the derivative of the bracket. That is the fingerprint of the chain rule. Differentiate \( (x^2 + 1)^6 \) and you get \( 6(x^2 + 1)^5 \cdot 2x \). So \( \int 2x(x^2 + 1)^5\,dx = \tfrac16(x^2 + 1)^6 + C \).
Substitution is the method that finds this without guessing. Name the inside \( u = x^2 + 1 \). Then \( \dfrac{du}{dx} = 2x \), which we write as \( du = 2x\,dx \). The integral becomes \( \int u^5\,du = \tfrac16u^6 + C \), and putting \( x \) back gives the same answer.
Writing \( du = g'(x)\,dx \) is bookkeeping, not a new rule. If \( F \) is an antiderivative of \( f \), the chain rule says \( \frac{d}{dx}F(g(x)) = f(g(x))\,g'(x) \), so \( F(g(x)) \) is the antiderivative you wanted.
Find \( \int x^2(x^3 + 2)^4\,dx \).
Check by differentiating: \( \tfrac{1}{15} \cdot 5(x^3 + 2)^4 \cdot 3x^2 = x^2(x^3 + 2)^4 \). A constant factor that does not match (here \( \tfrac13 \)) is fine; a missing \( x \) is not. You could not use this \( u \) on \( \int (x^3 + 2)^4\,dx \), because there would be no \( x^2 \) to absorb.
Evaluate \( \displaystyle\int_0^2 \frac{x}{(x^2 + 1)^2}\,dx \).
There is no need to go back to \( x \): the new limits belong to \( u \). Figure 1 shows why this works. The region under the new curve is a different shape, but it has exactly the same area.
How to choose \( u \). On AP and IB papers nobody tells you the substitution, so it helps to know where to look. In almost every exam question, \( u \) is the “inside” of something: the expression inside a bracket that is raised to a power, inside a square root, in the exponent of \( e \), or in the denominator. Then you check that its derivative, or a constant multiple of it, is also there as a factor. If it is, the substitution will work. If there is a stray \( x \) left over that you cannot absorb, try a different \( u \), or a different method altogether.
| Integrand looks like | Try | Because the integrand contains |
|---|---|---|
| \( x^3\sqrt{x^4 + 5} \) | \( u = x^4 + 5 \) | \( x^3 \), a multiple of \( 4x^3 \) |
| \( x\,e^{-x^2} \) | \( u = -x^2 \) | \( x \), a multiple of \( -2x \) |
| \( \dfrac{\ln x}{x} \) | \( u = \ln x \) | \( \tfrac1x \), the derivative of \( \ln x \) |
| \( \cos x\,e^{\sin x} \) | \( u = \sin x \) | \( \cos x \), the derivative of \( \sin x \) |
So, for example, \( \int \dfrac{\ln x}{x}\,dx = \int u\,du = \tfrac12(\ln x)^2 + C \), and \( \int \cos x\,e^{\sin x}\,dx = e^{\sin x} + C \).
When the substitution is given
Cambridge 9709 Paper 3 (topic 3.5) does not ask you to invent a substitution: the question says “use the substitution \( u = \ldots \)”. Often the substitution is not “a bracket and its derivative”. Then you make \( x \) the subject, replace every \( x \), and convert \( dx \) using \( \dfrac{du}{dx} \).
Use the substitution \( u = x-1 \) to find the exact value of \( \displaystyle\int_2^5 x\sqrt{x-1}\,dx \).
The square root of a linear expression is the usual reason for such a substitution: it turns \( \sqrt{x-1} \) into a plain power of \( u \).
Integration by inspection
Two patterns come up so often that you should recognise them and write the answer straight down. Each is the substitution \( u = f(x) \) done in your head.
The first holds because \( \frac{d}{dx}\ln|f(x)| = \frac{f'(x)}{f(x)} \) by the chain rule. The modulus is there because the logarithm needs a positive input while \( f(x) \) might be negative; you can drop it when \( f(x) \) is always positive, as with \( x^2 + 9 \). Cambridge 9709 lists the first pattern as \( \int \frac{kf'(x)}{f(x)}\,dx \): a constant multiple of the derivative on top is fine.
Find (a) \( \int \dfrac{6x-4}{3x^2-4x + 5}\,dx \), (b) \( \int \dfrac{x}{x^2 + 9}\,dx \), (c) \( \int \sin x\cos^4 x\,dx \), and evaluate (d) \( \displaystyle\int_0^1 \frac{e^x}{e^x + 3}\,dx \).
Always differentiate your answer mentally. It catches nearly every wrong constant, and IB SL questions on 5.10 are designed to be done this way.
An economics example: consumer surplus under a curved demand curve. Demand for a product is \( P = \dfrac{100}{Q + 1} \), with \( P \) in dollars and \( Q \) in thousands of units, and the market price is $20. Then \( 20 = \frac{100}{Q + 1} \) gives \( Q^* = 4 \). Consumer surplus is the area between the demand curve and the price line (Figure 2), and the integrand has the \( \frac{f’}{f} \) shape:
which is \( \Big[100\ln(Q + 1)-20Q\Big]_0^4 = 100\ln 5-80 \approx 80.94 \). With \( Q \) in thousands, buyers gain about $80,900 in total. A straight line through the same two points would give a different answer; the shape of the curve matters, which is why we integrate.
Integrals using trigonometric identities
No rule integrates \( \sin^2 x \) directly, and the tempting answer \( \tfrac13\sin^3 x \) is wrong: its derivative is \( \sin^2 x\cos x \). The fix is to rewrite the square with the double angle formulae from Step 8, so that what is left is something you can integrate.
| Rewrite | Then integrate |
|---|---|
| \( \sin^2 x = \tfrac12(1-\cos 2x) \) | \( \int \sin^2 x\,dx = \tfrac12x-\tfrac14\sin 2x + C \) |
| \( \cos^2 x = \tfrac12(1 + \cos 2x) \) | \( \int \cos^2 x\,dx = \tfrac12x + \tfrac14\sin 2x + C \) |
| \( \tan^2 x = \sec^2 x-1 \) | \( \int \tan^2 x\,dx = \tan x-x + C \) |
| \( \sin x\cos x = \tfrac12\sin 2x \) | \( \int \sin x\cos x\,dx = -\tfrac14\cos 2x + C \) |
The first two come from \( \cos 2x = 1-2\sin^2 x = 2\cos^2 x-1 \), solved for the square. The third comes from dividing \( \sin^2 x + \cos^2 x = 1 \) by \( \cos^2 x \). With a different angle, replace \( x \) throughout: \( \sin^2 3x = \tfrac12(1-\cos 6x) \).
Find the exact values of (a) \( \int_0^{\pi/2} \cos^2 x\,dx \) and (b) \( \int_0^{\pi/3} \tan^2 x\,dx \), and find (c) \( \int \sin^2 3x\,dx \).
In (c) the \( \tfrac{1}{12} \) is \( \tfrac12 \times \tfrac16 \): one half from the identity and one sixth from integrating \( \cos 6x \).
Notice what part (a) says about the shape of \( \cos^2 x \). Over a quarter turn its area is \( \tfrac{\pi}{4} \), exactly half the area of the rectangle of height 1 on \( [0, \tfrac{\pi}{2}] \). That is no accident: \( \cos^2 x \) is a wave of half the height and twice the frequency, sitting on the line \( y = \tfrac12 \), and the wave part integrates to zero over any whole number of its cycles. The same reasoning gives \( \int_0^{\pi} \sin^2 x\,dx = \tfrac{\pi}{2} \) in one line, and it is why physicists say the average of \( \sin^2 \) over a cycle is one half. When an exam asks for an exact value of a trigonometric integral, a quick sketch like this is a good check that your answer is the right size.
Integrals that give tan⁻¹ and sin⁻¹
Step 14 found \( \frac{d}{dx}\tan^{-1} x = \frac{1}{1 + x^2} \) and \( \frac{d}{dx}\sin^{-1} x = \frac{1}{\sqrt{1-x^2}} \). Read backwards, with a constant \( a > 0 \), these give two families:
Differentiate \( \tan^{-1}(x/a) \) by the chain rule and you get \( \frac{a}{x^2 + a^2} \), which is \( a \) times too big; hence the \( \frac1a \). For \( \sin^{-1}(x/a) \) the \( \frac1a \) from the chain rule cancels against \( \sqrt{a^2} = a \), so no factor appears.
Find (a) the exact value of \( \int_0^2 \dfrac{1}{x^2 + 4}\,dx \), (b) \( \int \dfrac{1}{x^2 + 6x + 13}\,dx \) and (c) the exact value of \( \int_0^{3/2} \dfrac{1}{\sqrt{9-x^2}}\,dx \).
Inverse trigonometric answers are in radians, so exact values involve \( \pi \). Completing the square, as in (b), is AP topic 6.10.
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. Find \( \int 4x(x^2-3)^5\,dx \). Show worked answer
\( \int 2u^5\,du = \tfrac13u^6 + C \).
Answer: \( \tfrac13(x^2-3)^6 + C \).
EasyQ2. Find \( \int \dfrac{3x^2}{x^3 + 1}\,dx \). Show worked answer
So the integral is \( \ln|x^3 + 1| + C \).
MediumQ3. Evaluate \( \int_0^1 x e^{x^2}\,dx \) exactly. Show worked answer
\( \tfrac12\int_0^1 e^u\,du = \tfrac12\Big[e^u\Big]_0^1 \).
\( = \tfrac12(e-1) \).
MediumQ4. Find the exact value of \( \int_0^{\pi/8} \cos^2 2x\,dx \). Show worked answer
\( \int_0^{\pi/8} \tfrac12(1 + \cos 4x)\,dx = \Big[\tfrac12x + \tfrac18\sin 4x\Big]_0^{\pi/8} \).
\( = \tfrac{\pi}{16} + \tfrac18\sin\tfrac{\pi}{2} = \tfrac{\pi}{16} + \tfrac18 \).
MediumQ5. Find \( \int \dfrac{x + 3}{x^2 + 9}\,dx \). Show worked answer
First part: \( \tfrac12\ln(x^2 + 9) \) (top is half the derivative of the bottom).
Second part: \( 3 \times \tfrac13\tan^{-1}\tfrac{x}{3} = \tan^{-1}\tfrac{x}{3} \).
Answer: \( \tfrac12\ln(x^2 + 9) + \tan^{-1}\left(\tfrac{x}{3}\right) + C \). No modulus is needed, since \( x^2 + 9 > 0 \).
ExamQ6. (a) Using the substitution \( u = e^x \), show that \( \displaystyle\int_0^{\frac12\ln 3} \frac{e^x}{1 + e^{2x}}\,dx = \int_1^{\sqrt3} \frac{1}{1 + u^2}\,du \). [3] (b) Hence find the exact value of the integral. [2] Show worked answer
So \( \dfrac{e^x}{1 + e^{2x}}\,dx = \dfrac{1}{1 + u^2}\,du \). [A1]
Limits: \( x = 0 \Rightarrow u = 1 \); \( x = \tfrac12\ln 3 \Rightarrow u = e^{\frac12\ln 3} = \sqrt3 \). [B1]
(b) \( \Big[\tan^{-1} u\Big]_1^{\sqrt3} = \tan^{-1}\sqrt3-\tan^{-1} 1 \). [M1]
\( = \tfrac{\pi}{3}-\tfrac{\pi}{4} = \tfrac{\pi}{12} \). [A1]
Total: 5 marks.
Check yourself
1. With \( u = x^2 + 4 \), what does \( \int_0^2 x(x^2 + 4)^3\,dx \) become?
2. Which is \( \int \dfrac{1}{x^2 + 25}\,dx \)?
3. Which is \( \int \cos^2 x\,dx \)?
Your score: 0 out of 3
The short version
- Substitution reverses the chain rule: \( u = g(x) \), \( du = g'(x)\,dx \). Convert the integrand, the \( dx \) and the limits.
- With a given substitution (Cambridge P3), make \( x \) the subject and replace every \( x \).
- By inspection: \( \int \frac{f’}{f}\,dx = \ln|f| + C \) and \( \int f’ f^n\,dx = \frac{f^{n+1}}{n+1} + C \). Check by differentiating.
- \( \sin^2 x = \tfrac12(1-\cos 2x) \), \( \cos^2 x = \tfrac12(1 + \cos 2x) \), \( \tan^2 x = \sec^2 x-1 \).
- \( \int \frac{dx}{x^2 + a^2} = \frac1a\tan^{-1}\frac{x}{a} + C \) and \( \int \frac{dx}{\sqrt{a^2-x^2}} = \sin^{-1}\frac{x}{a} + C \); complete the square first if needed.
- The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Further reading on EconTutorials
Related in-depth articles from our blog:
