U-substitution (integration by substitution) is the chain rule run backwards. It turns
$$\int f\big(g(x)\big)\,g'(x)\,dx \quad\text{into}\quad \int f(u)\,du \quad\text{with } u = g(x)$$
It is the first technique you should reach for when an integral is not on your basic table, and it shows up inside almost every other method, from integration by parts to partial fractions.
When to use it
Look for a function and its derivative (up to a constant factor) both appearing in the integrand. For example, in \( \int 2x(x^2+1)^5\,dx \), the inner function \( x^2 + 1 \) has derivative \( 2x \), which is sitting right there.
Typical signals are a composite function (something inside a power, root, exponential, log or trig function) multiplied by a factor that looks like the derivative of that inside piece.
Why it works
Suppose \( F \) is an antiderivative of \( f \), so \( F' = f \). By the chain rule,
$$\frac{d}{dx}F\big(g(x)\big) = F'\big(g(x)\big)\,g'(x) = f\big(g(x)\big)\,g'(x)$$
Read that equation backwards and it says exactly that \( F(g(x)) \) is an antiderivative of \( f(g(x))\,g'(x) \). That is the whole theorem. Substitution is not a trick; it is the chain rule written as an integration rule.
For a concrete check, differentiate \( \sin(x^2 + 1) \). You get \( \cos(x^2+1)\cdot 2x \). So an integral of the form \( \int 2x\cos(x^2+1)\,dx \) must come back to \( \sin(x^2+1) + C \), and substitution with \( u = x^2 + 1 \) finds it mechanically.
The notation \( du = g'(x)\,dx \) is a bookkeeping device that makes this automatic. You can think of it as “a small change in \( u \) equals the rate \( g'(x) \) times a small change in \( x \)”, which is the same picture as a derivative.
The 5-step method
- Choose \( u \): usually the “inside” function (inside a power, root, trig function, exponential or denominator).
- Compute \( du = u'(x)\,dx \).
- Rewrite everything in \( u \). No \( x \) may be left over.
- Integrate in \( u \).
- Substitute back \( u = g(x) \) and add \( + C \).
Patterns that tell you what u should be
Most textbook and exam integrals fall into a handful of recognizable shapes. Learning to spot them saves a lot of trial and error:
- A power of a polynomial times its derivative. Something like \( (x^3 + 1)^4 \) next to \( x^2 \): let \( u \) be the polynomial inside the power.
- A root with a matching factor outside. \( \sqrt{x^2 + 4} \) next to \( x \): let \( u \) be what is under the root.
- An exponential with a non-trivial exponent. \( e^{x^2} \) next to \( x \), or \( e^{\sin x} \) next to \( \cos x \): let \( u \) be the exponent.
- A fraction whose numerator is the derivative of its denominator. This always gives a logarithm, because \( \int\frac{g'(x)}{g(x)}dx = \ln|g(x)| + C \).
- A logarithm divided by \( x \). Since \( \frac1x \) is the derivative of \( \ln x \), let \( u = \ln x \).
- Powers of sine or cosine with one extra factor of the other. Let \( u \) be the function that appears to the higher power, so the lone factor becomes \( du \).
If two candidates look plausible, pick the one whose derivative you can actually see. A bad choice is harmless: you will notice immediately because some \( x \) refuses to disappear, and you simply try the other option.
7 worked examples
1. \( \int 2x(x^2+1)^5\,dx \). \( u = x^2 + 1 \), \( du = 2x\,dx \):
$$\int u^5\,du = \frac{u^6}{6} + C = \frac{(x^2+1)^6}{6} + C$$
2. \( \int x\cos(x^2)\,dx \). \( u = x^2 \), \( du = 2x\,dx \), so \( x\,dx = \frac12du \):
$$\frac12\int\cos u\,du = \frac{\sin(x^2)}{2} + C$$
3. \( \int e^{3x}\,dx \). \( u = 3x \), \( dx = \frac13du \): \( \frac{e^{3x}}{3} + C \).
4. \( \int\frac{x}{\sqrt{x^2+4}}\,dx \). \( u = x^2 + 4 \), \( x\,dx = \frac12du \):
$$\frac12\int u^{-1/2}du = u^{1/2} + C = \sqrt{x^2+4} + C$$
5. \( \int\frac{\ln x}{x}\,dx \). \( u = \ln x \), \( du = \frac{dx}{x} \): \( \frac{(\ln x)^2}{2} + C \).
6. \( \int\sin^3x\cos x\,dx \). \( u = \sin x \): \( \frac{\sin^4 x}{4} + C \).
7. \( \int x(x+1)^4\,dx \) (the “leftover x” case). \( u = x + 1 \) so \( x = u - 1 \):
$$\int(u - 1)u^4\,du = \frac{u^6}{6} - \frac{u^5}{5} + C = \frac{(x+1)^6}{6} - \frac{(x+1)^5}{5} + C$$
Harder examples
8. \( \int\tan x\,dx \). There is no obvious inside function until you rewrite tangent as a quotient, \( \frac{\sin x}{\cos x} \). Now the denominator’s derivative, \( -\sin x \), appears in the numerator. Let \( u = \cos x \), so \( du = -\sin x\,dx \):
$$\int\frac{\sin x}{\cos x}\,dx = -\int\frac{du}{u} = -\ln|\cos x| + C$$
The lesson: rewriting the integrand is often the step that makes a substitution visible. The full story is in integral of tan x.
9. \( \int x^3\sqrt{x^2+1}\,dx \) (back-substitution). Take \( u = x^2 + 1 \), so \( x\,dx = \frac12du \). Split \( x^3 \) as \( x^2\cdot x \), then replace the leftover \( x^2 \) with \( u - 1 \):
$$\begin{aligned} \int x^2\sqrt{x^2+1}\;x\,dx &= \frac12\int(u - 1)\,u^{1/2}\,du \\ &= \frac12\int\left(u^{3/2} - u^{1/2}\right)du \\ &= \frac{u^{5/2}}{5} - \frac{u^{3/2}}{3} + C \end{aligned}$$
So the answer is \( \frac{(x^2+1)^{5/2}}{5} - \frac{(x^2+1)^{3/2}}{3} + C \). Whenever an \( x \) survives the substitution, solve \( u = g(x) \) for the piece you need and replace it.
Notice what would have happened with the wrong choice. If you tried \( u = x^3 \), then \( du = 3x^2dx \), and you would be left with \( \sqrt{x^2 + 1} \), which cannot be written neatly in terms of \( x^3 \). That dead end is your signal to switch to the inside of the root.
A quick way to check any answer
Every substitution answer can be checked by differentiating it, and you should make this a habit on tests. For Example 9, differentiating \( \frac{(x^2+1)^{5/2}}{5} \) gives \( x(x^2+1)^{3/2} \), and differentiating \( \frac{(x^2+1)^{3/2}}{3} \) gives \( x(x^2+1)^{1/2} \). Their difference factors as \( x\sqrt{x^2+1}\,\big((x^2+1) - 1\big) = x^3\sqrt{x^2+1} \), which is the original integrand. If the check fails, the most likely culprit is a missing constant factor from \( du \).
Definite integrals: change the limits
When you substitute in a definite integral, convert the limits too, and you never need to go back to \( x \).
$$\int_0^1 xe^{x^2}\,dx, \quad u = x^2: \; x = 0 \Rightarrow u = 0,\; x = 1 \Rightarrow u = 1$$
$$= \frac12\int_0^1 e^u\,du = \frac{e - 1}{2}$$
Example 10. \( \int_1^e\frac{(\ln x)^2}{x}\,dx \). With \( u = \ln x \), the limits become \( u = \ln 1 = 0 \) and \( u = \ln e = 1 \):
$$\int_0^1 u^2\,du = \frac13$$
Changing the limits works because of the Fundamental Theorem of Calculus: both sides are the same antiderivative evaluated at matching endpoints. You can also go back to \( x \) and use the original limits; the answer is the same, but it takes more writing and invites mistakes.
Common mistakes
- Forgetting to replace \( dx \). Every \( dx \) must become something times \( du \).
- Leaving \( x \) in the integral. If you can’t remove it, choose a different \( u \) (or use integration by parts).
- Keeping the old limits in a definite integral after substituting.
- Needing a missing variable factor. You can adjust constants (like the \( \frac12 \) in example 2), but not variables. \( \int\cos(x^2)\,dx \) has no \( x \) to pair with \( du = 2x\,dx \), and in fact has no elementary answer.
- Dropping the constant factor. Writing \( \int e^{3x}dx = e^{3x} + C \) forgets that \( dx = \frac13du \). Differentiate your answer: you would get \( 3e^{3x} \), not \( e^{3x} \). Differentiating to check takes seconds and catches most errors.
Where it’s used
Substitution is everywhere once you start looking. It produces the standard results \( \int\tan x\,dx \) and \( \int\sec x\,dx \), it finishes the log pieces in partial fractions, and the idea of changing variables returns as trigonometric substitution in the integral of √(1−x²). In probability and physics, rescaling a variable (for example turning a normal distribution into the standard normal) is a substitution in disguise.
Try it yourself
The solver detects substitutions automatically and shows which \( u \) it chose:
Step-by-step solver·Exact symbolic engine
Interactive Calculus Problem Solver
Derivatives, antiderivatives, definite and improper integrals, and limits. Every answer comes with the rules used, and antiderivatives are verified by differentiating them back.
Input syntax
- Powers
x^2, rootssqrt(x),cbrt(x), absolute value|x| - Implicit multiplication works:
3x sin(2x) sin cos tan sec csc cot,asin acos atan,sinh cosh tanhe^xorexp(x);ln(x)andlog(x)are both the natural log- Constants
piande; bounds acceptinfand-inf
For more integrals with full working, use the integral calculator.
Practice problems
Try these before checking the answers.
- \( \int 3x^2(x^3 + 1)^4\,dx \)
- \( \int\frac{\cos x}{\sin^2 x}\,dx \)
- \( \int_0^{\pi/2}\sin x\cos^2x\,dx \)
- \( \int\frac{e^x}{1 + e^x}\,dx \)
- \( \int\frac{dx}{x\ln x} \)
- \( \int_0^2 x\sqrt{4 - x^2}\,dx \)
- \( \int\sec^2x\tan x\,dx \)
Answers: (1) \( \frac{(x^3+1)^5}{5} + C \); (2) \( -\frac{1}{\sin x} + C \); (3) \( \frac13 \); (4) \( \ln(1 + e^x) + C \); (5) \( \ln|\ln x| + C \); (6) \( \frac83 \); (7) \( \frac{\tan^2x}{2} + C \).
Hints: in (4) the denominator is \( u \); in (5) take \( u = \ln x \); in (6) let \( u = 4 - x^2 \), so the limits run from 4 down to 0 and the minus sign from \( du = -2x\,dx \) flips them back; in (7) take \( u = \tan x \).
FAQ
How do I pick u?
Pick the piece whose derivative you can see elsewhere in the integrand. If the first choice fails, try the next “inside” function.
U-substitution or integration by parts?
Substitution if one part is (almost) the derivative of another; parts if it’s a product of unrelated types like \( xe^x \) or \( x\ln x \).
Do I have to change the limits of integration?
Only if you stay in \( u \) to the end. If you substitute back to \( x \) first, use the original limits. Never mix the two: \( u \)-limits belong with a \( u \)-antiderivative.
Why is it called u-substitution?
Only by habit: textbooks traditionally call the new variable \( u \). Any letter works, and in trigonometric substitution you will see \( \theta \) instead.
Can every integral be solved with substitution?
No. It only works when the integrand has the shape \( f(g(x))g'(x) \), possibly after rewriting. Many integrals need parts, partial fractions or trig identities, and some, like \( \int e^{-x^2}dx \), have no elementary antiderivative at all.
Further reading
- Substitution Rule for Indefinite Integrals (Paul’s Online Math Notes) — many more worked examples, including tricky choices of u.
- Substitution Rule for Definite Integrals (Paul’s Online Math Notes) — both ways of handling limits, side by side.
Calculators for this topic
Keep learning
Fundamental Theorem of Calculus (Parts 1 and 2) Explained
The Fundamental Theorem of Calculus links derivatives and integrals. Both parts explained with intuition, formulas and worked examples.
Improper Integrals: How to Tell If They Converge or Diverge
Improper integrals have infinite limits or infinite integrands. Learn the limit definition, the p-integral test, comparison, and 6 worked examples.

