Home›Courses›Calculus I›§5.2 Integration by Substitution
Pre-CalculusCalculus ILinear Algebra I
Calculus I  ·  Chapter 5  ·  Section 5.2

Integration by
Substitution

The chain rule in reverse — a powerful technique that transforms complicated integrals into simple ones by a clever change of variable.

Learning Objectives

What You Will Master
in This Section

1

Use the method of substitution to find indefinite integrals of composite functions.

2

Solve initial value problems using substitution to find particular solutions.

3

Explore a price-adjustment model in economics using substitution techniques.

The Big Picture: Why Substitution?

In §5.1, you learned the basic integration rules. But what about integrals like:

$$\int 2x(x^2+1)^5\,dx \qquad \int \frac{e^{\sqrt{x}}}{\sqrt{x}}\,dx \qquad \int x^2\sqrt{x^3+7}\,dx$$

None of the rules from §5.1 directly apply. These integrals involve composite functions — a function inside another function. Substitution is the systematic method for handling exactly these cases.

The Core Idea — Chain Rule in Reverse

Recall the Chain Rule for derivatives: if $F(u)$ is an antiderivative of $f(u)$, then

$$\frac{d}{dx}[F(g(x))] = f(g(x)) \cdot g'(x)$$

Running this backwards: if we see $f(g(x)) \cdot g'(x)$ inside an integral, we can undo the chain rule:

$$\int f(g(x))\cdot g'(x)\,dx = F(g(x)) + C$$

Key Observation: The integrand must contain a function $g(x)$ AND its derivative $g'(x)$ (possibly up to a constant multiple). When you spot this pattern, substitution will work.
§ 1 — The Systematic Method

The Four Steps of
Integration by Substitution

Substitution Rule

If $u = g(x)$ is a differentiable function, then:

$$\int f(g(x))\cdot g'(x)\,dx = \int f(u)\,du = F(u) + C = F(g(x)) + C$$

