# U-Substitution Rule: Formula, Steps and Examples

> The u-substitution rule reverses the chain rule: ∫f(g(x))g′(x)dx = ∫f(u)du. Formula, how to choose u, definite integral limits and examples.

Source: https://practicecalculus.com/rules/u-substitution-rule
Updated: 2026-11-03

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

## At a glance

- **Reverses:** The chain rule for derivatives
- **Use when:** The integrand contains an inner function $g(x)$ and, up to a constant, its derivative $g'(x)$
- **Key step:** Set $u = g(x)$ and replace $dx$ using $du = g'(x)\,dx$
- **Definite integrals:** Change the limits to $u = g(a)$ and $u = g(b)$
- **Also called:** Integration by substitution, change of variables

## Key takeaways

- U-substitution is the chain rule in reverse: look for an inner function whose derivative also appears.
- After substituting, the integral must contain only $u$ and $du$, with no $x$ left over.
- A missing constant factor is fine: you can fix it by multiplying and dividing.
- For definite integrals, change the limits to $u$-values or substitute back before evaluating.

**U-substitution** is the [chain rule](/rules/chain-rule) run backwards. When an integrand contains a function inside another function, together with the derivative of that inside function, a single change of variable turns it into a basic integral.

## The u-substitution formula

If $u = g(x)$ is differentiable and $f$ is continuous, then

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

The trick is the differential: from $u = g(x)$ you get $du = g'(x)\,dx$, which replaces the leftover factor and the $dx$ together.

For a definite integral the limits change with the variable:

$$\int_a^b f(g(x))\,g'(x)\,dx = \int_{g(a)}^{g(b)} f(u)\,du$$

## The steps

1. **Choose $u$**: the inner function of a composition.
2. **Compute $du$**: $du = g'(x)\,dx$, then solve for $dx$ or for the factor you need.
3. **Substitute**: rewrite the whole integral in $u$. No $x$ may remain.
4. **Integrate** in $u$ with a basic rule such as the [reverse power rule](/rules/reverse-power-rule).
5. **Substitute back** $u = g(x)$, or use the new limits for a definite integral.

## How to spot it

| Integrand pattern | Good choice of $u$ |
| --- | --- |
| $(\text{something})^n \cdot (\text{its derivative})$ | the something |
| $e^{g(x)}\,g'(x)$ | the exponent $g(x)$ |
| $\sin(g(x))\,g'(x)$, $\cos(g(x))\,g'(x)$ | the angle $g(x)$ |
| $\frac{g'(x)}{g(x)}$ | the denominator $g(x)$, giving $\ln\lvert g(x)\rvert$ |
| $f(ax + b)$ | the linear inside $ax + b$ |

## Worked examples

**Example 1: a power.** For $\int 2x\,(x^2 + 1)^5\,dx$, let $u = x^2 + 1$, so $du = 2x\,dx$:

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

**Example 2: fixing a constant.** For $\int x\,e^{x^2}\,dx$, let $u = x^2$, so $du = 2x\,dx$ and $x\,dx = \frac{1}{2}du$:

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

**Example 3: a linear inside.** For $\int \cos(3x)\,dx$, let $u = 3x$, so $dx = \frac{1}{3}du$:

$$\int \cos(3x)\,dx = \frac{1}{3}\sin(3x) + C$$

**Example 4: a logarithm appears.** For $\int \tan x\,dx = \int \frac{\sin x}{\cos x}\,dx$, let $u = \cos x$, so $\sin x\,dx = -du$:

$$\int -\frac{1}{u}\,du = -\ln\lvert \cos x\rvert + C$$

**Example 5: a definite integral.** For $\int_0^1 2x\,(x^2+1)^3\,dx$, let $u = x^2 + 1$. When $x = 0$, $u = 1$; when $x = 1$, $u = 2$:

$$\int_1^2 u^3\,du = \left[\frac{u^4}{4}\right]_1^2 = \frac{16}{4} - \frac{1}{4} = \frac{15}{4}$$

## Checking your answer

Differentiate the result and you should recover the original integrand, including the inner derivative. For Example 1, the chain rule gives

$$\frac{d}{dx}\left[\frac{(x^2+1)^6}{6}\right] = (x^2+1)^5 \cdot 2x$$

which matches. If your check is off by a constant factor, you most likely forgot to rescale $du$. If it is off by a factor containing $x$, the substitution was not valid in the first place and you need a different $u$ or a different technique.

## Common mistakes

1. **Leaving $x$ in the integral.** $\int x^2 e^{x^2}\,dx$ with $u = x^2$ leaves an extra $x$ that cannot be removed. Substitution fails there, and no constant fixes it.
2. **Forgetting to replace $dx$.** $\int (2x+1)^3\,dx$ is not $\frac{(2x+1)^4}{4} + C$. With $du = 2\,dx$ the answer is $\frac{(2x+1)^4}{8} + C$.
3. **Mixing limits.** After converting to $u$, use the $u$-limits. Plugging the old $x$-limits into a $u$ expression gives a wrong number.
4. **Not substituting back.** An indefinite integral answer must be in terms of $x$.

## Where it fits

Substitution is the first technique to try after the basic rules and [linearity](/rules/integral-linearity-rules). If the integrand is a product of two unrelated functions, such as $x\,e^{x}$, there is no inner derivative to match and [integration by parts](/rules/integration-by-parts-rule) is usually the right tool. For a step-by-step walkthrough with more examples, read the full guide to [u-substitution](/blog/u-substitution).

## Frequently asked questions

### What is the u-substitution rule?

It is the rule $\int f(g(x))\,g'(x)\,dx = \int f(u)\,du$ with $u = g(x)$. It turns an integral that came from the chain rule into a simpler integral in $u$.

### How do you choose u in u-substitution?

Choose the inner part of a composition, such as the expression inside a power, root, exponential or trig function, whose derivative also appears in the integrand up to a constant.

### What if du is off by a constant?

That is fine. If $du = 3\,dx$ but the integral only has $dx$, write $dx = \frac{1}{3}du$. Only constant mismatches can be fixed this way, not missing variables.

### Do you change the limits in u-substitution?

Yes, for a definite integral you either convert the limits with $u = g(a)$ and $u = g(b)$, or you substitute $x$ back before plugging in the original limits. Do not mix the two.
