CalcDrillFree guides

Calc 1 · Calc 2 · Integrals

U-substitution practice problems with answers

About 20 min read · Spot a mistake? Tell us

U-substitution is how you undo the chain rule. Once you can spot the inside function and its derivative, most of these integrals take three lines. This page shows you how to pick u, walks through a six-step routine, works six examples line by line (including tan x, e3x, 1/(2x + 5) and a definite integral done two ways), then gives you 14 practice problems that check your answers as you go.

Why u-substitution works: the chain rule in reverse

The chain rule says the derivative of f(g(x)) is f′(g(x)) · g′(x): the outside derivative, times the derivative of the inside. So whenever an integral looks like (something of the inside) × (the inside’s derivative), it is a chain-rule derivative waiting to be undone.

The same fact read in two directions
Chain rule (differentiate)u-substitution (integrate)
d/dx sin(x²) = cos(x²) · 2x∫ cos(x²) · 2x dx = sin(x²) + C
d/dx e3x = e3x · 3∫ e3x · 3 dx = e3x + C
d/dx (x² + 1)⁶ = 6(x² + 1)⁵ · 2x∫ 6(x² + 1)⁵ · 2x dx = (x² + 1)⁶ + C
d/dx ln(x² + 1) = 2x / (x² + 1)∫ 2x / (x² + 1) dx = ln(x² + 1) + C

Writing u = g(x) and du = g′(x) dx is just bookkeeping that makes the pattern easy to see: ∫ f(g(x)) g′(x) dx becomes ∫ f(u) du. If you want the forward direction first, the chain rule practice problems guide gives you practice with it.

How to choose u

Pick an inside function whose derivative also appears in the integral, up to a constant multiple. The constant doesn’t matter, because you can always multiply and divide by a number. A missing x does matter.

Ask these three questions, in this order:

  1. What is inside something? The base of a power, the stuff under a root, the exponent on e, the input to sin/cos/tan, or a whole denominator.
  2. Is its derivative (or a number times it) sitting elsewhere in the integral? If yes, that’s your u.
  3. After substituting, is every x gone? If an x is left, either solve u = g(x) for x (see Example 5) or try a different u.
Patterns you will see over and over
If you see…Try u =Because du =
x · (x² + 1)ⁿx² + 12x dx
x² · √(x³ − 4)x³ − 43x² dx
ekx or x · ex²kx, or x²k dx, or 2x dx
(ln x)ⁿ / xln x(1/x) dx
sinⁿx · cos xsin xcos x dx
tanⁿx · sec²xtan xsec²x dx
g′(x) / g(x), like 2x/(x² + 5)the denominator g(x)g′(x) dx (answer is a log)

The routine, step by step

  1. Pick u. Usually the inside function.
  2. Find du. Differentiate: du = g′(x) dx.
  3. Rewrite fully in u. Every x and the dx must go. Solve for dx or for x if you need to.
  4. Integrate in u. It should now be a basic integral.
  5. Back-substitute. Replace u with g(x). (Definite integral? See below.)
  6. Add + C and check. Differentiate your answer. You should get the integrand back.

Fixing constant multiples

Most integrals don’t contain du exactly; they contain a number times it. Solve du for the piece you have. In ∫ x³ cos(x⁴) dx, u = x⁴ gives du = 4x³ dx, but the integral has x³ dx, not 4x³ dx. So x³ dx = (1/4) du:

∫ x³ cos(x⁴) dx = (1/4) ∫ cos u du = (1/4) sin(x⁴) + C.

This only works for constants. You can divide by 4. You can’t divide by x to “fix” a missing x, because x is not a constant (Problem 13 below is exactly that mistake).

Worked examples

Each example follows the same six steps, so you can see where every line comes from.

Example 1: a power of a polynomial

∫ x(x² + 1)⁵ dx

