Math Solver Free

Calculus

U-Substitution Step by Step: How to Choose u, With Examples

Math Solver Free Team

Student working through u-substitution steps on paper, choosing u and rewriting an integral in the new variable

U-substitution is the chain rule run in reverse: if an integrand contains a composite function together with (a constant multiple of) its inside derivative, set u equal to the inside, rewrite the whole integral in u, and integrate the simpler result. One-line summary: spot the inside function whose derivative is also present, and let u be that inside. Headline example: ∫2x·cos(x²) dx = sin(x²) + C, because u = x² has du = 2x dx sitting right beside it. This guide gives a reliable way to choose u, works three examples step by step — including a definite integral where the limits change — and ends with the mistakes that quietly invalidate otherwise good work. Every result below was verified symbolically, and the definite integral also by direct numerical integration.

How to choose u: the inside whose derivative is present

U-substitution works when the integrand has two linked pieces: a composite function, and outside it a factor that is the derivative of its inside (or a constant multiple of that derivative). So choose u as the inside of the composite: the expression inside the sine, under the root, in the exponent, or raised to the power. In ∫2x·cos(x²) dx the composite is cos(x²), the inside is x², and its derivative 2x is literally a factor of the integrand — a perfect match. In ∫3x²(x³ + 1)⁴ dx the inside x³ + 1 has derivative 3x², again present word for word. Constant multiples are fine and fixable: in ∫x·e^(x²) dx the derivative of x² is 2x, and the integrand has only x — a missing factor of 2, which is a constant, so the substitution still works after dividing by 2. What cannot be fixed is a leftover variable: if, after rewriting, an x survives in the u-integral, the chosen u was wrong or the method does not apply. Other strong candidates for u: the denominator of a fraction (its derivative often supplies the numerator), the expression inside a logarithm, and the exponent of e. If no choice of u clears the x's, the integral usually belongs to integration by parts instead. Both tools below follow this page's method: the integral calculator for antiderivatives in general, and the substitution calculator for this technique specifically.

The five steps

  1. Choose u — the inside of the composite whose derivative is present as a factor.
  2. Compute du — differentiate u: du = u′(x) dx. This is a statement about differentials, and it is what lets you trade dx for du.
  3. Rewrite everything in u — substitute u for the inside and du for u′(x) dx. No x and no dx may remain; if one does, adjust by a constant or rethink u.
  4. Integrate in u — the rewritten integral should be a basic power, exponential, trig or log form.
  5. Back-substitute and add C — replace u with the original expression and append the constant of integration. For definite integrals, either change the limits in step 3 (then do not back-substitute) or back-substitute first and use the original limits — never mix the two.

Worked example 1: ∫2x·cos(x²) dx = sin(x²) + C

Choose u = x² (the inside of the cosine). Then du = 2x dx — and 2x dx is exactly the rest of the integrand. Rewrite: ∫cos(u) du. Integrate: sin(u). Back-substitute: sin(x²) + C. Verify by differentiating the answer, which is the universal check for any antiderivative: d/dx sin(x²) = 2x·cos(x²) by the chain rule — the integrand itself. That closing of the loop is not a coincidence; u-substitution is precisely the chain rule read backwards, so every u-substitution answer can be audited by one chain-rule differentiation. If your check produces anything else, the error is in the rewrite step, almost always a mishandled du.

Worked example 2: ∫x·e^(x²) dx = (1/2)e^(x²) + C

Choose u = x² (the exponent). Then du = 2x dx, so x dx = du/2 — the integrand supplies x dx, and the missing 2 is a constant, which is allowed to move. Rewrite: ∫e^u · (du/2) = (1/2)∫e^u du. Integrate: (1/2)e^u. Back-substitute: (1/2)e^(x²) + C. Differentiate to verify: d/dx [(1/2)e^(x²)] = (1/2)·e^(x²)·2x = x·e^(x²) ✓. The lesson generalises: constants can be created, moved and divided freely during a substitution; variables cannot. If the integrand had been ∫x²·e^(x²) dx, the rewrite would leave a stray x = √u behind, and no constant adjustment could save it — that integral needs a different technique entirely (and, in fact, has no elementary antiderivative in finite terms when paired differently; with x² it fails the u-substitution test on sight). Train your eye on the test, not the hope: after the rewrite, count the x's. Zero is success.

Worked example 3 (definite): ∫₀¹ 3x²(x³ + 1)⁴ dx = 31/5

Choose u = x³ + 1 (the inside of the fourth power). Then du = 3x² dx — present exactly. Now the step that defines definite u-substitution: change the limits to u-values. When x = 0, u = 0³ + 1 = 1. When x = 1, u = 1³ + 1 = 2. The integral becomes ∫₁² u⁴ du. Integrate: [u⁵/5]₁² = 32/5 − 1/5 = 31/5 = 6.2. Done — with changed limits there is no back-substitution; the u-antiderivative is evaluated at u-limits. Direct numerical integration of the original integrand agrees: ≈ 6.2000. The alternative route — back-substitute to [(x³ + 1)⁵/5] and evaluate at the original x-limits 0 and 1 — gives (32/5) − (1/5) = 31/5 as well, as it must. Both routes are legal; mixing them (u-antiderivative, x-limits) is the classic definite-integral error, and it produces confidently wrong numbers like 1/5 or 31/5's near neighbours.

Common mistakes

  • Forgetting to rewrite dx. Substituting u but leaving dx in place. dx is not decoration: it must be traded for du/u′(x) through the du equation, or the integral is meaningless.
  • Not changing the limits on a definite integral — or changing them and back-substituting anyway. Pick one route: new limits with the u-antiderivative, or original limits after back-substitution.
  • Accepting a leftover x. If an x survives the rewrite and it is not a constant, the substitution has failed. Stop and choose a different u, or switch methods — do not integrate a mixed x-and-u expression.
  • Dropping + C on indefinite integrals, and inventing one on definite integrals (where the constant cancels and must not appear).
  • Choosing u as the whole integrand or the outer function. u is the inside; choosing u = cos(x²) in example 1 gives du = −2x·sin(x²) dx, which matches nothing and strands the work.

Once an integral is reduced to a single-variable antiderivative in u, the same machinery stacks: iterated substitutions inside improper integrals are handled by first making the integral proper with a limit, then substituting. The reference treatment is OpenStax Calculus Volume 1, §5.5 (Substitution), free online.

Frequently asked questions

How do I choose u in u-substitution?

Pick the inside of a composite function whose derivative also appears as a factor of the integrand — exactly, or up to a constant multiple. The inside of a sine, root, power or exponent is the usual candidate.

What do I do with dx?

Trade it using du: if du = u′(x) dx, then the factor u′(x) dx in the integrand is replaced by du. An integral is fully rewritten only when no x and no dx remain.

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

Only if you keep the antiderivative in u: then convert both limits with u = u(x). Alternatively back-substitute first and keep the original x-limits. Mixing u-antiderivatives with x-limits is wrong.

What is ∫2x·cos(x²) dx?

sin(x²) + C, with u = x² and du = 2x dx. Differentiating the answer returns the integrand, confirming it.

What if an x is left over after substituting?

The substitution failed: constants can be adjusted, variables cannot. Choose a different u or switch to another method such as integration by parts.

About the Math Solver Team

The Math Solver Team builds and maintains the calculators and step-by-step solvers on this site. Every tool is checked against worked textbook examples before it is published, and the method behind each solver is written out in full — in the worked examples on the page and in our guides — so you can see exactly how an answer is reached, not just the answer itself.

How we build and test our tools·More about the team