Start the course

Integrals

U-substitution: how to choose u, with step-by-step examples

6 min readUpdated

Quick answer

U-substitution solves integrals that contain an inside function together with that inside function's derivative. Let u be the inside function, write du=u′(x)dx, and rewrite the whole integral in terms of u. Integrate, then replace u with the original expression. For example, with u=x2, ∫2xcos⁡(x2)dx= ∫cos⁡udu= sin⁡(x2)+C.

Key points
  • U-substitution is the chain rule run backwards.
  • Choose u as the inside function whose derivative also appears in the integral (up to a constant factor).
  • After substituting, the integral must contain only u and du, with no x left over.
  • For a definite integral, change the limits to u-values and don't substitute back.

What is u-substitution?

The basic integration rules handle powers, ex, 1x, sin⁡x and cos⁡x, but not something like ∫2xcos⁡(x2)dx. The way in is to remember where such an integrand comes from. By the chain rule, ddxsin⁡(x2)= cos⁡(x2)⋅2x: an outside function's derivative, evaluated at the inside, times the inside's derivative. Our integrand has exactly that shape, so its antiderivative must be sin⁡(x2)+C.

U-substitution (also called integration by substitution) makes this reverse-chain-rule idea systematic. You give the inside function a new name, u, which turns the integral into a simpler one in u.

The substitution rule
If u=g(x), then ∫f(g(x))g′(x)dx= ∫f(u)du.
Why it works
  1. Let F be an antiderivative of f, so F′=f.
  2. By the chain rule, ddxF(g(x))= f(g(x))g′(x).
  3. So F(g(x))+C is the antiderivative of the left side, and F(u)+C with u=g(x) is exactly the same thing.

How do you do u-substitution step by step?

  1. Choose u: usually the inside function (inside a power, a root, e( ), sin⁡( ), or the bottom of a fraction).
  2. Find du: differentiate, dudx=u′(x), and write it as du=u′(x)dx.
  3. Rewrite the whole integral in terms of u and du. Every x must disappear; adjust a constant factor if needed.
  4. Integrate with respect to u.
  5. Substitute back: replace u with the original expression in x. Add +C.
Worked example: A power of an inside function

Find ∫x(x2+1)5dx.

  1. Choose: the inside of the 5th power, u=x2+1.
  2. Differentiate: du=2xdx. The integral has xdx, not 2xdx, so divide by 2: xdx=12du.
  3. Rewrite: ∫(x2+1)5xdx= ∫u5⋅12du= 12∫u5du.
  4. Integrate: 12⋅u66= u612.
  5. Substitute back: (x2+1)612+C.
  6. Check by differentiating: 6(x2+1)5⋅2x12= x(x2+1)5. ✓

Answer: (x2+1)612+C

Worked example: A linear inside function

Find ∫cos⁡(3x)dx.

  1. u=3x, so du=3dx and dx=13du.
  2. ∫cos⁡u⋅13du= 13sin⁡u.
  3. Substitute back: 13sin⁡(3x)+C.

Answer: 13sin⁡(3x)+C

Tip

The pattern in the last example is worth remembering: when the inside is ax+b, the integral is the usual one divided by a. For example ∫e5xdx= 15e5x+C.

How do you choose u?

Look for a piece of the integrand whose derivative also appears (up to a constant number). These patterns cover most problems:

Integrand looks likeChoose u=Example
(inside)n times the inside's derivativethe inside∫x2(x3+5)4dx: u=x3+5
inside times the inside's derivativethe inside∫xx2+9dx: u=x2+9
einside or sin⁡(inside)the exponent or the angle∫xex2dx: u=x2
a fraction whose top is the bottom's derivativethe bottom∫2xx2+1dx: u=x2+1
ln⁡x together with 1xln⁡x∫ln⁡xxdx: u=ln⁡x
Worked example: A logarithm

Find ∫ln⁡xxdx.

  1. u=ln⁡x, so du=1xdx, which is exactly the rest of the integrand.
  2. ∫udu= u22.
  3. Substitute back: (ln⁡x)22+C.

Answer: (ln⁡x)22+C

Worked example: The integral of tan x

Find ∫tan⁡xdx.

  1. Rewrite: tan⁡x= sin⁡xcos⁡x. The top is (minus) the derivative of the bottom.
  2. u=cos⁡x, so du=−sin⁡xdx, and sin⁡xdx=−du.
  3. ∫−duu= −ln⁡|u|.
  4. Substitute back: −ln⁡|cos⁡x|+C.

Answer: −ln⁡|cos⁡x|+C

Common mistake

Adjusting for a missing x. You can fix a missing constant (like the 12 in the first example), but not a missing variable. In ∫(x2+1)5dx, there's no x to go with du=2xdx, so this substitution doesn't work; multiply out instead.

How do you use u-substitution with definite integrals?

You can substitute back to x and use the original limits, but it's usually quicker to change the limits: when x=a, u=g(a), and when x=b, u=g(b). Then finish entirely in u.

Substitution in definite integrals
∫abf(g(x))g′(x)dx= ∫g(a)g(b)f(u)du
Worked example: Changing the limits

Evaluate ∫01x2(x3+ 1)4dx.

  1. u=x3+1, so du=3x2dx and x2dx=13du.
  2. New limits: x=0 gives u=03+1=1; x=1 gives u=1+1=2.
  3. ∫12u4⋅13du= 13[u55]12.
  4. = 13⋅25−155= 13⋅315= 3115.

Answer: 3115

Common mistake

Using the old limits with the new variable. If you switch to u, switch the limits too. Evaluating u515 from 0 to 1 (the x-limits) would give 115, which is wrong.

When doesn't u-substitution work?

If no choice of u makes every x disappear, substitution isn't the right tool. Products like ∫xexdx or ∫xsin⁡xdx have no inside-function pattern; they need integration by parts, which is usually taught in Calculus II. The course's Playbook helps you tell which method an integral needs.

Learn it step by step

The full lessons in the course explain this from the ground up, with graphs, worked examples, and practice problems that each have a complete worked solution.

Open the lesson

Frequently asked questions

What does u stand for in u-substitution?

Nothing special: u is just a new letter for the inside function, chosen so the integral looks simpler in terms of u.

How do I know what to pick for u?

Pick an inside function whose derivative also appears in the integrand, up to a constant factor. If after substituting some x is left over, try a different u.

Do you need to change the limits in u-substitution?

For definite integrals, either change the limits to u-values and stay in u, or substitute back to x and use the original limits. Don't mix the two.

Why do I divide by a constant in u-substitution?

When du differs from what's in the integral by a number, such as du=2xdx when you have xdx, you divide by that number. You can only do this for constants, not for expressions with x.

How can I check my answer?

Differentiate it. By the chain rule you should get back exactly the original integrand.