27.5 Integration by Substitution
SL 5.10 AHL 5.16
- the four steps of integration by substitution (change of variable)
- how substitution handles integrals of the form \(\int k\,g'(x)f\big(g(x)\big)\,\mathrm{d}x\) (SL)
- how to use a given substitution for harder integrals, including \(u = \sqrt{\ldots}\) and \(x = a\sin\theta\) (HL)
A substitution changes the variable so that the new integral is easy. On IB papers the substitution is given, unless the integral is of the form \(\int k\,g'(x)f\big(g(x)\big)\,\mathrm{d}x\).
The method
Integration by substitution
- Differentiate the substitution: find \(\dfrac{\mathrm{d}u}{\mathrm{d}x}\), and write \(\mathrm{d}x\) in terms of \(\mathrm{d}u\).
- Replace every part of the integrand, and \(\mathrm{d}x\), using the new variable \(u\). No \(x\) may remain.
- Integrate with respect to \(u\). (If this is not easier, the substitution was not a good choice.)
- Return to the original variable \(x\).
Not in the formula booklet.
Example 1 By using the substitution \(u = x^3 - 2\), find \(\displaystyle\int 3x^2\left(x^3 - 2\right)^5\mathrm{d}x\).
Step 1. \(\dfrac{\mathrm{d}u}{\mathrm{d}x} = 3x^2\), so \(\mathrm{d}x = \dfrac{\mathrm{d}u}{3x^2}\).
Step 2. \(\displaystyle\int 3x^2 u^5\,\frac{\mathrm{d}u}{3x^2} = \int u^5\,\mathrm{d}u\). The \(3x^2\) cancels, so no \(x\) is left.
Step 3. \(\displaystyle\int u^5\,\mathrm{d}u = \frac{u^6}{6} + C\).
Step 4. \(\displaystyle\int 3x^2\left(x^3 - 2\right)^5\mathrm{d}x = \frac{\left(x^3 - 2\right)^6}{6} + C\).
This is the reverse chain rule of Section 27.2, written out in full.
Sometimes the derivative does not cancel. Then write \(x\) itself in terms of \(u\).
Example 2 By using the substitution \(u = x - 3\), find \(\displaystyle\int x(x - 3)^4\,\mathrm{d}x\).
\(\mathrm{d}u = \mathrm{d}x\) and \(x = u + 3\).
\[ \int (u + 3)u^4\,\mathrm{d}u = \int \left(u^5 + 3u^4\right)\mathrm{d}u = \frac{u^6}{6} + \frac{3u^5}{5} + C \]
\[ = \frac{(x - 3)^6}{6} + \frac{3(x - 3)^5}{5} + C. \]
(Expanding \(x(x - 3)^4\) first also works, but takes much longer.)
Harder substitutions
Example 3 By using the substitution \(u = \sqrt{x + 4}\), show that
\[ \int \frac{1}{x\sqrt{x + 4}}\,\mathrm{d}x = \frac{1}{2}\ln\left\lvert\frac{\sqrt{x + 4} - 2}{\sqrt{x + 4} + 2}\right\rvert + C. \]
\(u = \sqrt{x + 4}\), so \(u^2 = x + 4\) and \(x = u^2 - 4\). Then \(\mathrm{d}x = 2u\,\mathrm{d}u\).
\[ \int \frac{1}{\left(u^2 - 4\right)u}\,2u\,\mathrm{d}u = \int \frac{2}{u^2 - 4}\,\mathrm{d}u = \int \frac{2}{(u - 2)(u + 2)}\,\mathrm{d}u. \]
Partial fractions: \(2 = A(u + 2) + B(u - 2)\). \(\;u = 2\): \(A = \dfrac{1}{2}\). \(\;u = -2\): \(B = -\dfrac{1}{2}\).
\[ \int \left(\frac{\frac{1}{2}}{u - 2} - \frac{\frac{1}{2}}{u + 2}\right)\mathrm{d}u = \frac{1}{2}\ln\left\lvert\frac{u - 2}{u + 2}\right\rvert + C = \frac{1}{2}\ln\left\lvert\frac{\sqrt{x + 4} - 2}{\sqrt{x + 4} + 2}\right\rvert + C. \quad\blacksquare \]
When \(\sqrt{a^2 - x^2}\) appears, the substitution \(x = a\sin\theta\) removes the square root, because \(a^2 - a^2\sin^2\theta = a^2\cos^2\theta\).
Example 4 By using the substitution \(x = 3\sin\theta\), where \(-\dfrac{\pi}{2} \leq \theta \leq \dfrac{\pi}{2}\), find \(\displaystyle\int \sqrt{9 - x^2}\,\mathrm{d}x\).
\(\mathrm{d}x = 3\cos\theta\,\mathrm{d}\theta\). Also \(\sqrt{9 - 9\sin^2\theta} = \sqrt{9\cos^2\theta} = 3\cos\theta\) (since \(\cos\theta \geq 0\) for this range of \(\theta\)).
\[ \int 3\cos\theta \cdot 3\cos\theta\,\mathrm{d}\theta = 9\int \cos^2\theta\,\mathrm{d}\theta = \frac{9}{2}\int (1 + \cos 2\theta)\,\mathrm{d}\theta = \frac{9}{2}\theta + \frac{9}{4}\sin 2\theta + C. \]
Return to \(x\). \(\sin\theta = \dfrac{x}{3}\), so \(\theta = \arcsin\dfrac{x}{3}\) and \(\cos\theta = \dfrac{\sqrt{9 - x^2}}{3}\). Then
\[ \sin 2\theta = 2\sin\theta\cos\theta = \frac{2x\sqrt{9 - x^2}}{9}. \]
\[ \int \sqrt{9 - x^2}\,\mathrm{d}x = \frac{9}{2}\arcsin\left(\frac{x}{3}\right) + \frac{x}{2}\sqrt{9 - x^2} + C. \]
A quick check of Example 4: the definite integral from \(0\) to \(3\) must equal \(F(3) - F(0) = \dfrac{9}{2} \cdot \dfrac{\pi}{2} = \dfrac{9\pi}{4} \approx 7.07\).
Calculator → Menu → Calculus → Numerical Integral, then enter \(\displaystyle\int_0^3 \sqrt{9 - x^2}\,\mathrm{d}x\). The GDC gives \(7.0685\ldots\), which matches. (It is also a quarter of a circle of radius 3.) Definite integrals are studied in Unit 28.
Common errors
| ✗ Wrong | ✓ Right | Why |
|---|---|---|
| Replacing \((x^3 - 2)^5\) by \(u^5\) but keeping \(\mathrm{d}x\) | Replace \(\mathrm{d}x\) by \(\dfrac{\mathrm{d}u}{3x^2}\) | \(\mathrm{d}x\) and \(\mathrm{d}u\) are different. |
| Integrating while \(x\) and \(u\) are mixed | Write every \(x\) in terms of \(u\) first | You cannot integrate \(x\) with respect to \(u\). |
| Leaving the answer in \(u\) or \(\theta\) | Return to \(x\) | The question was in \(x\). |
| \(\sqrt{9\cos^2\theta} = \pm 3\cos\theta\) | \(3\cos\theta\) | The given range makes \(\cos\theta \geq 0\). |
Exercises
1 By using the substitution \(u = 2x^2 + 1\), find \(\displaystyle\int 4x\left(2x^2 + 1\right)^3\mathrm{d}x\).
\(\mathrm{d}u = 4x\,\mathrm{d}x\): \(\;\displaystyle\int u^3\,\mathrm{d}u = \frac{u^4}{4} + C = \frac{\left(2x^2 + 1\right)^4}{4} + C\).
2 By using the substitution \(u = \cos x\), find \(\displaystyle\int \sin x\cos^4 x\,\mathrm{d}x\).
\(\mathrm{d}u = -\sin x\,\mathrm{d}x\): \(\;\displaystyle\int -u^4\,\mathrm{d}u = -\frac{u^5}{5} + C = -\frac{\cos^5 x}{5} + C\).
3 By using the substitution \(u = x^2 + 9\), find \(\displaystyle\int \frac{x}{\sqrt{x^2 + 9}}\,\mathrm{d}x\).
\(\mathrm{d}u = 2x\,\mathrm{d}x\): \(\;\displaystyle\int \frac{1}{2}u^{-\frac{1}{2}}\,\mathrm{d}u = u^{\frac{1}{2}} + C = \sqrt{x^2 + 9} + C\).
4 By using the substitution \(u = \ln x\), find \(\displaystyle\int \frac{1}{x\ln x}\,\mathrm{d}x\), \(\;x > 1\).
\(\mathrm{d}u = \dfrac{1}{x}\,\mathrm{d}x\): \(\;\displaystyle\int \frac{1}{u}\,\mathrm{d}u = \ln\lvert u\rvert + C = \ln(\ln x) + C\).
5 By using the substitution \(u = x - 1\), find \(\displaystyle\int x(x - 1)^4\,\mathrm{d}x\).
\(x = u + 1\): \(\;\displaystyle\int \left(u^5 + u^4\right)\mathrm{d}u = \frac{(x - 1)^6}{6} + \frac{(x - 1)^5}{5} + C\).
6 AHL By using the substitution \(u = \sqrt{x}\), find \(\displaystyle\int \frac{1}{\sqrt{x}(1 + x)}\,\mathrm{d}x\), \(\;x > 0\).
\(x = u^2\), \(\mathrm{d}x = 2u\,\mathrm{d}u\): \(\;\displaystyle\int \frac{2u}{u\left(1 + u^2\right)}\,\mathrm{d}u = 2\arctan u + C = 2\arctan\sqrt{x} + C\).
7 AHL By using the substitution \(u = 2x + 1\), find \(\displaystyle\int \frac{x}{\sqrt{2x + 1}}\,\mathrm{d}x\).
\(x = \dfrac{u - 1}{2}\), \(\mathrm{d}x = \dfrac{1}{2}\mathrm{d}u\):
\(\displaystyle\int \frac{u - 1}{2\sqrt{u}} \cdot \frac{1}{2}\,\mathrm{d}u = \frac{1}{4}\int \left(u^{\frac{1}{2}} - u^{-\frac{1}{2}}\right)\mathrm{d}u = \frac{1}{6}u^{\frac{3}{2}} - \frac{1}{2}u^{\frac{1}{2}} + C\).
Taking out \(\dfrac{1}{6}\sqrt{u}\): \(\;\dfrac{1}{6}\sqrt{u}\,(u - 3) = \dfrac{1}{6}\sqrt{2x + 1}\,(2x - 2) = \dfrac{1}{3}(x - 1)\sqrt{2x + 1} + C\).
8 AHL By using the substitution \(u = \mathrm{e}^x\), find \(\displaystyle\int \frac{\mathrm{e}^{2x}}{\mathrm{e}^x + 1}\,\mathrm{d}x\).
\(\mathrm{d}u = \mathrm{e}^x\,\mathrm{d}x\) and \(\mathrm{e}^{2x} = u \cdot \mathrm{e}^x\): \(\;\displaystyle\int \frac{u}{u + 1}\,\mathrm{d}u = \int \left(1 - \frac{1}{u + 1}\right)\mathrm{d}u = u - \ln(u + 1) + C\).
\(= \mathrm{e}^x - \ln\left(\mathrm{e}^x + 1\right) + C\).
9 AHL By using the substitution \(x = 2\tan\theta\), where \(-\dfrac{\pi}{2} < \theta < \dfrac{\pi}{2}\), find \(\displaystyle\int \frac{1}{\left(4 + x^2\right)^{\frac{3}{2}}}\,\mathrm{d}x\).
\(\mathrm{d}x = 2\sec^2\theta\,\mathrm{d}\theta\) and \(4 + 4\tan^2\theta = 4\sec^2\theta\), so \(\left(4 + x^2\right)^{\frac{3}{2}} = 8\sec^3\theta\).
\(\displaystyle\int \frac{2\sec^2\theta}{8\sec^3\theta}\,\mathrm{d}\theta = \frac{1}{4}\int \cos\theta\,\mathrm{d}\theta = \frac{1}{4}\sin\theta + C\).
From \(\tan\theta = \dfrac{x}{2}\), a right-angled triangle gives \(\sin\theta = \dfrac{x}{\sqrt{4 + x^2}}\). Answer: \(\dfrac{x}{4\sqrt{4 + x^2}} + C\).
10 AHL By using the substitution \(u = \sin x\), find \(\displaystyle\int \frac{\cos x}{\sin^2 x + 3\sin x + 2}\,\mathrm{d}x\).
\(\mathrm{d}u = \cos x\,\mathrm{d}x\): \(\;\displaystyle\int \frac{1}{(u + 1)(u + 2)}\,\mathrm{d}u = \int \left(\frac{1}{u + 1} - \frac{1}{u + 2}\right)\mathrm{d}u = \ln\left\lvert\frac{u + 1}{u + 2}\right\rvert + C\).
\(= \ln\left(\dfrac{\sin x + 1}{\sin x + 2}\right) + C\) (the integrand needs \(\sin x \neq -1\), so \(\sin x + 1 > 0\); and \(\sin x + 2 > 0\) always).