Skip to content
Family Table Math
Auto

Integration by Substitution

The basic rules handle sums of powers, exponentials, and trig functions. But what about ∫2x(x2+3)5 dx\int 2x(x^2 + 3)^5\,dx or ∫x2cos⁡(x3) dx\int x^2\cos(x^3)\,dx? These came from the chain rule, and substitution (often called u-substitution) is the chain rule run backwards. It’s the single most useful integration technique in a first calculus course (AP Calculus AB or IB).

The chain rule says ddxF(g(x))=F′(g(x)) g′(x)\dfrac{d}{dx}F\big(g(x)\big) = F'\big(g(x)\big)\,g'(x). Reading that backwards:

∫f(g(x)) g′(x) dx=F(g(x))+C,where F′=f.\int f\big(g(x)\big)\,g'(x)\,dx = F\big(g(x)\big) + C, \quad \text{where } F' = f.

Look for an “inside function” g(x)g(x) whose derivative g′(x)g'(x) also appears as a factor.

  1. Choose uu: usually the inside of a power, a root, an exponential, a trig function, or a denominator.
  2. Find dudu: du=u′(x) dxdu = u'(x)\,dx.
  3. Rewrite the whole integral in terms of uu and dudu. No xx may be left over.
  4. Integrate with respect to uu.
  5. Substitute back so the answer is in terms of xx.

If dudu is off by a constant factor, that’s fine: solve for dxdx or multiply and divide by the constant. For example, with u=x3u = x^3, du=3x2 dxdu = 3x^2\,dx, so x2 dx=13 dux^2\,dx = \tfrac{1}{3}\,du.

You can only fix constants this way. If a variable is missing, a different uu or a different method is needed.

For a definite integral, you can change the limits to uu-values when you substitute:

∫abf(g(x)) g′(x) dx=∫g(a)g(b)f(u) du.\int_a^b f\big(g(x)\big)\,g'(x)\,dx = \int_{g(a)}^{g(b)} f(u)\,du .

Then evaluate in terms of uu and never go back to xx. (Or substitute back to xx and use the original limits. Just don’t mix the two.)

When you meet a new integral, ask in this order:

  1. Is it a basic rule? Use the table from indefinite integrals.
  2. Can algebra make it basic? Expand, split a fraction with a one-term denominator, or rewrite roots as powers.
  3. Is there an inside function whose derivative is (nearly) there? Use substitution.
  4. Is it a rational function with a polynomial on top that’s too big, or a quadratic on the bottom? Use long division or completing the square.

Find ∫2x(x2+3)5 dx\displaystyle\int 2x(x^2 + 3)^5\,dx.

Solution. The inside of the power is x2+3x^2 + 3, and its derivative 2x2x is right there. Let u=x2+3u = x^2 + 3, so du=2x dxdu = 2x\,dx:

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

Check: ddx(x2+3)66=6(x2+3)5⋅2x6=2x(x2+3)5\dfrac{d}{dx}\dfrac{(x^2 + 3)^6}{6} = \dfrac{6(x^2 + 3)^5 \cdot 2x}{6} = 2x(x^2 + 3)^5. ✓

Find (a) ∫x2cos⁡(x3) dx\displaystyle\int x^2\cos(x^3)\,dx and (b) ∫e5x dx\displaystyle\int e^{5x}\,dx.

Solution.

(a) Let u=x3u = x^3, so du=3x2 dxdu = 3x^2\,dx and x2 dx=13 dux^2\,dx = \tfrac{1}{3}\,du:

∫x2cos⁡(x3) dx=13∫cos⁡u du=13sin⁡u+C=13sin⁡(x3)+C\int x^2\cos(x^3)\,dx = \frac{1}{3}\int \cos u\,du = \frac{1}{3}\sin u + C = \frac{1}{3}\sin(x^3) + C

(b) Let u=5xu = 5x, so dx=15 dudx = \tfrac{1}{5}\,du:

∫e5x dx=15∫eu du=15e5x+C\int e^{5x}\,dx = \frac{1}{5}\int e^u\,du = \frac{1}{5}e^{5x} + C