Pick u
u = x² + 1, the inside of the power.
Find du
du = 2x dx, so x dx = (1/2) du.
Rewrite
∫ u⁵ · (1/2) du = (1/2) ∫ u⁵ du
Integrate
(1/2) · u⁶/6 = u⁶/12
Back-substitute
(x² + 1)⁶ / 12
Check
d/dx [(x² + 1)⁶/12] = 6(x² + 1)⁵ · 2x / 12 = x(x² + 1)⁵. ✓

Answer: (x² + 1)⁶ / 12 + C

Example 2: trig — the integral of tan x

∫ tan x dx

Rewrite first
tan x = sin x / cos x. Now there is an inside (cos x) with its derivative (−sin x) on top.
Pick u
u = cos x
Find du
du = −sin x dx, so sin x dx = −du.
Rewrite
∫ (1/u)(−du) = −∫ du/u
Integrate
−ln|u|
Back-substitute
−ln|cos x|, which is the same as ln|sec x|
Check
d/dx [−ln|cos x|] = −(−sin x)/cos x = tan x. ✓

Answer: −ln|cos x| + C = ln|sec x| + C

Keep the absolute value: cos x is negative on part of the domain, and ln only takes positive inputs.

Example 3: exponential

∫ e3x dx

Pick u
u = 3x, the exponent.
Find du
du = 3 dx, so dx = (1/3) du.
Rewrite
(1/3) ∫ eᵘ du
Integrate
(1/3) eᵘ
Back-substitute
(1/3) e3x
Check
d/dx [(1/3) e3x] = (1/3) · 3e3x = e3x. ✓

Answer: (1/3) e3x + C

Shortcut once you trust it: ∫ ekx dx = (1/k) ekx + C for any constant k ≠ 0.

Example 4: a log answer

∫ 1 / (2x + 5) dx

Pick u
u = 2x + 5, the denominator.
Find du
du = 2 dx, so dx = (1/2) du.
Rewrite
(1/2) ∫ du/u
Integrate
(1/2) ln|u|
Back-substitute
(1/2) ln|2x + 5|
Check
d/dx [(1/2) ln|2x + 5|] = (1/2) · 2/(2x + 5) = 1/(2x + 5). ✓

Answer: (1/2) ln|2x + 5| + C

A common slip is writing ln|2x + 5| with no 1/2. Differentiating catches it right away: you would get 2/(2x + 5).

Example 5: harder — solve for x in terms of u

∫ x√(x + 1) dx

Pick u
u = x + 1, the inside of the root.
Find du
du = dx. But there is still an x out front.
Solve for x
From u = x + 1, x = u − 1.
Rewrite
∫ (u − 1) u^(1/2) du = ∫ (u^(3/2) − u^(1/2)) du
Integrate
(2/5) u^(5/2) − (2/3) u^(3/2)
Back-substitute
(2/5)(x + 1)^(5/2) − (2/3)(x + 1)^(3/2)
Check
Derivative: (x + 1)^(3/2) − (x + 1)^(1/2) = (x + 1)^(1/2) · [(x + 1) − 1] = x√(x + 1). ✓

Answer: (2/5)(x + 1)^(5/2) − (2/3)(x + 1)^(3/2) + C

Here the derivative of the inside (1) doesn’t “use up” the x. Solving u = x + 1 for x gets rid of it instead. This trick shows up a lot on Calc 1 finals.

Example 6: a definite integral, with the limits changed

∫0π/2 sin x cos²x dx

Pick u
u = cos x
Find du
du = −sin x dx, so sin x dx = −du.
New limits
x = 0 gives u = cos 0 = 1. x = π/2 gives u = cos(π/2) = 0.
Rewrite
−∫10 u² du = ∫01 u² du (flipping the limits cancels the minus sign)
Integrate
[u³/3] from 0 to 1 = 1/3
Check
Numerically, ∫0π/2 sin x cos²x dx ≈ 0.3333. ✓

Answer: 1/3

It’s fine for the new lower limit to be bigger than the upper one. Either keep it and integrate, or flip the limits and change the sign, as done here.

Definite integrals: change the limits or back-substitute

For a definite integral you have two correct options. Here they are side by side on ∫01 x(x² + 1)⁵ dx, using Example 1.

