Chapter 3: Integration by Substitution
Substitution
Intro
We learn integration by substitution as the reverse of differentiating a composite function, and master a variety of substitution patterns.
3.1 Principle of Integration by Substitution
Recall the differentiation formula for a composite function (the chain rule):
$$\dfrac{d}{dx}F(g(x)) = F'(g(x)) \cdot g'(x)$$Rewriting this in integral form:
$$\displaystyle\int F'(g(x)) \cdot g'(x) \, dx = F(g(x)) + C$$Setting $F'(u) = f(u)$:
$$\displaystyle\int f(g(x)) \cdot g'(x) \, dx = F(g(x)) + C$$3.2 Substitution in Indefinite Integrals
Theorem: Integration by Substitution
Setting $u = g(x)$, so that $du = g'(x) \, dx$:
$$\displaystyle\int f(g(x)) \cdot g'(x) \, dx = \displaystyle\int f(u) \, du$$Procedure for Substitution
- Choose an appropriate substitution $u = g(x)$
- Compute $du = g'(x) \, dx$
- Rewrite the original integral as an integral in $u$
- Integrate with respect to $u$
- Substitute $u = g(x)$ back to return to a function of $x$
Example 3.1
Evaluate $\displaystyle\int (2x + 1)^5 \, dx$.
Step 1: Let $u = 2x + 1$
Step 2: Since $\dfrac{du}{dx} = 2$, we have $du = 2 \, dx$, i.e., $dx = \dfrac{1}{2} du$
Step 3: Substituting,
$$\displaystyle\int (2x + 1)^5 \, dx = \displaystyle\int u^5 \cdot \dfrac{1}{2} du = \dfrac{1}{2} \displaystyle\int u^5 \, du$$Step 4: Carry out the integration
$$= \dfrac{1}{2} \cdot \dfrac{u^6}{6} + C = \dfrac{u^6}{12} + C$$Step 5: Substitute $u = 2x + 1$
$$= \dfrac{(2x + 1)^6}{12} + C$$Example 3.2
Evaluate $\displaystyle\int x \sqrt{x^2 + 1} \, dx$.
Letting $u = x^2 + 1$, since $du = 2x \, dx$ we have $x \, dx = \dfrac{1}{2} du$
$$\begin{align} \displaystyle\int x \sqrt{x^2 + 1} \, dx &= \displaystyle\int \sqrt{u} \cdot \dfrac{1}{2} du \\ &= \dfrac{1}{2} \displaystyle\int u^{1/2} \, du \\ &= \dfrac{1}{2} \cdot \dfrac{u^{3/2}}{3/2} + C \\ &= \dfrac{1}{3} u^{3/2} + C \\ &= \dfrac{1}{3} (x^2 + 1)^{3/2} + C \end{align}$$Example 3.3
Evaluate $\displaystyle\int \dfrac{x}{x^2 + 1} \, dx$.
Letting $u = x^2 + 1$, since $du = 2x \, dx$ we have $x \, dx = \dfrac{1}{2} du$
$$\displaystyle\int \dfrac{x}{x^2 + 1} \, dx = \displaystyle\int \dfrac{1}{u} \cdot \dfrac{1}{2} du = \dfrac{1}{2} \ln|u| + C = \dfrac{1}{2} \ln(x^2 + 1) + C$$(Since $x^2 + 1 > 0$, the absolute value is unnecessary.)
How to spot a substitution: look for an inner function together with its derivative inside the integrand.
- Is it in the form $f(g(x)) \cdot g'(x)$?
- Pick the inner function $g(x)$ and check whether its derivative $g'(x)$ (up to a constant factor) appears in the expression
- A constant-factor discrepancy in $g'(x)$ is fine (constants can be pulled out of the integral)
- Can a radical such as $\sqrt{a^2 \pm x^2}$ be removed by a trigonometric substitution?
Don't forget to substitute back: for an indefinite integral, remember to substitute $u = g(x)$ back at the end to return to the original variable $x$. For a definite integral (next section), you change the limits of integration instead, so there is no need to return to the original variable.
3.3 Substitution in Definite Integrals
Theorem: Substitution in a Definite Integral
Setting $u = g(x)$:
$$\displaystyle\int_a^b f(g(x)) \cdot g'(x) \, dx = \displaystyle\int_{g(a)}^{g(b)} f(u) \, du$$Note: When you substitute in a definite integral, you must also change the limits of integration.
- When $x = a$, $u = g(a)$
- When $x = b$, $u = g(b)$
Example 3.4
Evaluate $\displaystyle\int_0^1 x(1 - x^2)^3 \, dx$.
Letting $u = 1 - x^2$, since $du = -2x \, dx$ we have $x \, dx = -\dfrac{1}{2} du$
Changing the limits of integration: $x = 0 \Rightarrow u = 1$, $x = 1 \Rightarrow u = 0$
$$\begin{align} \displaystyle\int_0^1 x(1 - x^2)^3 \, dx &= \displaystyle\int_1^0 u^3 \cdot \left(-\dfrac{1}{2}\right) du \\ &= \dfrac{1}{2} \displaystyle\int_0^1 u^3 \, du \\ &= \dfrac{1}{2} \left[\dfrac{u^4}{4}\right]_0^1 \\ &= \dfrac{1}{2} \cdot \dfrac{1}{4} = \dfrac{1}{8} \end{align}$$In the second line we used $\displaystyle\int_1^0 = -\displaystyle\int_0^1$.
Example 3.5
Evaluate $\displaystyle\int_0^2 \dfrac{x}{\sqrt{x + 2}} \, dx$.
Letting $u = x + 2$, we have $x = u - 2$ and $dx = du$
Changing the limits of integration: $x = 0 \Rightarrow u = 2$, $x = 2 \Rightarrow u = 4$
$$\begin{align} \displaystyle\int_0^2 \dfrac{x}{\sqrt{x + 2}} \, dx &= \displaystyle\int_2^4 \dfrac{u - 2}{\sqrt{u}} \, du \\ &= \displaystyle\int_2^4 \left(u^{1/2} - 2u^{-1/2}\right) du \\ &= \left[\dfrac{2}{3}u^{3/2} - 4u^{1/2}\right]_2^4 \\ &= \left(\dfrac{2}{3} \cdot 8 - 4 \cdot 2\right) - \left(\dfrac{2}{3} \cdot 2\sqrt{2} - 4\sqrt{2}\right) \\ &= \dfrac{16}{3} - 8 - \dfrac{4\sqrt{2}}{3} + 4\sqrt{2} \\ &= \dfrac{16 - 24}{3} + \dfrac{-4\sqrt{2} + 12\sqrt{2}}{3} \\ &= -\dfrac{8}{3} + \dfrac{8\sqrt{2}}{3} = \dfrac{8(\sqrt{2} - 1)}{3} \end{align}$$3.4 Typical Substitution Patterns
Frequently Used Substitutions
| Form of the integrand | Substitution | $du$ |
|---|---|---|
| $f(ax + b)$ | $u = ax + b$ | $du = a \, dx$ |
| $f(x^n) \cdot x^{n-1}$ | $u = x^n$ | $du = nx^{n-1} \, dx$ |
| $f(e^x) \cdot e^x$ | $u = e^x$ | $du = e^x \, dx$ |
| $f(\ln x) \cdot \dfrac{1}{x}$ | $u = \ln x$ | $du = \dfrac{1}{x} dx$ |
| $f(\sin x) \cdot \cos x$ | $u = \sin x$ | $du = \cos x \, dx$ |
| $f(\cos x) \cdot \sin x$ | $u = \cos x$ | $du = -\sin x \, dx$ |
| $f(\tan x) \cdot \dfrac{1}{\cos^2 x}$ | $u = \tan x$ | $du = \dfrac{1}{\cos^2 x} dx$ |
Example 3.6: Substituting a Linear Expression
Evaluate $\displaystyle\int \cos(3x + 1) \, dx$.
Letting $u = 3x + 1$, we have $dx = \dfrac{1}{3} du$
$$\displaystyle\int \cos(3x + 1) \, dx = \dfrac{1}{3} \displaystyle\int \cos u \, du = \dfrac{1}{3} \sin u + C = \dfrac{1}{3} \sin(3x + 1) + C$$Formula: Linear Substitution
$\displaystyle\int f(ax + b) \, dx = \dfrac{1}{a} F(ax + b) + C$
(where $F$ is an antiderivative of $f$)
Example 3.7: Substituting a Trigonometric Function
Evaluate $\displaystyle\int \sin^3 x \cos x \, dx$.
Letting $u = \sin x$, we have $du = \cos x \, dx$
$$\displaystyle\int \sin^3 x \cos x \, dx = \displaystyle\int u^3 \, du = \dfrac{u^4}{4} + C = \dfrac{\sin^4 x}{4} + C$$Example 3.8: Substituting a Logarithm
Evaluate $\displaystyle\int \dfrac{(\ln x)^2}{x} \, dx$.
Letting $u = \ln x$, we have $du = \dfrac{1}{x} dx$
$$\displaystyle\int \dfrac{(\ln x)^2}{x} \, dx = \displaystyle\int u^2 \, du = \dfrac{u^3}{3} + C = \dfrac{(\ln x)^3}{3} + C$$3.5 Trigonometric Substitution
For integrals involving $\sqrt{a^2 - x^2}$, $\sqrt{a^2 + x^2}$, or $\sqrt{x^2 - a^2}$, substitution with trigonometric functions is effective.
Trigonometric Substitutions
| Form of the radical | Substitution | After transformation |
|---|---|---|
| $\sqrt{a^2 - x^2}$ | $x = a\sin\theta$ | $a\cos\theta$ |
| $\sqrt{a^2 + x^2}$ | $x = a\tan\theta$ | $\dfrac{a}{\cos\theta}$ |
| $\sqrt{x^2 - a^2}$ | $x = \dfrac{a}{\cos\theta}$ | $a\tan\theta$ |
These substitutions let you use the trigonometric identities $\sin^2\theta + \cos^2\theta = 1$ and $1 + \tan^2\theta = \dfrac{1}{\cos^2\theta}$ to remove the square root. For example, substituting $x = a\sin\theta$ into $\sqrt{a^2 - x^2}$ gives $\sqrt{a^2 - a^2\sin^2\theta} = a\sqrt{1 - \sin^2\theta} = a\cos\theta$, so the radical disappears.
Example 3.9
Evaluate $\displaystyle\int \sqrt{1 - x^2} \, dx$.
Letting $x = \sin\theta$ (with $-\dfrac{\pi}{2} \leq \theta \leq \dfrac{\pi}{2}$):
- $dx = \cos\theta \, d\theta$
- $\sqrt{1 - x^2} = \sqrt{1 - \sin^2\theta} = \cos\theta$ (since $\cos\theta \geq 0$)
Since $\theta = \arcsin x$, $\sin\theta = x$, and $\cos\theta = \sqrt{1-x^2}$:
$$= \dfrac{\arcsin x}{2} + \dfrac{x\sqrt{1-x^2}}{2} + C = \dfrac{1}{2}\left(x\sqrt{1-x^2} + \arcsin x\right) + C$$3.6 Exercises
Problem 1
Evaluate the following indefinite integrals by substitution.
- $\displaystyle\int (3x - 2)^4 \, dx$
- $\displaystyle\int x\sqrt{x^2 - 1} \, dx$
- $\displaystyle\int e^{2x} \, dx$
- $\displaystyle\int \dfrac{\cos x}{\sin^2 x} \, dx$
Show Solution
-
Letting $u = 3x - 2$, we have $dx = \dfrac{1}{3} du$
$$\displaystyle\int (3x - 2)^4 \, dx = \dfrac{1}{3} \displaystyle\int u^4 \, du = \dfrac{1}{3} \cdot \dfrac{u^5}{5} + C = \dfrac{(3x-2)^5}{15} + C$$ -
Letting $u = x^2 - 1$, we have $x \, dx = \dfrac{1}{2} du$
$$\displaystyle\int x\sqrt{x^2 - 1} \, dx = \dfrac{1}{2} \displaystyle\int \sqrt{u} \, du = \dfrac{1}{2} \cdot \dfrac{2u^{3/2}}{3} + C = \dfrac{(x^2-1)^{3/2}}{3} + C$$ -
Letting $u = 2x$, we have $dx = \dfrac{1}{2} du$
$$\displaystyle\int e^{2x} \, dx = \dfrac{1}{2} \displaystyle\int e^u \, du = \dfrac{e^u}{2} + C = \dfrac{e^{2x}}{2} + C$$ -
Letting $u = \sin x$, we have $du = \cos x \, dx$
$$\displaystyle\int \dfrac{\cos x}{\sin^2 x} \, dx = \displaystyle\int \dfrac{1}{u^2} \, du = -\dfrac{1}{u} + C = -\dfrac{1}{\sin x} + C$$
Problem 2
Evaluate the following definite integrals.
- $\displaystyle\int_0^1 x(1 + x^2)^4 \, dx$
- $\displaystyle\int_0^{\pi/4} \tan x \, dx$
Show Solution
-
Letting $u = 1 + x^2$, we have $x \, dx = \dfrac{1}{2} du$
Limits: $x = 0 \Rightarrow u = 1$, $x = 1 \Rightarrow u = 2$
$$\displaystyle\int_0^1 x(1 + x^2)^4 \, dx = \dfrac{1}{2}\displaystyle\int_1^2 u^4 \, du = \dfrac{1}{2}\left[\dfrac{u^5}{5}\right]_1^2 = \dfrac{1}{10}(32 - 1) = \dfrac{31}{10}$$ -
Writing $\tan x = \dfrac{\sin x}{\cos x}$ and letting $u = \cos x$, we have $du = -\sin x \, dx$
Limits: $x = 0 \Rightarrow u = 1$, $x = \dfrac{\pi}{4} \Rightarrow u = \dfrac{1}{\sqrt{2}}$
$$\displaystyle\int_0^{\pi/4} \tan x \, dx = -\displaystyle\int_1^{1/\sqrt{2}} \dfrac{1}{u} \, du = -\left[\ln|u|\right]_1^{1/\sqrt{2}} = -\ln\dfrac{1}{\sqrt{2}} = \dfrac{1}{2}\ln 2$$
Frequently Asked Questions
What is integration by substitution?
It is the reverse operation of differentiating a composite function — a method that changes the variable to simplify an integral. You find a pair consisting of a function and its derivative inside the integrand and replace it with a new variable $u$, transforming the integral into a form that is easier to compute.
What must you watch out for with substitution in a definite integral?
When you change the variable, you must also change the limits of integration to match the new variable. Setting $u = g(a)$ when $x = a$ and $u = g(b)$ when $x = b$, you rewrite the limits of integration as $[g(a), g(b)]$.
When do you use trigonometric substitution?
When a form such as $\sqrt{a^2-x^2}$, $\sqrt{a^2+x^2}$, or $\sqrt{x^2-a^2}$ appears, substituting with trigonometric functions removes the square root. You substitute $x = a\sin\theta$, $x = a\tan\theta$, and $x = a/\cos\theta$ respectively.
When should I use substitution?
Use it whenever the integrand contains a composite function $f(g(x))$ together with (a constant multiple of) the derivative $g'(x)$ of its inner function. For example, it works well for a form like $(2x+1)^5$, where the inner function $g(x) = 2x+1$ and its derivative $g'(x) = 2$ both appear.