Math concepts

U-Substitution Examples: Choose u and Check Each Integral

November 7, 20266 min read
U-Substitution Examples: Choose u and Check Each Integral

Consider ∫2xcos⁡(x2) dx\int 2x\cos(x^2)\,dx. No basic rule integrates a product like that directly, yet the answer is short: sin⁡(x2)+C\sin(x^2)+C. Differentiate sin⁡(x2)\sin(x^2) with the chain rule and you get cos⁡(x2)⋅2x\cos(x^2)\cdot2x, the integrand. U-substitution is the method that finds such answers on purpose. It runs the chain rule backwards: spot an inner function, rename it uu, and let its derivative absorb the leftover factor.

This guide works through six u-substitution examples, from the plain case to constant factors, logarithms, definite integrals with new limits, and a substitution that needs a back-solve for xx. If the chain rule itself still feels shaky, warm up with our chain rule worked examples first; every check below depends on it.

The rule in one line

OpenStax Calculus, Volume 1, §5.5 states substitution for indefinite integrals: if u=g(x)u=g(x) and FF is an antiderivative of ff, then

∫f(g(x)) g′(x) dx=F(g(x))+C.\int f(g(x))\,g'(x)\,dx=F(g(x))+C.

In practice you write u=g(x)u=g(x) and du=g′(x) dxdu=g'(x)\,dx, rewrite the whole integral in uu, integrate, and substitute back. The test of a good choice is simple: after the rewrite, no xx may remain. If one does, either solve for it in terms of uu or choose a different uu.

How to choose u

Look for a function sitting inside another function: inside a power, under a root, in an exponent, or inside a trigonometric or logarithmic function. Then ask whether its derivative, possibly times a constant, multiplies the rest.

IntegrandInner functionIts derivativePresent?
2x(x2+1)52x(x^2+1)^5x2+1x^2+12x2xYes
xex2xe^{x^2}x2x^22x2xUp to the factor 2
ln⁡xx\frac{\ln x}{x}ln⁡x\ln x1x\frac{1}{x}Yes
ex2e^{x^2}x2x^22x2xNo, substitution fails

The last row matters. ∫ex2 dx\int e^{x^2}\,dx looks similar to the second row, but without the factor xx there is nothing for dudu to absorb, and that integral has no elementary antiderivative at all. Substitution is not a trick that always works; it works when the derivative is there.

Example 1: the derivative is already present

Find ∫2x(x2+1)5 dx\int 2x(x^2+1)^5\,dx. Let u=x2+1u=x^2+1, so du=2x dxdu=2x\,dx. The factor 2x dx2x\,dx is exactly dudu:

∫2x(x2+1)5 dx=∫u5 du=u66+C=(x2+1)66+C.\int 2x(x^2+1)^5\,dx=\int u^5\,du=\frac{u^6}{6}+C=\frac{(x^2+1)^6}{6}+C.

Check: the derivative of (x2+1)66\frac{(x^2+1)^6}{6} is (x2+1)5⋅2x(x^2+1)^5\cdot2x. Expanding (x2+1)5(x^2+1)^5 and integrating term by term would also work, but it takes far longer and invites arithmetic slips.

Example 2: a constant factor is missing

Find ∫xex2 dx\int xe^{x^2}\,dx. With u=x2u=x^2 we get du=2x dxdu=2x\,dx, but the integrand has only x dxx\,dx. Divide by two: x dx=12 dux\,dx=\frac{1}{2}\,du.

∫xex2 dx=12∫eu du=12ex2+C.\int xe^{x^2}\,dx=\frac{1}{2}\int e^{u}\,du=\frac{1}{2}e^{x^2}+C.

Moving 12\frac{1}{2} outside is allowed because it is a constant. You may not do the same with a missing variable factor: ∫ex2 dx\int e^{x^2}\,dx cannot be rescued by writing dx=du2xdx=\frac{du}{2x}, because that leaves xx inside the uu-integral.

Example 3: a logarithm as the inner function

Find ∫ln⁡xx dx\int\frac{\ln x}{x}\,dx for x>0x>0. Let u=ln⁡xu=\ln x, so du=1x dxdu=\frac{1}{x}\,dx:

∫ln⁡xx dx=∫u du=u22+C=(ln⁡x)22+C.\int\frac{\ln x}{x}\,dx=\int u\,du=\frac{u^2}{2}+C=\frac{(\ln x)^2}{2}+C.

A related standard result comes from ∫tan⁡x dx=∫sin⁡xcos⁡x dx\int\tan x\,dx=\int\frac{\sin x}{\cos x}\,dx. Let u=cos⁡xu=\cos x, so du=−sin⁡x dxdu=-\sin x\,dx and the integral becomes −∫duu=−ln⁡∣cos⁡x∣+C-\int\frac{du}{u}=-\ln\lvert\cos x\rvert+C. Watch the minus sign: it comes from the derivative of cosine, and dropping it is the usual error in this example.

Example 4: a definite integral with new limits