Option A: change the limits

  1. u = x² + 1, x dx = (1/2) du.
  2. x = 0 → u = 1. x = 1 → u = 2.
  3. (1/2) ∫12 u⁵ du = (1/2)[u⁶/6] from 1 to 2
  4. = (64 − 1)/12 = 63/12 = 21/4 = 5.25

You never go back to x.

Option B: back-substitute, then use the x limits

  1. Find the antiderivative first: (x² + 1)⁶ / 12.
  2. Use the original limits, 0 and 1.
  3. (2⁶ − 1⁶)/12 = 63/12
  4. = 21/4 = 5.25

Same number, with one more step.

The mistake to avoid: using the x limits on the u antiderivative. Here that would be (1/2)[u⁶/6] from 0 to 1 = 1/12, which is wrong. If you write the integral with du, write u limits on it in the same line.

When u-substitution fails (and what to do)

U-substitution needs the derivative of the inside to be in the integral already. Sometimes it isn’t:

  • ∫ x eˣ dx and ∫ x cos x dx: x is not the derivative of anything inside eˣ or cos x. Every u choice leaves an x behind. These are products of two unrelated functions, so use integration by parts: ∫ x eˣ dx = (x − 1)eˣ + C and ∫ x cos x dx = x sin x + cos x + C.
  • ∫ cos(x²) dx or ∫ ex² dx: no x to pair with du = 2x dx, and no other method gives an elementary answer either. If one shows up on a test, it is usually a definite integral you estimate numerically.
  • √(1 − x²)-type roots with nothing outside: a Calc 2 job for trig substitution.

Rule of thumb: try u-substitution first, because it’s quick. If an x won’t go away, switch methods. The Calculus 2 final exam review has a “which technique?” sorter for exactly this choice.

Checking an answer by differentiating

Integration answers are hard to check by eye, but derivatives are easy. Differentiate your answer with the chain rule and compare it to the integrand. In Example 4, d/dx [(1/2) ln|2x + 5|] = (1/2) · 2/(2x + 5), which is exactly 1/(2x + 5). Being off by a constant factor (like 2 or 1/3) almost always means a constant was dropped in the du step. Getting a leftover x means the substitution never fully happened.

Common traps

  • Leftover x. If x and u both appear in the integral, you aren’t done rewriting. Solve u = g(x) for x, or choose a different u. Never pull an x out as if it were a constant.
  • Forgetting to change the limits. Once the integral is in u, the limits must be u values too (Option A), or you go back to x before plugging in (Option B).
  • Dropping the constant. du = 3x² dx means x² dx = (1/3) du. Lose the 1/3 and your answer is 3 times too big.
  • Dropping + C. Every indefinite integral needs + C. Many graders take points off without it.
  • Forgetting the absolute value in ln|u|. You can drop it only when u is always positive, like x² + 9.
  • Choosing the outside instead of the inside. In ∫ x² cos(x³) dx, u = cos(x³) gives a du with sin in it, which you don’t have.

Practice problems with answers

Fourteen problems: choose the best u, pick the right antiderivative, type the value of a definite integral, and spot the mistake in a student’s work. Every answer was checked by differentiating and by numerical integration. Use Tab to move, arrow keys to choose an option, and Enter to check. Wrong answers get a specific hint, and you can try again as many times as you like.

Problem 1 · Choose u
What is the best choice of u for ∫ x² cos(x³) dx?

Worked solution
  1. u = x³, du = 3x² dx, so x² dx = (1/3) du.
  2. ∫ x² cos(x³) dx = (1/3) ∫ cos u du = (1/3) sin u + C.
  3. Answer: (1/3) sin(x³) + C. Check: d/dx [(1/3) sin(x³)] = (1/3) cos(x³) · 3x² = x² cos(x³).
Problem 2 · Choose u
What is the best choice of u for ∫ (ln x)⁴ / x dx?

Worked solution
  1. u = ln x, du = (1/x) dx.
  2. ∫ (ln x)⁴ / x dx = ∫ u⁴ du = u⁵/5 + C.
  3. Answer: (ln x)⁵/5 + C. Check: d/dx [(ln x)⁵/5] = (ln x)⁴ · (1/x).
