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

\int (2x+3)^4\,dx\;?

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

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

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

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

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:

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

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

\int f(g(x)) \cdot g'(x)\,dx = \int f(u)\,du

where u = g(x) and du = g'(x)\,dx.

The entire technique boils down to three steps:

  1. Choose a substitution u = g(x).
  2. Replace every x in the integrand with expressions in u, including replacing dx with \frac{du}{g'(x)}.
  3. 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.

\int \frac{x}{\sqrt{1+2x^2}}\,dx = \int \frac{1}{\sqrt{u}} \cdot \frac{du}{4} = \frac{1}{4}\int u^{-1/2}\,du

Why: after substitution, the integral is a straightforward power rule in u.

Step 4. Integrate using the power rule.

\frac{1}{4} \cdot \frac{u^{1/2}}{1/2} = \frac{1}{4} \cdot 2\sqrt{u} = \frac{\sqrt{u}}{2}

Why: \int u^{-1/2}\,du = \frac{u^{1/2}}{1/2} = 2\sqrt{u}.

Step 5. Substitute back u = 1 + 2x^2.

\int \frac{x}{\sqrt{1+2x^2}}\,dx = \frac{\sqrt{1+2x^2}}{2} + C

Result: \displaystyle\frac{\sqrt{1+2x^2}}{2} + C.

The dashed black curve is the integrand $\frac{x}{\sqrt{1+2x^2}}$. The solid red curve is the antiderivative $\frac{\sqrt{1+2x^2}}{2}$ (with $C = 0$). At every $x$, the height of the red curve is growing at a rate equal to the height of the black curve — that is what "antiderivative" means.

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.

\int \sin^3 x \cos x\,dx = \int u^3\,du

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.

\int u^3\,du = \frac{u^4}{4}

Step 5. Substitute back.

\int \sin^3 x \cos x\,dx = \frac{\sin^4 x}{4} + C

Result: \displaystyle\frac{\sin^4 x}{4} + C.

The dashed curve is the integrand $\sin^3 x \cos x$, oscillating between positive and negative. The solid red curve is the antiderivative $\frac{\sin^4 x}{4}$, always non-negative, rising where the integrand is positive and falling where it is negative. At $x = \pi/2$, the antiderivative reaches $1/4$ — exactly $\sin^4(\pi/2)/4 = 1/4$.

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

\sqrt{a^2 - x^2} = \sqrt{a^2 - a^2\sin^2\theta} = a\cos\theta

and the integral becomes

\int \frac{a\cos\theta\,d\theta}{a\cos\theta} = \int d\theta = \theta + C = \sin^{-1}\!\left(\frac{x}{a}\right) + C

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 substitution $x = a\sin\theta$ in action for $a = 2$. The point on the semicircle has coordinates $(x, \sqrt{a^2 - x^2})$. The angle $\theta$ at the origin connects $x$ to the radius $a$, so $x = a\sin\theta$ and $\sqrt{a^2 - x^2} = a\cos\theta$. The square root is just the other leg of a right triangle inscribed in the circle.

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.

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

\int \frac{3u^2\,du}{u + 1}

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

\int \left(3u - 3 + \frac{3}{u+1}\right)du = \frac{3u^2}{2} - 3u + 3\ln|u+1| + C

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:

\sin x = \frac{2t}{1+t^2}, \quad \cos x = \frac{1-t^2}{1+t^2}, \quad dx = \frac{2\,dt}{1+t^2}

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}:

\int \frac{1}{1 + \frac{2t}{1+t^2}} \cdot \frac{2\,dt}{1+t^2} = \int \frac{2\,dt}{1 + t^2 + 2t} = \int \frac{2\,dt}{(1+t)^2} = -\frac{2}{1+t} + C

Substituting back t = \tan(x/2) gives -\frac{2}{1 + \tan(x/2)} + C.

Decision flowchart for choosing a substitutionA decision flowchart showing how to choose the right substitution technique. It branches based on what appears in the integrand: if you see a composite function with its derivative, use direct substitution; if you see a square root of a squared expression, use trig substitution; if you see a fractional power, use a rationalizing substitution; if you see rational trig, use the Weierstrass substitution. What is in the integrand? f(g(x)) · g'(x) u = g(x) √(a² ± x²) or √(x² − a²) Trig substitution ⁿ√(ax + b) or R(sin, cos) Rationalizing sub. ∫ f(u) du ∫ trig expr dθ ∫ rational du Substitute back
A decision map for choosing the right substitution. Start with what you see in the integrand, choose the matching substitution, integrate in the new variable, and always substitute back at the end.

Common confusions

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:

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:

\frac{1}{u(1+u)} = \frac{1}{u} - \frac{1}{1+u}

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:

\int \sec x \cdot \frac{\sec x + \tan x}{\sec x + \tan x}\,dx = \int \frac{\sec^2 x + \sec x\tan x}{\sec x + \tan x}\,dx

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.