Evaluate ∫01x(1+x2)3 dx\int_0^1 x(1+x^2)^3\,dx. Let u=1+x2u=1+x^2, so du=2x dxdu=2x\,dx and x dx=12 dux\,dx=\frac{1}{2}\,du. Now convert the limits: when x=0x=0, u=1u=1; when x=1x=1, u=2u=2.

∫01x(1+x2)3 dx=12∫12u3 du=12[u44]12=12⋅16−14=158.\int_0^1 x(1+x^2)^3\,dx=\frac{1}{2}\int_1^2 u^3\,du=\frac{1}{2}\left[\frac{u^4}{4}\right]_1^2=\frac{1}{2}\cdot\frac{16-1}{4}=\frac{15}{8}.

Once the limits are in uu, there is no need to substitute back. OpenStax gives this as the definite-integral form of the rule: the limits change to g(a)g(a) and g(b)g(b). The classic mistake is to use the new integrand with the old limits 0 and 1, which here would give 18\frac{1}{8}, an answer off by a factor of 15.

Sanity check: the integrand rises from 0 at x=0x=0 to 8 at x=1x=1, so the area should be somewhere between 0 and 8, and likely nearer the low end because the curve is steep near the right edge. 158=1.875\frac{15}{8}=1.875 fits.

Example 5: solve for the leftover x

Find ∫xx+1 dx\int x\sqrt{x+1}\,dx. Take u=x+1u=x+1, so du=dxdu=dx. One xx remains outside the root. Solve the substitution for it: x=u−1x=u-1.

∫xx+1 dx=∫(u−1)u1/2 du=∫(u3/2−u1/2)du=25(x+1)5/2−23(x+1)3/2+C.\int x\sqrt{x+1}\,dx=\int(u-1)u^{1/2}\,du=\int\left(u^{3/2}-u^{1/2}\right)du=\frac{2}{5}(x+1)^{5/2}-\frac{2}{3}(x+1)^{3/2}+C.

This back-solve is legitimate because u=x+1u=x+1 is easy to invert. When a remaining xx cannot be expressed in uu neatly, the substitution is probably the wrong one.

Example 6: when substitution is the wrong tool

Try ∫xex dx\int xe^{x}\,dx. The obvious candidate u=xu=x changes nothing, and u=exu=e^x leaves x=ln⁡ux=\ln u inside, turning the problem into ∫ln⁡u du\int\ln u\,du, which needs another method anyway. This product has no inner function with its derivative alongside. It is a case for integration by parts, where one factor gets simpler when differentiated.

A useful habit: spend at most a minute testing one or two choices of uu. If none makes the xx disappear, switch tools rather than forcing it.

Mistakes to avoid

  • Forgetting du. Writing u=x2u=x^2 and then replacing only the inner function leaves dxdx in an integral over uu. Every dxdx must become a multiple of dudu.
  • Dividing by a variable. Only constant factors can be moved outside the integral.
  • Old limits on a new integral. Convert both limits, or go back to xx before evaluating.
  • Leaving the answer in u. For an indefinite integral, substitute back so the answer is a function of xx, and keep the +C+C.
  • Skipping the check. Differentiating the answer takes seconds and catches nearly every slip with signs and constants.

Practice problems with answers

  1. ∫3x2(x3−4)4 dx\int 3x^2(x^3-4)^4\,dx. Let u=x3−4u=x^3-4. Answer: (x3−4)55+C\frac{(x^3-4)^5}{5}+C.
  2. ∫sin⁡2xcos⁡x dx\int\sin^2x\cos x\,dx. Let u=sin⁡xu=\sin x. Answer: sin⁡3x3+C\frac{\sin^3x}{3}+C.
  3. ∫e3x dx\int e^{3x}\,dx. Let u=3xu=3x, so dx=13 dudx=\frac{1}{3}\,du. Answer: e3x3+C\frac{e^{3x}}{3}+C.
  4. ∫1eln⁡xx dx\int_1^{e}\frac{\ln x}{x}\,dx. Let u=ln⁡xu=\ln x, with limits 0 and 1. Answer: 12\frac{1}{2}.

Substitution is the first technique to try on almost any integral, which is why our integrals guide calls it the workhorse of the chapter. Name the inner function, check that its derivative is there, convert everything including the limits, and differentiate the result before moving on.

Common Questions

How do I choose u in u-substitution?
Look for an inner function whose derivative also appears in the integrand, at least up to a constant factor. In 2x(x² + 1)^5 the inner function is x² + 1 and its derivative 2x is sitting outside, so u = x² + 1 is the natural choice.
What if the derivative is off by a constant?
A constant factor is fine. If u = x² then du = 2x dx, so x dx = du/2 and the 1/2 moves in front of the integral. Only constants can be moved this way; a missing factor of x cannot be fixed by dividing.
Do I have to change the limits on a definite integral?
Either change the limits to u-values and never return to x, or find the antiderivative in x first and use the original limits. Mixing the two, new integrand with old limits, is the most common error.
How can I check a u-substitution answer?
Differentiate your result with the chain rule. You should get back the original integrand exactly. For a definite integral, a quick numerical estimate also catches a wrong sign or a missing factor.