Problem 3 · Choose u
What is the best choice of u for ∫ sec²x · tan³x dx?

Worked solution
  1. u = tan x, du = sec²x dx.
  2. ∫ tan³x sec²x dx = ∫ u³ du = u⁴/4 + C.
  3. Answer: tan⁴x / 4 + C. Check: d/dx [tan⁴x / 4] = tan³x · sec²x.
Problem 4 · Pick the antiderivative
Which of these is ∫ 6x²(x³ + 2)⁴ dx?

Worked solution
  1. u = x³ + 2, du = 3x² dx, so 6x² dx = 2 du.
  2. ∫ 6x²(x³ + 2)⁴ dx = 2 ∫ u⁴ du = (2/5) u⁵ + C.
  3. Answer: (2/5)(x³ + 2)⁵ + C. Check: (2/5) · 5(x³ + 2)⁴ · 3x² = 6x²(x³ + 2)⁴.
Problem 5 · Pick the antiderivative
Which of these is ∫ cos(5x) dx?

Worked solution
  1. u = 5x, du = 5 dx, so dx = (1/5) du.
  2. ∫ cos(5x) dx = (1/5) ∫ cos u du = (1/5) sin u + C.
  3. Answer: (1/5) sin(5x) + C.
Problem 6 · Pick the antiderivative
Which of these is ∫ x / (x² + 9) dx?

Worked solution
  1. u = x² + 9, du = 2x dx, so x dx = (1/2) du.
  2. ∫ x/(x² + 9) dx = (1/2) ∫ (1/u) du = (1/2) ln|u| + C.
  3. Answer: (1/2) ln(x² + 9) + C.
Problem 7 · Definite integral

Find ∫01 2x(x² + 1)³ dx. Change the limits to u.

Enter a decimal (like 0.25) or a fraction (like 1/4). Answers within 0.01 count.

Worked solution
  1. u = x² + 1, du = 2x dx.
  2. New limits: x = 0 gives u = 1; x = 1 gives u = 2.
  3. ∫12 u³ du = [u⁴/4] from 1 to 2 = 16/4 − 1/4 = 15/4.
  4. Answer: 15/4 = 3.75.
Problem 8 · Definite integral

Find ∫1e (ln x)/x dx.

Enter a decimal (like 0.25) or a fraction (like 1/4). Answers within 0.01 count.

Worked solution
  1. u = ln x, du = (1/x) dx.
  2. New limits: x = 1 gives u = ln 1 = 0; x = e gives u = ln e = 1.
  3. ∫01 u du = [u²/2] from 0 to 1 = 1/2.
  4. Answer: 1/2 = 0.5.
Problem 9 · Definite integral

Find ∫0√π x sin(x²) dx.

Enter a decimal (like 0.25) or a fraction (like 1/4). Answers within 0.01 count.

Worked solution
  1. u = x², du = 2x dx, so x dx = (1/2) du.
  2. New limits: x = 0 gives u = 0; x = √π gives u = π.
  3. (1/2) ∫0π sin u du = (1/2)[−cos u] from 0 to π = (1/2)(1 + 1) = 1.
  4. Answer: 1.
Problem 10 · Change the limits
You set u = x² in ∫02 x e^(x²) dx. Which integral in u is correct?

Worked solution
  1. u = x², du = 2x dx, so x dx = (1/2) du.
  2. x = 0 gives u = 0; x = 2 gives u = 4.
  3. (1/2) ∫04 eᵘ du = (1/2)(e⁴ − 1) ≈ 26.80.
Problem 11 · Harder: solve for x

Find ∫03 x√(x + 1) dx. You can enter a fraction like 7/3.

Enter a decimal (like 0.25) or a fraction (like 1/4). Answers within 0.01 count.