A handy shortcut: for a linear inside function ax+bax + b, just divide by aa. For example, ∫cos⁡(4x) dx=14sin⁡(4x)+C\int \cos(4x)\,dx = \tfrac{1}{4}\sin(4x) + C.

Find (a) ∫xx2+1 dx\displaystyle\int \frac{x}{x^2 + 1}\,dx and (b) ∫tan⁡x dx\displaystyle\int \tan x\,dx.

Solution.

(a) Let u=x2+1u = x^2 + 1, so du=2x dxdu = 2x\,dx and x dx=12 dux\,dx = \tfrac{1}{2}\,du:

∫xx2+1 dx=12∫1u du=12ln⁡∣u∣+C=12ln⁡(x2+1)+C\int \frac{x}{x^2 + 1}\,dx = \frac{1}{2}\int \frac{1}{u}\,du = \frac{1}{2}\ln|u| + C = \frac{1}{2}\ln(x^2 + 1) + C

(No absolute value is needed at the end because x2+1x^2 + 1 is always positive.)

(b) Write tan⁡x=sin⁡xcos⁡x\tan x = \dfrac{\sin x}{\cos x}. Let u=cos⁡xu = \cos x, so du=−sin⁡x dxdu = -\sin x\,dx:

∫sin⁡xcos⁡x dx=−∫1u du=−ln⁡∣u∣+C=−ln⁡∣cos⁡x∣+C\int \frac{\sin x}{\cos x}\,dx = -\int \frac{1}{u}\,du = -\ln|u| + C = -\ln|\cos x| + C

Whenever the numerator is (a constant times) the derivative of the denominator, the answer is a logarithm.

Example 4: A definite integral, changing the limits

Section titled “Example 4: A definite integral, changing the limits”

Evaluate ∫02xx2+5 dx\displaystyle\int_0^2 \frac{x}{\sqrt{x^2 + 5}}\,dx.

Solution. Let u=x2+5u = x^2 + 5, so x dx=12 dux\,dx = \tfrac{1}{2}\,du. Change the limits:

  • when x=0x = 0, u=5u = 5;
  • when x=2x = 2, u=9u = 9.
∫02xx2+5 dx=12∫59u−1/2 du=12[2u1/2]59=[u]59=3−5\begin{aligned} \int_0^2 \frac{x}{\sqrt{x^2 + 5}}\,dx &= \frac{1}{2}\int_5^9 u^{-1/2}\,du \\ &= \frac{1}{2}\Big[2u^{1/2}\Big]_5^9 \\ &= \Big[\sqrt{u}\Big]_5^9 = 3 - \sqrt{5} \end{aligned}

Leaving some x behind. After substituting, the integral must be entirely in uu. If you have ∫u5⋅x du\int u^5 \cdot x\,du, the substitution isn’t finished (or it’s the wrong uu).

Dropping the du (or the dx). du=2x dxdu = 2x\,dx tells you what to replace. Writing it out keeps your constants right.

Fixing a missing variable as if it were a constant. In ∫cos⁡(x3) dx\int \cos(x^3)\,dx, the x2x^2 from du=3x2 dxdu = 3x^2\,dx is missing. You can’t just divide by 3x23x^2. (In fact, this integral has no elementary antiderivative.)

Using the old limits with u. In Example 4, writing 12∫02u−1/2 du\tfrac{1}{2}\int_0^2 u^{-1/2}\,du gives the wrong answer. Either change both limits to uu-values, or go back to xx before substituting 00 and 22.

Forgetting to substitute back. For an indefinite integral, the final answer must be in terms of xx.

1. (Warm-up) Find ∫3x2(x3−1)4 dx\displaystyle\int 3x^2(x^3 - 1)^4\,dx.

Solution

Let u=x3−1u = x^3 - 1, du=3x2 dxdu = 3x^2\,dx:

∫u4 du=u55+C=(x3−1)55+C\int u^4\,du = \frac{u^5}{5} + C = \frac{(x^3 - 1)^5}{5} + C