1
Choose $u = g(x)$ — the inner functionLook for a composite function. The best $u$ is usually the expression inside brackets, under a root, or in an exponent. Ask: "What part, if differentiated, gives something present in the integrand?"
2
Differentiate to find $du$Compute $\dfrac{du}{dx} = g'(x)$, then write $du = g'(x)\,dx$. Solve for $dx$ if needed: $dx = \dfrac{du}{g'(x)}$.
3
Substitute completely — no $x$ should remainReplace $g(x)$ with $u$ and $g'(x)\,dx$ with $du$. The entire integral must be in terms of $u$ only. If $x$ terms remain, the substitution may need adjustment or is the wrong choice.
4
Integrate in $u$, then back-substituteEvaluate $\int f(u)\,du$ using basic rules. Then replace every $u$ with $g(x)$ to express the answer in terms of the original variable $x$.
Always verify: Differentiate your answer. You should recover the original integrand. This is the only way to be certain your substitution was correct.
§ 2 — A Complex Worked Example

Step-by-Step Through a
Challenging Integral

Let us work through the following integral completely, showing every thought and every step:

$$\int \frac{3x^2}{\sqrt{x^3 + 5}}\,dx$$

Step 1 — Identify the Structure

The integrand is $\dfrac{3x^2}{\sqrt{x^3+5}} = 3x^2 \cdot (x^3+5)^{-1/2}$.

We have a composite function: $(x^3+5)^{-1/2}$ — the inner function is $x^3 + 5$.

Notice that $3x^2$ is exactly the derivative of $x^3 + 5$. This is the signal that substitution will work perfectly.

Step 2 — Choose $u$ and Find $du$

Let $u = x^3 + 5$

Then $\dfrac{du}{dx} = 3x^2$

Therefore $du = 3x^2\,dx$

Step 3 — Substitute

Replace $x^3 + 5$ with $u$ and $3x^2\,dx$ with $du$:

$$\int \frac{3x^2}{\sqrt{x^3+5}}\,dx = \int \frac{1}{\sqrt{u}}\,du = \int u^{-1/2}\,du$$

The integral is now entirely in $u$ — clean and simple.

Step 4 — Integrate in $u$

Apply the power rule (raise exponent by 1, divide):

$$\int u^{-1/2}\,du = \frac{u^{1/2}}{1/2} + C = 2\sqrt{u} + C$$

Step 5 — Back-Substitute

Replace $u$ with $x^3 + 5$:

$$2\sqrt{u} + C = 2\sqrt{x^3+5} + C$$

✓ Verification: $\dfrac{d}{dx}\left[2\sqrt{x^3+5}\right] = 2 \cdot \dfrac{1}{2\sqrt{x^3+5}} \cdot 3x^2 = \dfrac{3x^2}{\sqrt{x^3+5}}$ ✓
Final Answer: $\displaystyle\int \frac{3x^2}{\sqrt{x^3+5}}\,dx = 2\sqrt{x^3+5} + C$
§ 3 — Types of Substitution

Six Categories of
Substitution Problems

3a — Linear Substitution

When the inner function is linear: $u = ax + b$. These are the simplest substitutions.

Example — Linear

Find $\displaystyle\int (3x-2)^7\,dx$

Let $u = 3x-2$, so $du = 3\,dx$, thus $dx = \dfrac{du}{3}$.

$$\int u^7 \cdot \frac{du}{3} = \frac{1}{3}\int u^7\,du = \frac{1}{3}\cdot\frac{u^8}{8} + C = \frac{(3x-2)^8}{24} + C$$

Find $\displaystyle\int e^{5x+1}\,dx$

Let $u = 5x+1$, $du = 5\,dx$, so $dx = \dfrac{du}{5}$:

$$\int e^u \cdot \frac{du}{5} = \frac{1}{5}e^u + C = \frac{1}{5}e^{5x+1} + C$$

3b — Quadratic Substitution

When the inner function is quadratic. Look for $x$ (or a multiple of it) multiplying the whole expression — that extra $x$ is often $\frac{du}{2}$.

Example — Quadratic

Find $\displaystyle\int x(x^2+1)^4\,dx$

Let $u = x^2+1$, so $du = 2x\,dx$, thus $x\,dx = \dfrac{du}{2}$.

$$\int u^4 \cdot \frac{du}{2} = \frac{1}{2}\cdot\frac{u^5}{5} + C = \frac{(x^2+1)^5}{10} + C$$

Find $\displaystyle\int \frac{x}{x^2+3}\,dx$

Let $u = x^2+3$, $du = 2x\,dx$, so $x\,dx = \dfrac{du}{2}$:

$$\int \frac{1}{u}\cdot\frac{du}{2} = \frac{1}{2}\ln|u| + C = \frac{1}{2}\ln(x^2+3) + C$$

3c — Exponential Substitution

When the exponent is a function of $x$, set $u$ equal to that exponent.

Example — Exponential

Find $\displaystyle\int x^2 e^{x^3}\,dx$

Let $u = x^3$, so $du = 3x^2\,dx$, thus $x^2\,dx = \dfrac{du}{3}$.

$$\int e^u \cdot \frac{du}{3} = \frac{1}{3}e^u + C = \frac{1}{3}e^{x^3} + C$$

Find $\displaystyle\int \frac{e^{\sqrt{x}}}{\sqrt{x}}\,dx$

Let $u = \sqrt{x} = x^{1/2}$, so $du = \dfrac{1}{2\sqrt{x}}dx$, thus $\dfrac{dx}{\sqrt{x}} = 2\,du$:

$$\int e^u \cdot 2\,du = 2e^u + C = 2e^{\sqrt{x}} + C$$

3d — Rational Substitution

When you have a rational function where the numerator is (a multiple of) the derivative of the denominator — this gives a logarithm.

Example — Rational

Find $\displaystyle\int \frac{4x^3}{x^4-7}\,dx$

Let $u = x^4 - 7$, so $du = 4x^3\,dx$.

$$\int \frac{du}{u} = \ln|u| + C = \ln|x^4 - 7| + C$$

Find $\displaystyle\int \frac{2x+3}{x^2+3x-1}\,dx$

Let $u = x^2+3x-1$, $du = (2x+3)\,dx$:

$$\int \frac{du}{u} = \ln|u| + C = \ln|x^2+3x-1| + C$$

3e — Radical Substitution

When the integrand contains a radical (square root, cube root, etc.), set $u$ equal to the expression under the radical.

Example — Radical

Find $\displaystyle\int x^2\sqrt{x^3+7}\,dx$

Let $u = x^3 + 7$, so $du = 3x^2\,dx$, thus $x^2\,dx = \dfrac{du}{3}$.

$$\int \sqrt{u}\cdot\frac{du}{3} = \frac{1}{3}\cdot\frac{2}{3}u^{3/2} + C = \frac{2}{9}(x^3+7)^{3/2} + C$$

Find $\displaystyle\int \frac{1}{\sqrt{2x+3}}\,dx$

Let $u = 2x+3$, $du = 2\,dx$, so $dx = \dfrac{du}{2}$:

$$\int u^{-1/2}\cdot\frac{du}{2} = \frac{1}{2}\cdot 2u^{1/2} + C = \sqrt{2x+3} + C$$

3f — Logarithmic Substitution

When $\ln(x)$ appears in the integrand, try $u = \ln(x)$. Then $du = \dfrac{1}{x}dx$.

Example — Logarithmic

Find $\displaystyle\int \frac{(\ln x)^3}{x}\,dx$

Let $u = \ln x$, so $du = \dfrac{1}{x}\,dx$.

$$\int u^3\,du = \frac{u^4}{4} + C = \frac{(\ln x)^4}{4} + C$$

Find $\displaystyle\int \frac{\ln(x^2)}{x}\,dx$

Note $\ln(x^2) = 2\ln x$. Let $u = \ln x$, $du = \dfrac{dx}{x}$:

$$\int 2u\,du = u^2 + C = (\ln x)^2 + C$$

Quick Reference: Substitution Patterns

Integrand PatternBest Choice for $u$Result Form
$(ax+b)^n$$u = ax+b$Power of $u$
$x\cdot f(x^2)$$u = x^2$Simpler $f(u)$
$f'(x)\cdot e^{f(x)}$$u = f(x)$$e^u$
$\dfrac{f'(x)}{f(x)}$$u = f(x)$$\ln|u|$
$f'(x)\cdot\sqrt{f(x)}$$u = f(x)$$\dfrac{2}{3}u^{3/2}$
$\dfrac{(\ln x)^n}{x}$$u = \ln x$$\dfrac{u^{n+1}}{n+1}$
§ 4 — Algebra Before Integration

Simplify First,
Then Integrate

Sometimes the integrand looks complicated but simplifies with algebra — long division, expanding, or factoring — before substitution can be applied.

Example 1 — Polynomial Division

Find $\displaystyle\int \frac{x^2}{x-1}\,dx$

The degree of the numerator equals the degree of the denominator, so we divide first:

$$\frac{x^2}{x-1} = x + 1 + \frac{1}{x-1}$$

Now integrate term by term (with $u = x-1$ for the last term):

$$\int\!\left(x + 1 + \frac{1}{x-1}\right)dx = \frac{x^2}{2} + x + \ln|x-1| + C$$

Long Division: Divide $x^2$ by $(x-1)$:

$x^2 \div (x-1)$: first term $x \cdot (x-1) = x^2 - x$. Remainder: $x$.

$x \div (x-1)$: second term $1 \cdot (x-1) = x-1$. Remainder: $1$.

So $\dfrac{x^2}{x-1} = x + 1 + \dfrac{1}{x-1}$ ✓

Example 2 — Expand Before Integrating

Find $\displaystyle\int (1+e^x)^2\,dx$

Expand: $(1+e^x)^2 = 1 + 2e^x + e^{2x}$

$$\int\!(1 + 2e^x + e^{2x})\,dx = x + 2e^x + \frac{e^{2x}}{2} + C$$

Example 3 — Separate a Fraction

Find $\displaystyle\int \frac{x^3 + 2x - 5}{x^2}\,dx$

Split into separate fractions:

$$\frac{x^3+2x-5}{x^2} = x + \frac{2}{x} - \frac{5}{x^2} = x + \frac{2}{x} - 5x^{-2}$$

$$\int\!\left(x + \frac{2}{x} - 5x^{-2}\right)dx = \frac{x^2}{2} + 2\ln|x| + \frac{5}{x} + C$$

Example 4 — Completing the Square (Preview)

Find $\displaystyle\int \frac{1}{x^2+4x+5}\,dx$

Complete the square: $x^2+4x+5 = (x+2)^2 + 1$. Let $u = x+2$, $du = dx$:

$$\int \frac{du}{u^2+1} = \arctan(u) + C = \arctan(x+2) + C$$

§ 5 — Applied Problems

Word Problems

Problem 1 — LUMS Cafeteria Revenue LUMS, Lahore

The LUMS cafeteria finds that its marginal revenue (in PKR thousands) from selling $q$ meal plans per week follows the model:

$$R'(q) = \frac{4q}{(q^2+9)^2}$$

If $R(0) = 0$, find the total revenue function $R(q)$.

Let $u = q^2+9$, so $du = 2q\,dq$, thus $q\,dq = \dfrac{du}{2}$.

$$R(q) = \int \frac{4q}{(q^2+9)^2}\,dq = \int \frac{4}{u^2}\cdot\frac{du}{2} = 2\int u^{-2}\,du = 2\cdot\frac{u^{-1}}{-1} + C = \frac{-2}{u} + C$$

Back-substitute: $R(q) = \dfrac{-2}{q^2+9} + C$

Apply $R(0) = 0$: $0 = \dfrac{-2}{9} + C \Rightarrow C = \dfrac{2}{9}$

$$\boxed{R(q) = \frac{2}{9} - \frac{2}{q^2+9} = \frac{2q^2}{9(q^2+9)}}$$

Problem 2 — Lahore Population Growth Lahore

Lahore's population (in millions) is growing at the rate:

$$\frac{dP}{dt} = 0.3\sqrt{1 + 0.5t}$$

where $t$ is years since 2020. If $P(0) = 14$ million, find $P(t)$.

Let $u = 1+0.5t$, so $du = 0.5\,dt$, thus $dt = 2\,du$.

$$P = \int 0.3\sqrt{u}\cdot 2\,du = 0.6\int u^{1/2}\,du = 0.6\cdot\frac{2}{3}u^{3/2} + C = 0.4(1+0.5t)^{3/2} + C$$

Apply $P(0) = 14$: $14 = 0.4(1)^{3/2} + C \Rightarrow C = 13.6$

$$\boxed{P(t) = 0.4(1+0.5t)^{3/2} + 13.6 \text{ million}}$$

In 2030 ($t=10$): $P(10) = 0.4(6)^{3/2} + 13.6 \approx 0.4(14.70) + 13.6 \approx 19.5$ million.

Problem 3 — Price-Adjustment Model in Pakistan's Textile Market Faisalabad

The price-adjustment model in Faisalabad's textile sector states that the rate of price change follows:

$$\frac{dP}{dt} = k(D - S) = \frac{5}{(P+2)^2}$$

where $P$ is price (in PKR hundreds) and $t$ is time (months). Find $P(t)$ given $P(0) = 3$.

Separate variables: $(P+2)^2\,dP = 5\,dt$

Integrate both sides. Left side: let $u = P+2$, $du = dP$:

$$\int u^2\,du = \int 5\,dt \implies \frac{(P+2)^3}{3} = 5t + C$$

Apply $P(0)=3$: $\dfrac{(5)^3}{3} = C \Rightarrow C = \dfrac{125}{3}$

$$\frac{(P+2)^3}{3} = 5t + \frac{125}{3} \implies (P+2)^3 = 15t + 125$$

$$\boxed{P(t) = (15t + 125)^{1/3} - 2}$$

Problem 4 — LUMS Library Book Circulation LUMS, Lahore

The LUMS library finds that book circulation (books borrowed per day) changes at the rate:

$$C'(t) = \frac{200t}{(t^2+1)^{3/2}}$$

At the start of semester ($t=0$), $C = 50$ books/day. Find $C(t)$.

Let $u = t^2+1$, $du = 2t\,dt$, so $t\,dt = \dfrac{du}{2}$.

$$C = \int \frac{200t}{(t^2+1)^{3/2}}\,dt = \int \frac{200}{u^{3/2}}\cdot\frac{du}{2} = 100\int u^{-3/2}\,du = 100\cdot\frac{u^{-1/2}}{-1/2} + K$$

$$C = \frac{-200}{\sqrt{t^2+1}} + K$$

Apply $C(0) = 50$: $50 = \dfrac{-200}{1} + K \Rightarrow K = 250$

$$\boxed{C(t) = 250 - \frac{200}{\sqrt{t^2+1}}}$$

As $t \to \infty$, $C \to 250$ books/day — a natural upper limit.

Problem 5 — Karachi Port Import Growth Karachi

The volume of imports through Karachi Port (in billions PKR) grows at:

$$V'(t) = \frac{3(\ln t)^2}{t}$$

for $t \geq 1$ years after 2015, with $V(1) = 0$. Find $V(t)$.

Let $u = \ln t$, $du = \dfrac{dt}{t}$.

$$V = \int \frac{3(\ln t)^2}{t}\,dt = 3\int u^2\,du = u^3 + C = (\ln t)^3 + C$$

Apply $V(1) = 0$: $0 = (\ln 1)^3 + C = 0 + C \Rightarrow C = 0$

$$\boxed{V(t) = (\ln t)^3}$$

In 2025 ($t=10$): $V(10) = (\ln 10)^3 \approx (2.303)^3 \approx 12.2$ billion PKR.

§ 6 — Interactive Practice

U-Choice Quiz:
Pick the Right Substitution

For each function below, select the best choice for $u$ to perform the substitution. Choose carefully — you only get one attempt per question!

⚡ Substitution U-Choice Quiz
Select a function from the dropdown above
Score: 0 / 0 Streak: 0 🔥
§ 7 — Important Limitation

An Integral Where
Substitution Fails

Substitution is powerful, but it is not universal. Consider:

$$\int e^{x^2}\,dx$$
⚠ Why Substitution Fails Here

Attempt: Let $u = x^2$, so $du = 2x\,dx$, thus $dx = \dfrac{du}{2x}$.

Substituting: $\displaystyle\int e^u \cdot \frac{du}{2x}$

Problem: we cannot eliminate $x$ — substituting $x = \sqrt{u}$ gives $\displaystyle\int \frac{e^u}{2\sqrt{u}}\,du$, which is no simpler.

Conclusion: $\displaystyle\int e^{x^2}\,dx$ has no closed-form antiderivative expressible in terms of elementary functions. This is a famous result — the integral is related to the error function $\text{erf}(x)$ used in statistics and physics. Substitution cannot conjure what does not exist.

Other Integrals With No Elementary Antiderivative

IntegralWhy It FailsRelated to
$\int e^{x^2}\,dx$No cancellation possible after sub.Error function erf$(x)$
$\int \dfrac{\sin x}{x}\,dx$$\sin(u)/\sqrt{u}$ still intractableSine integral Si$(x)$
$\int \dfrac{1}{\ln x}\,dx$No obvious inner functionLogarithmic integral Li$(x)$
$\int \sqrt{1-k^2\sin^2 x}\,dx$Elliptic integralArc length of ellipses
Lesson: Always try to verify that substitution is working by checking whether you can eliminate all $x$ terms. If you cannot, try a different $u$, or consider other techniques (parts, partial fractions) or accept that the integral is non-elementary.

Example Where a Different Technique Is Needed

Find $\displaystyle\int xe^x\,dx$

Try substitution: Let $u = x$, $du = dx$ — useless (no simplification). Let $u = e^x$, $du = e^x dx$, so $x = \ln u$ — gives $\displaystyle\int \ln(u)\,du$ — actually harder.

Correct technique: Integration by Parts (§6.1), which gives $xe^x - e^x + C$. Substitution is the wrong tool here.

§ 8 — Differential Equations

Differential Equations
Involving Substitution

Many separable differential equations, once separated, yield integrals that require substitution to solve.

General Strategy

Given $\dfrac{dy}{dx} = f(x)\cdot g(y)$:

1. Separate: $\dfrac{dy}{g(y)} = f(x)\,dx$

2. Integrate both sides — the left side often requires substitution in $y$, the right in $x$.

3. Solve for $y$, apply initial condition.

Example 1 — Substitution on the Right Side

Solve $\dfrac{dy}{dx} = x(x^2+1)^3$, $y(0) = 2$.

Integrate: $y = \displaystyle\int x(x^2+1)^3\,dx$

Let $u = x^2+1$, $du = 2x\,dx$, so $x\,dx = \dfrac{du}{2}$:

$$y = \int u^3 \cdot \frac{du}{2} = \frac{u^4}{8} + C = \frac{(x^2+1)^4}{8} + C$$

Apply $y(0) = 2$: $2 = \dfrac{1}{8} + C \Rightarrow C = \dfrac{15}{8}$

$$\boxed{y = \frac{(x^2+1)^4}{8} + \frac{15}{8}}$$

Example 2 — Substitution on Both Sides

Solve $\dfrac{dy}{dx} = \dfrac{x}{(y+1)^2}$, $y(0) = 0$.

Separate: $(y+1)^2\,dy = x\,dx$

Left side: let $v = y+1$, $dv = dy$: $\displaystyle\int v^2\,dv = \dfrac{v^3}{3} = \dfrac{(y+1)^3}{3}$

Right side: $\displaystyle\int x\,dx = \dfrac{x^2}{2}$

$$\frac{(y+1)^3}{3} = \frac{x^2}{2} + C$$

Apply $y(0)=0$: $\dfrac{1}{3} = C$

$$(y+1)^3 = \frac{3x^2}{2} + 1 \implies \boxed{y = \left(\frac{3x^2}{2}+1\right)^{1/3} - 1}$$

Example 3 — Logistic-Type Equation

Solve $\dfrac{dP}{dt} = P(1-P)$, $P(0) = 0.1$ (the logistic equation).

Separate: $\dfrac{dP}{P(1-P)} = dt$

Left side requires partial fractions: $\dfrac{1}{P(1-P)} = \dfrac{1}{P} + \dfrac{1}{1-P}$

$$\int\!\left(\frac{1}{P}+\frac{1}{1-P}\right)dP = \int dt$$

For $\int\dfrac{dP}{1-P}$: let $u = 1-P$, $du = -dP$: gives $-\ln|1-P|$.

$$\ln P - \ln(1-P) = t + C \implies \ln\frac{P}{1-P} = t + C$$

$$\frac{P}{1-P} = Ae^t \implies P = \frac{Ae^t}{1+Ae^t}$$

Apply $P(0)=0.1$: $A = \dfrac{0.1}{0.9} = \dfrac{1}{9}$

$$\boxed{P(t) = \frac{e^t}{9+e^t}}$$

§ 9 — Initial Value Problems

Solving IVPs
with Substitution

An initial value problem (IVP) adds a specific condition $y(x_0) = y_0$ to pin down the constant of integration $C$.

IVP Example 1

Find $f(x)$ given $f'(x) = \dfrac{6x^2}{(x^3+1)^4}$ and $f(0) = 5$.

Let $u = x^3+1$, $du = 3x^2\,dx$, so $6x^2\,dx = 2\,du$:

$$f = \int \frac{2\,du}{u^4} = 2\int u^{-4}\,du = 2\cdot\frac{u^{-3}}{-3} + C = \frac{-2}{3(x^3+1)^3} + C$$

Apply $f(0) = 5$: $5 = \dfrac{-2}{3} + C \Rightarrow C = \dfrac{17}{3}$

$$\boxed{f(x) = \frac{-2}{3(x^3+1)^3} + \frac{17}{3}}$$

IVP Example 2

A LUMS student's study intensity (hours per day) follows $I'(t) = \sqrt{2t+1}$ with $I(0) = 0$. Find $I(t)$ and $I(4)$.

Let $u = 2t+1$, $du = 2\,dt$, so $dt = \dfrac{du}{2}$:

$$I = \int \sqrt{u}\cdot\frac{du}{2} = \frac{1}{2}\cdot\frac{2}{3}u^{3/2} + C = \frac{(2t+1)^{3/2}}{3} + C$$

Apply $I(0)=0$: $0 = \dfrac{1}{3} + C \Rightarrow C = -\dfrac{1}{3}$

$$\boxed{I(t) = \frac{(2t+1)^{3/2} - 1}{3}}$$

At $t=4$: $I(4) = \dfrac{(9)^{3/2}-1}{3} = \dfrac{27-1}{3} = \dfrac{26}{3} \approx 8.67$ hours/day.

Coming up next — §5.3 The Fundamental Theorem of Calculus (Full Treatment) — connecting differentiation and integration into one of mathematics' most beautiful theorems.
← §5.1 Indefinite Integration
§5.2 · Chapter 5 · Calculus I
§5.3 FTC →