The substitution rule

The integral table handles simple functions. But what about

$\displaystyle\int 2x\sqrt{1+x^2}\,dx$?

No formula in the table fits. This integrand came from the chain rule. The substitution rule runs the chain rule backward.

Differentials

In linear approximation and differentials, we wrote $dy=f'(x)\,dx$. We use the same idea here. If $u=g(x)$, then

$du=g'(x)\,dx$.

For example, if $u=1+x^2$, then $du=2x\,dx$. Notice that $2x\,dx$ is exactly the rest of the integrand above.

The rule

The Substitution Rule: If $u=g(x)$, then

$\displaystyle\int f(g(x))\,g'(x)\,dx=\int f(u)\,du$.

Why: Let $F$ be an antiderivative of $f$. By the chain rule,

$\begin{align*}&\dfrac{d}{dx}F(g(x))\\&=F'(g(x))\,g'(x)\\&=f(g(x))\,g'(x)\end{align*}$

So $F(g(x))+C$ is the integral on the left. And $F(u)+C$ is the integral on the right. They are equal, because $u=g(x)$.

How to use the substitution rule

  1. Choose $u$. Look for an inner function whose derivative also appears in the integrand (up to a constant factor).
  2. Find $du=g'(x)\,dx$.
  3. Rewrite the whole integral in terms of $u$ and $du$. No $x$ should be left.
  4. Integrate with respect to $u$.
  5. Replace $u$ by $g(x)$.

Example 1: Find

$\displaystyle\int 2x\sqrt{1+x^2}\,dx$.

Solution:

Let $u=1+x^2$. Then $du=2x\,dx$.

$\begin{align*}&\int 2x\sqrt{1+x^2}\,dx\\&=\int\sqrt{u}\,du\\&=\dfrac{2}{3}u^{3/2}+C\\&=\dfrac{2}{3}(1+x^2)^{3/2}+C\end{align*}$

Check: By the chain rule, the derivative of $\dfrac{2}{3}(1+x^2)^{3/2}$ is

$(1+x^2)^{1/2}\cdot 2x$.

Example 2: Find

$\displaystyle\int x^3\cos(x^4+2)\,dx$.

Solution:

Let $u=x^4+2$. Then $du=4x^3\,dx$.

The integrand has $x^3\,dx$, not $4x^3\,dx$. So divide by $4$:

$x^3\,dx=\dfrac{1}{4}\,du$

Now substitute:

$\begin{align*}&\int x^3\cos(x^4+2)\,dx\\&=\int\cos u\cdot\dfrac{1}{4}\,du\\&=\dfrac{1}{4}\sin u+C\\&=\dfrac{1}{4}\sin(x^4+2)+C\end{align*}$

A constant factor is easy to fix. But a missing variable factor is not: for $\displaystyle\int\cos(x^4+2)\,dx$, this substitution does not work.

Example 3: Find each integral.

(a) $\displaystyle\int\sqrt{2x+1}\,dx$

(b) $\displaystyle\int e^{5x}\,dx$

Solution:

(a) Let $u=2x+1$. Then $du=2\,dx$, so $dx=\dfrac{1}{2}\,du$.

$\begin{align*}&\int\sqrt{2x+1}\,dx\\&=\dfrac{1}{2}\int u^{1/2}\,du\\&=\dfrac{1}{2}\cdot\dfrac{2}{3}u^{3/2}+C\\&=\dfrac{1}{3}(2x+1)^{3/2}+C\end{align*}$

(b) Let $u=5x$. Then $dx=\dfrac{1}{5}\,du$.

$\displaystyle\int e^{5x}\,dx=\dfrac{1}{5}\int e^u\,du=\dfrac{1}{5}e^{5x}+C$

Example 4: Find

$\displaystyle\int\tan x\,dx$.

Solution:

Write $\tan x=\dfrac{\sin x}{\cos x}$.

Let $u=\cos x$. Then $du=-\sin x\,dx$.

So $\sin x\,dx=-du$.

$\begin{align*}&\int\dfrac{\sin x}{\cos x}\,dx\\&=-\int\dfrac{1}{u}\,du\\&=-\ln|u|+C\\&=-\ln|\cos x|+C\end{align*}$

By the properties of logarithms, $-\ln|\cos x|=\ln\left|\dfrac{1}{\cos x}\right|=\ln|\sec x|$. So also

$\displaystyle\int\tan x\,dx=\ln|\sec x|+C$.

Example 5: Find

$\displaystyle\int x\sqrt{x+1}\,dx$.

Solution:

Let $u=x+1$. Then $du=dx$. The extra factor $x$ must also be written with $u$:

$x=u-1$

So

$\begin{align*}&\int x\sqrt{x+1}\,dx\\&=\int(u-1)\,u^{1/2}\,du\\&=\int(u^{3/2}-u^{1/2})\,du\\&=\dfrac{2}{5}u^{5/2}-\dfrac{2}{3}u^{3/2}+C\end{align*}$

Replace $u$ by $x+1$:

$\dfrac{2}{5}(x+1)^{5/2}-\dfrac{2}{3}(x+1)^{3/2}+C$

Definite integrals

For a definite integral, there are two ways:

The second way is usually shorter:

$\displaystyle\int_a^b f(g(x))\,g'(x)\,dx=\int_{g(a)}^{g(b)}f(u)\,du$

Example 6: Find

$\displaystyle\int_0^4\sqrt{2x+1}\,dx$.

Solution:

Let $u=2x+1$, so $dx=\dfrac{1}{2}\,du$. Change the limits:

  • When $x=0$: $u=1$.
  • When $x=4$: $u=9$.

$\begin{align*}&\int_0^4\sqrt{2x+1}\,dx\\&=\dfrac{1}{2}\int_1^9 u^{1/2}\,du\\&=\dfrac{1}{2}\left[\dfrac{2}{3}u^{3/2}\right]_1^9\\&=\dfrac{1}{3}(27-1)\\&=\dfrac{26}{3}\end{align*}$

Example 7: Find

$\displaystyle\int_1^e\dfrac{\ln x}{x}\,dx$.

Solution:

Let $u=\ln x$. Then $du=\dfrac{1}{x}\,dx$.

  • When $x=1$: $u=\ln 1=0$.
  • When $x=e$: $u=\ln e=1$.

$\begin{align*}&\int_1^e\dfrac{\ln x}{x}\,dx\\&=\int_0^1 u\,du\\&=\left[\dfrac{u^2}{2}\right]_0^1\\&=\dfrac{1}{2}\end{align*}$

Even and odd functions

On an interval $[-a,a]$, symmetry can save work. (See curve sketching for even and odd functions.)

Example 8: Find each integral.

(a) $\displaystyle\int_{-2}^{2}(x^6+1)\,dx$

(b) $\displaystyle\int_{-1}^{1}\dfrac{\tan x}{1+x^2+x^4}\,dx$

Solution:

(a) The function $x^6+1$ is even. So

$\begin{align*}&\int_{-2}^{2}(x^6+1)\,dx\\&=2\int_0^2(x^6+1)\,dx\\&=2\left[\dfrac{x^7}{7}+x\right]_0^2\\&=2\left(\dfrac{128}{7}+2\right)\\&=\dfrac{284}{7}\end{align*}$

(b) Replace $x$ by $-x$. The numerator $\tan x$ changes sign, and the denominator stays the same. So the function is odd, and the integral is $0$. We did not need an antiderivative at all.

Summary