In short
Integration by substitution reverses the chain rule. When a composite function and the derivative of its inner piece both appear inside an integral, you can replace the inner piece with a single new variable, integrate the simpler expression, and then substitute back. It is the single most-used integration technique in all of calculus.
You know how to integrate \int x^4\,dx — that is just the power rule. But what about
The power rule says \int u^4\,du = \frac{u^5}{5}. The trouble is that the thing being raised to the fourth power is not a bare x — it is 2x + 3. You cannot just write \frac{(2x+3)^5}{5} and call it done, because differentiating \frac{(2x+3)^5}{5} gives \frac{5(2x+3)^4 \cdot 2}{5} = 2(2x+3)^4, which is twice the integrand. There is an extra factor of 2 from the chain rule, and you need to account for it.
The fix is simple but powerful: change the variable. Set u = 2x + 3, so that du = 2\,dx, i.e. dx = \frac{du}{2}. Then
That is integration by substitution. You traded a complicated integral for a simple one by introducing a new variable that absorbed the inner structure.
Why it works: the chain rule in reverse
Substitution is not a trick — it is a theorem. It is what happens when you run the chain rule backward.
The chain rule says: if F(u) is an antiderivative of f(u), and u = g(x) is a differentiable function of x, then
Read that from right to left. It says that F(g(x)) is an antiderivative of the product f(g(x)) \cdot g'(x). In integral notation:
That is the substitution formula. The left side is the integral you are trying to compute. The right side is what you get by setting u = g(x), integrating f(u), and substituting back.
Integration by Substitution
If u = g(x) is a differentiable function whose range is an interval on which f is continuous, then
where u = g(x) and du = g'(x)\,dx.
The entire technique boils down to three steps:
- Choose a substitution u = g(x).
- Replace every x in the integrand with expressions in u, including replacing dx with \frac{du}{g'(x)}.
- Integrate in u, then substitute back u = g(x) at the end.
The hard part is step 1 — choosing the right u.
Recognizing patterns
How do you spot a good substitution? Look for a function and its derivative sitting side by side inside the integral. Here are the most common patterns.
Pattern 1: Inner function and its derivative. In \int (2x+3)^4\,dx, the inner function is 2x + 3 and its derivative 2 is a constant — easy to absorb. In \int x\sqrt{x^2+1}\,dx, the inner function is x^2 + 1 and its derivative 2x is (up to a constant) the other factor x. Set u = x^2 + 1, and the x\,dx becomes \frac{du}{2}.
Pattern 2: Denominator whose derivative is in the numerator. In \int \frac{2x}{x^2+1}\,dx, the numerator 2x is exactly the derivative of the denominator x^2 + 1. Set u = x^2 + 1, so du = 2x\,dx, and the integral becomes \int \frac{du}{u} = \ln|u| + C = \ln(x^2+1) + C.
Pattern 3: Exponent whose derivative is a factor. In \int x\,e^{x^2}\,dx, the exponent x^2 has derivative 2x, and the factor x is (up to a constant 2) exactly that. Set u = x^2, so du = 2x\,dx, and the integral becomes \frac{1}{2}\int e^u\,du = \frac{1}{2}e^{x^2} + C.
Pattern 4: Argument of a trig function whose derivative is a factor. In \int \cos(3x)\,dx, set u = 3x, du = 3\,dx, and get \frac{1}{3}\sin(3x) + C. In \int x\sin(x^2)\,dx, set u = x^2, and the x\,dx absorbs into \frac{du}{2}.
The common thread: the derivative of the inner function must already be present (up to a constant multiple) among the remaining factors of the integrand. If it is, the substitution works cleanly. If it isn't, you need a different approach.
Worked examples
Example 1: A power-of-a-linear-function integral
Find \displaystyle\int \frac{x}{\sqrt{1 + 2x^2}}\,dx.
Step 1. Identify the inner function. The expression under the square root is 1 + 2x^2. Its derivative is 4x. The factor x in the numerator is (up to a constant) that derivative.
Why: the derivative of the inside tells you what must be present outside for the substitution to absorb everything cleanly.
Step 2. Set u = 1 + 2x^2. Then du = 4x\,dx, so x\,dx = \frac{du}{4}.
Why: expressing x\,dx in terms of du lets you replace every part of the integrand that involves x.
Step 3. Substitute into the integral.
Why: after substitution, the integral is a straightforward power rule in u.
Step 4. Integrate using the power rule.
Why: \int u^{-1/2}\,du = \frac{u^{1/2}}{1/2} = 2\sqrt{u}.
Step 5. Substitute back u = 1 + 2x^2.
Result: \displaystyle\frac{\sqrt{1+2x^2}}{2} + C.
Check: differentiate the answer. \frac{d}{dx}\frac{\sqrt{1+2x^2}}{2} = \frac{1}{2} \cdot \frac{4x}{2\sqrt{1+2x^2}} = \frac{x}{\sqrt{1+2x^2}}. This matches the integrand, confirming the result.
Example 2: A trigonometric pattern
Find \displaystyle\int \sin^3 x \cos x\,dx.
Step 1. Spot the pattern. The integrand has \sin^3 x and \cos x. Since \frac{d}{dx}(\sin x) = \cos x, the factor \cos x is exactly the derivative of the inner function \sin x.
Why: this means the substitution u = \sin x will absorb \cos x\,dx into du, leaving a pure power of u.
Step 2. Set u = \sin x, so du = \cos x\,dx.
Step 3. Substitute.
Why: \sin^3 x becomes u^3, and \cos x\,dx becomes du. The entire integrand is now a single power of u.
Step 4. Integrate.
Step 5. Substitute back.
Result: \displaystyle\frac{\sin^4 x}{4} + C.
Differentiation check: \frac{d}{dx}\frac{\sin^4 x}{4} = \frac{4\sin^3 x \cos x}{4} = \sin^3 x \cos x. Confirmed.
Trigonometric substitutions
Some integrals do not contain a trig function at all, but a trig substitution is exactly the tool that cracks them open. The idea: use a trig identity to eliminate a square root.
The three standard cases are:
| Expression in integrand | Substitution | Why it works |
|---|---|---|
| \sqrt{a^2 - x^2} | x = a\sin\theta | a^2 - a^2\sin^2\theta = a^2\cos^2\theta, so \sqrt{\cdot} = a\cos\theta |
| \sqrt{x^2 + a^2} | x = a\tan\theta | a^2\tan^2\theta + a^2 = a^2\sec^2\theta, so \sqrt{\cdot} = a\sec\theta |
| \sqrt{x^2 - a^2} | x = a\sec\theta | a^2\sec^2\theta - a^2 = a^2\tan^2\theta, so \sqrt{\cdot} = a\tan\theta |
Each substitution turns the square root into a clean trig expression, because it is built on the Pythagorean identity \sin^2\theta + \cos^2\theta = 1 (and its relatives 1 + \tan^2\theta = \sec^2\theta).
An example: \int \frac{dx}{\sqrt{a^2 - x^2}}
Set x = a\sin\theta, so dx = a\cos\theta\,d\theta. Then
and the integral becomes
That is the standard result \int \frac{dx}{\sqrt{a^2 - x^2}} = \sin^{-1}\!\left(\frac{x}{a}\right) + C, derived in a few lines.
The geometric picture makes the substitution inevitable. The expression \sqrt{a^2 - x^2} is the height of a point on a circle of radius a. Parametrizing the circle by the angle \theta replaces the square root with a\cos\theta — no algebraic cleverness required, just the definition of cosine.
When to use which substitution
The rule of thumb: match the form under the square root to the identity.
- See a^2 - x^2? Think \sin^2 + \cos^2 = 1. Set x = a\sin\theta.
- See x^2 + a^2? Think \tan^2 + 1 = \sec^2. Set x = a\tan\theta.
- See x^2 - a^2? Think \sec^2 - 1 = \tan^2. Set x = a\sec\theta.
Even when the square root is not explicitly written, these substitutions work whenever a^2 - x^2, x^2 + a^2, or x^2 - a^2 appears in the integrand and is making the integral difficult.
Rationalizing substitutions
Sometimes the integrand contains a fractional power or a root that is not a square root. A substitution that eliminates the root entirely — rationalizing it — is often the cleanest path forward.
Cube roots and nth roots
For an integrand involving \sqrt[n]{ax + b}, the substitution u = (ax + b)^{1/n} — equivalently ax + b = u^n — turns the root into a plain power of u.
Take \int \frac{dx}{\sqrt[3]{x+1} + 1}. Set u = (x+1)^{1/3}, so x + 1 = u^3 and dx = 3u^2\,du. The integral becomes
This is a rational function in u, which you can handle by polynomial division: \frac{3u^2}{u+1} = 3u - 3 + \frac{3}{u+1}. So
Substituting back u = (x+1)^{1/3} gives the answer in terms of x.
The Weierstrass substitution
For integrals of rational functions of \sin x and \cos x — like \int \frac{dx}{1 + \sin x} — the substitution t = \tan(x/2) is remarkably powerful. It converts every trig function into a rational function of t:
The integral becomes a rational function in t, and rational functions can always be integrated using partial fractions. This substitution is called the Weierstrass substitution (or sometimes the universal trigonometric substitution), and it works on any integral of the form \int R(\sin x, \cos x)\,dx.
For \int \frac{dx}{1 + \sin x}:
Substituting back t = \tan(x/2) gives -\frac{2}{1 + \tan(x/2)} + C.
Common confusions
-
"I can substitute u = \sin x and also replace dx with du." Not directly. If u = \sin x, then du = \cos x\,dx, not dx. You must replace the entire differential dx with \frac{du}{\cos x}, and then the remaining \cos x terms must cancel or simplify. If they don't, that substitution is not the right one.
-
"Any substitution will simplify the integral." A bad substitution makes the integral worse. If after substituting you still have x terms mixed with u terms, the substitution has failed. A correct substitution replaces everything with the new variable.
-
"Substitution only works when g'(x) appears exactly." It needs to appear up to a constant multiple. If g'(x) = 4x and you see x in the integrand, that is fine — you get a factor of \frac{1}{4} out front. But if g'(x) = 4x and you see x^2, the substitution does not absorb the extra x, and you need a different approach.
-
"After trig substitution I can leave the answer in terms of \theta." No. You must convert back to x. If you set x = a\sin\theta, then \theta = \sin^{-1}(x/a), and any \cos\theta in the answer is \sqrt{a^2 - x^2}/a. Draw the right triangle: hypotenuse a, opposite side x, adjacent side \sqrt{a^2 - x^2}.
Going deeper
If you came here to learn the substitution technique and the main patterns, you have them — you can stop here. What follows is for readers who want the formal justification and some subtleties that matter in harder problems.
The substitution theorem, precisely
The statement given above sweeps one condition under the rug: the substitution u = g(x) must be one-to-one on the interval of integration (for definite integrals), or at least locally invertible (for indefinite integrals). When g is not one-to-one — for example, u = x^2 maps both x = 1 and x = -1 to u = 1 — you must split the interval into pieces where g is monotone, apply the substitution to each piece, and add the results.
For indefinite integrals, this subtlety rarely matters, because you verify the answer by differentiation: if the derivative of your answer is the original integrand, the antiderivative is correct regardless of how you found it.
Substitution in definite integrals
When computing \int_a^b f(g(x))\,g'(x)\,dx by substitution, you can either:
-
Convert the limits: when x = a, u = g(a); when x = b, u = g(b). Then compute \int_{g(a)}^{g(b)} f(u)\,du directly. This avoids back-substitution entirely.
-
Or keep the original limits, integrate in u, substitute back to x, and then evaluate at a and b.
The first approach is usually cleaner. For the integral \int_0^1 x\,e^{x^2}\,dx with u = x^2: when x = 0, u = 0; when x = 1, u = 1. So \int_0^1 x\,e^{x^2}\,dx = \frac{1}{2}\int_0^1 e^u\,du = \frac{1}{2}(e - 1).
Multiple substitutions in sequence
Some integrals require two substitutions. For \int \frac{dx}{1 + e^x}, first set u = e^x, so du = e^x\,dx = u\,dx, giving dx = \frac{du}{u}. The integral becomes \int \frac{du}{u(1+u)}, which is a partial fractions problem:
So \int \frac{du}{u(1+u)} = \ln|u| - \ln|1+u| + C = \ln\frac{u}{1+u} + C = \ln\frac{e^x}{1+e^x} + C = x - \ln(1+e^x) + C.
This is one substitution followed by a partial-fraction decomposition — a pattern that comes up often enough that it is worth recognizing.
A non-obvious substitution: \int \sec x\,dx
The integral \int \sec x\,dx is famous for looking impossible until you see the trick. Multiply numerator and denominator by \sec x + \tan x:
Now set u = \sec x + \tan x. Then du = (\sec x\tan x + \sec^2 x)\,dx, which is exactly the numerator. So the integral is \int \frac{du}{u} = \ln|\sec x + \tan x| + C.
The cleverness is in multiplying by \frac{\sec x + \tan x}{\sec x + \tan x} — which is just 1 — and then noticing that the substitution falls out. This integral shows up so often that the result is worth memorizing, but the derivation shows it is not magic: it is substitution, applied creatively.
Where this leads next
You now have the most fundamental integration technique. Every technique that follows builds on it.
- Special Integrals - Part 1 — the five standard integrals involving x^2 \pm a^2 and square roots, all derived using substitution.
- Special Integrals - Part 2 — integrals with quadratic denominators ax^2 + bx + c, reduced to the Part 1 forms by completing the square.
- Integration by Parts — the other major technique, for integrals where substitution is not enough.
- Definite Integration Techniques — how substitution works with definite integrals, including the limit-conversion trick.