2. (Warm-up) Find ∫cos⁡(4x) dx\displaystyle\int \cos(4x)\,dx.

Solution

Let u=4xu = 4x, dx=14 dudx = \tfrac{1}{4}\,du:

14∫cos⁡u du=14sin⁡(4x)+C\frac{1}{4}\int \cos u\,du = \frac{1}{4}\sin(4x) + C

3. (Warm-up) Find ∫2x ex2 dx\displaystyle\int 2x\,e^{x^2}\,dx.

Solution

Let u=x2u = x^2, du=2x dxdu = 2x\,dx:

∫eu du=ex2+C\int e^u\,du = e^{x^2} + C

4. (Core) Find ∫x(x2+4)3 dx\displaystyle\int \frac{x}{(x^2 + 4)^3}\,dx.

Solution

Let u=x2+4u = x^2 + 4, so x dx=12 dux\,dx = \tfrac{1}{2}\,du:

12∫u−3 du=12⋅u−2−2+C=−14(x2+4)2+C\frac{1}{2}\int u^{-3}\,du = \frac{1}{2} \cdot \frac{u^{-2}}{-2} + C = -\frac{1}{4(x^2 + 4)^2} + C

5. (Core) Find ∫(ln⁡x)2x dx\displaystyle\int \frac{(\ln x)^2}{x}\,dx.

Solution

Let u=ln⁡xu = \ln x, du=1x dxdu = \tfrac{1}{x}\,dx:

∫u2 du=u33+C=(ln⁡x)33+C\int u^2\,du = \frac{u^3}{3} + C = \frac{(\ln x)^3}{3} + C

6. (Core) Find ∫exx dx\displaystyle\int \frac{e^{\sqrt{x}}}{\sqrt{x}}\,dx.

Solution

Let u=x=x1/2u = \sqrt{x} = x^{1/2}, so du=12x dxdu = \dfrac{1}{2\sqrt{x}}\,dx and dxx=2 du\dfrac{dx}{\sqrt{x}} = 2\,du:

2∫eu du=2ex+C2\int e^u\,du = 2e^{\sqrt{x}} + C

7. (Core) Evaluate ∫01x(x2+1)3 dx\displaystyle\int_0^1 x(x^2 + 1)^3\,dx.

Solution

Let u=x2+1u = x^2 + 1, x dx=12 dux\,dx = \tfrac{1}{2}\,du. When x=0x = 0, u=1u = 1; when x=1x = 1, u=2u = 2.

12∫12u3 du=12[u44]12=12⋅16−14=158\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}

8. (Challenge) Find ∫xx−1 dx\displaystyle\int x\sqrt{x - 1}\,dx.

Solution

Let u=x−1u = x - 1, so du=dxdu = dx and x=u+1x = u + 1. The extra xx becomes u+1u + 1:

∫(u+1) u1/2 du=∫(u3/2+u1/2)du=25u5/2+23u3/2+C=25(x−1)5/2+23(x−1)3/2+C\begin{aligned} \int (u + 1)\,u^{1/2}\,du &= \int \left(u^{3/2} + u^{1/2}\right)du \\ &= \frac{2}{5}u^{5/2} + \frac{2}{3}u^{3/2} + C \\ &= \frac{2}{5}(x - 1)^{5/2} + \frac{2}{3}(x - 1)^{3/2} + C \end{aligned}

9. (Challenge) Evaluate ∫141x (1+x)2 dx\displaystyle\int_1^4 \frac{1}{\sqrt{x}\,(1 + \sqrt{x})^2}\,dx.

Solution

Let u=1+xu = 1 + \sqrt{x}, so du=12x dxdu = \dfrac{1}{2\sqrt{x}}\,dx and dxx=2 du\dfrac{dx}{\sqrt{x}} = 2\,du. When x=1x = 1, u=2u = 2; when x=4x = 4, u=3u = 3.

2∫23u−2 du=2[−1u]23=2(−13+12)=132\int_2^3 u^{-2}\,du = 2\left[-\frac{1}{u}\right]_2^3 = 2\left(-\frac{1}{3} + \frac{1}{2}\right) = \frac{1}{3}