Worked solution
  1. u = x + 1, so du = dx and x = u − 1.
  2. New limits: x = 0 gives u = 1; x = 3 gives u = 4.
  3. ∫14 (u − 1)u^(1/2) du = ∫14 (u^(3/2) − u^(1/2)) du.
  4. = [(2/5)u^(5/2) − (2/3)u^(3/2)] from 1 to 4 = (2/5)(32 − 1) − (2/3)(8 − 1) = 62/5 − 14/3.
  5. Answer: 116/15 ≈ 7.733.
Problem 12 · Spot the mistake
A student wrote this. Which step is wrong?

∫01 3x²(x³ + 1)² dx

  1. Let u = x³ + 1, so du = 3x² dx.
  2. The integral becomes ∫01 u² du.
  3. ∫ u² du = u³/3.
  4. [u³/3] from 0 to 1 = 1/3.

Worked solution
  1. Steps 1 and 3 are fine. Step 2 kept the x limits 0 and 1.
  2. New limits: u(0) = 1 and u(1) = 2.
  3. ∫12 u² du = [u³/3] from 1 to 2 = 8/3 − 1/3 = 7/3 ≈ 2.333.
Problem 13 · Spot the mistake
A student wrote this. What went wrong?

∫ cos(x²) dx

  1. Let u = x², so du = 2x dx and dx = du/(2x).
  2. The integral becomes ∫ cos u · du/(2x).
  3. Pull 1/(2x) out: (1/(2x)) ∫ cos u du = sin(x²)/(2x) + C.

Worked solution
  1. After you substitute, the integral must contain only u and du. Step 2 still has an x.
  2. You can't move 1/(2x) outside the integral, because x is not a constant.
  3. Check by differentiating: d/dx [sin(x²)/(2x)] = cos(x²) − sin(x²)/(2x²), which is not cos(x²).
  4. Compare ∫ x cos(x²) dx: here the x cancels the 2x, and the answer is (1/2) sin(x²) + C.
Problem 14 · u-sub or parts?
Which one of these needs integration by parts instead of u-substitution?

Worked solution
  1. Three of the four have an inside function whose derivative is the other factor: x² with x, and sin x with cos x.
  2. ∫ x cos x dx does not: the inside of cos x is just x. Use integration by parts.
  3. u = x, dv = cos x dx: ∫ x cos x dx = x sin x − ∫ sin x dx = x sin x + cos x + C.

FAQ

What is u-substitution in calculus?

U-substitution is the chain rule run backwards. If an integral has the form f(g(x)) · g′(x), you let u = g(x), so du = g′(x) dx, and the integral becomes ∫ f(u) du, which is usually a basic integral. At the end you put g(x) back in for u.

How do I know what to pick for u?

Look for an inside function whose derivative also shows up in the integral, up to a constant multiple. Good first guesses are the inside of a power or a root, the exponent of e, the input of a trig function, or the denominator of a fraction. If du does not match what is left over, try a different u.

Do I have to change the limits on a definite integral?

If you keep the answer in terms of u, yes: plug the old x limits into u = g(x) to get the new limits. The other option is to find the antiderivative, substitute back to x, and use the original limits. Both give the same number. The one thing you cannot do is mix them, using x limits on a u antiderivative.

What if there is still an x left after I substitute?

Solve u = g(x) for x and replace the leftover x. For ∫ x√(x + 1) dx with u = x + 1, the leftover x becomes u − 1. If you cannot get rid of the x, that u does not work, and you need a different u or a different method such as integration by parts.

When should I use integration by parts instead of u-substitution?

Use integration by parts when the integral is a product of two unrelated functions and neither one is the derivative of the inside of the other, like ∫ x eˣ dx or ∫ x cos x dx. If one factor is the derivative of an inside function, u-substitution is usually faster.

How can I check my u-substitution answer?

Differentiate your answer. The chain rule should give back the original integrand exactly. If you are off by a constant factor, you probably dropped a constant when you solved for dx or for x dx.

Keep practicing

Try 3 days free

3 days free, no card needed.

Sources

Methods and examples were checked against these free textbooks. Antiderivatives were checked by differentiating; definite values were checked by numerical integration.