$\newcommand{\dollar}{\} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\arctanh}{arctanh} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&}$

## Section5.6Integration by Substitution

###### Motivating Questions
• How can we begin to find algebraic formulas for antiderivatives of more complicated algebraic functions?

• What is an indefinite integral and how is its notation used in discussing antiderivatives?

• How does the technique of $u$-substitution work to help us evaluate certain indefinite integrals, and how does this process rely on identifying function-derivative pairs?

In Section5.3, we learned the key role that antiderivatives play in the process of evaluating definite integrals exactly. The Fundamental Theorem of Calculus tells us that if $F$ is any antiderivative of $f\text{,}$ then

\begin{equation*} \int\limits_a^b f(x) \, dx = F(b) - F(a)\text{.} \end{equation*}

So, to evaluate the definite integral, we need to find an antiderivative for $f \text{,}$ evaluate the antiderivative at $a$ and $b \text{,}$ and subtract. However, as we have observed in previous sections, finding the antiderivative of a function becomes more complicated as the formula becomes more complicated. In this section, we will explore what happens when you attempt to find the antiderivative of a composite function.

### SubsectionReversing the Chain Rule: $u$-substitution

Recall that the Chain Rule states that

\begin{equation*} \frac{d}{dx} \left[ f(g(x)) \right] = f'(g(x)) \cdot g'(x)\text{.} \end{equation*}

Restating this relationship in terms of an indefinite integral,

\begin{equation} \int f'(g(x)) g'(x) \, dx = f(g(x))+C\text{.}\label{E-usubst}\tag{5.1} \end{equation}

Equation(5.1) tells us that if we can view a given function as $f'(g(x)) g'(x)$ for some appropriate choices of $f$ and $g\text{,}$ then we can antidifferentiate the function by reversing the Chain Rule.

To reverse the Chain Rule we must first identify an "inside" function $g(x)\text{.}$ Since we are reversing the Chain Rule then the derivative of the inside function must also be part of the function, thus we must have $g'(x)$ as well.

If we can identify both $g(x)$ and $g'(x)\text{,}$ then we will introduce a new variable $u$ to represent the function $g(x)\text{.}$ With $u = g(x)\text{,}$ it follows that $\frac{du}{dx} = g'(x)\text{,}$ which we can then rewrite as7If we recall from the definition of the derivative that $\frac{du}{dx} \approx \frac{\Delta{u}}{\Delta{x}}$ and use the fact that $\frac{du}{dx} = g'(x)\text{,}$ then we see that $g'(x) \approx \frac{\Delta{u}}{\Delta{x}}\text{.}$ Solving for $\Delta u\text{,}$ $\Delta u \approx g'(x) \Delta x\text{.}$ It is this last relationship that, when expressed in differential notation enables us to write $du = g'(x) \, dx$ in the change of variable formula., $du = g'(x)\, dx\text{.}$ Now converting the indefinite integral to a new one in terms of $u\text{,}$ we have

\begin{equation*} \int f'(g(x)) g'(x) \, dx = \int f'(u) \,du\text{.} \end{equation*}

Provided that $f'$ is an function whose antiderivative is known from Section5.1, we can easily evaluate the indefinite integral in $u\text{,}$ and then go on to determine the desired overall antiderivative of $f'(g(x)) g'(x)\text{.}$ We call this process $u$-substitution, and summarize the rule as follows:

###### Method of Substitution

With the substitution $u = g(x)\text{,}$

\begin{equation*} \int f'(g(x)) g'(x) \, dx = \int f'(u) \,du = f(u) + C = f(g(x)) + C\text{.} \end{equation*}

This method is often referred to as $u$-substitution.

To apply the method of $u$-substitution, we consider the steps laid out in the following example.

###### Example5.80

Evaluate the following integral using $u$-substitution.

\begin{equation*} \int \left(x^3+5\right)^8(3x^2)dx \end{equation*}

Step 1: Identify an "inside" function and set $u$ equal to that inside function. In this case, a possible "inside" function is

\begin{equation*} u=x^3+5. \end{equation*}

Step 2: Take the derivative of inside function, and then write in the form $du=g'(x)dx\text{:}$

\begin{equation*} du=3x^2 dx. \end{equation*}

Step 3: Replace the inside function with $u$ and replace $g'(x)dx$ with $du\text{:}$

\begin{equation*} \int (\overbrace{x^3+5}^{u})^8\overbrace{(3x^2)dx}^{du}=\int (u)^8du. \end{equation*}

Step 4: Integrate with variable $u\text{:}$

\begin{equation*} \int u^8 du=\frac{u^9}{9}+C. \end{equation*}

Step 5: Replace $u$ with the function chosen in the Step 1:

\begin{equation*} \int \left(x^3+5\right)^83x^2dx=\int u^8 du=\frac{u^9}{9}+C=\frac{(x^3+5)^9}{9}+C \end{equation*}

Step 6: Check your work by taking the derivative using the Chain Rule:

\begin{equation*} \frac{d}{dx}\left[\frac{(x^3+5)^9}{9}+C\right]=9\frac{(x^3+5)^8}{9}(3x^2)=(x^3+5)^8(3x^2). \end{equation*}
###### Example5.81

Evaluate the following indefinite integrals with $u$-substitution

1. $\displaystyle \int \sqrt{4x^2+3x}(8x+3)\, dx$

2. $\displaystyle \int \frac{12x+9}{(6x^2+9x+4)^3}\, dx$

3. $\displaystyle \int 4xe^{2x^2+4}\, dx$

4. $\displaystyle \int \frac{6x}{3x^2+7}\, dx$

1. \begin{equation*} \int \sqrt{4x^2+3x}(8x+3)\, dx=\frac{2}{3}(4x^2+3x)^{3/2}+C \end{equation*}
2. \begin{equation*} \int \frac{12x+9}{(6x^2+9x+4)^3}\, dx=\frac{-1/2}{(6x^2+9x+4)^{2}}+C \end{equation*}
3. \begin{equation*} \int 4xe^{2x^2+4}\, dx=e^{2x^2+4}+C \end{equation*}
4. \begin{equation*} \int \frac{6x}{3x^2+7}\, dx=\ln|3x^2+7|+C \end{equation*}
Solution
1. To start, choose $u=4x^2+3x\text{,}$ the "inside" function. Then $du=(8x+3)dx\text{,}$ so

\begin{equation*} \int \sqrt{4x^2+3x}(8x+3)\, dx=\int \sqrt{u}du=\int u^{1/2}du. \end{equation*}

Integrate $u$ by applying the power rule, then replace $u$ with $4x^2 + 3x \text{:}$

\begin{equation*} \int u^{1/2}du=\frac{u^{3/2}}{3/2}+C=\frac{2}{3}u^{3/2}+C=\frac{2}{3}(4x^2+3x)^{3/2}+C. \end{equation*}
2. To start, choose $u=6x^2+9x+4\text{,}$ the "inside" function. Then $du=(12x+9)dx\text{,}$ so

\begin{equation*} \int \frac{12x+9}{(6x^2+9x+4)^3}\, dx=\int \frac{1}{u^3}du=\int u^{-3}du. \end{equation*}

Integrate $u$ by applying the power rule, then replace $u$ with $6x^2+9x+4\text{:}$

\begin{equation*} \int u^{-3}du=\frac{u^{-2}}{-2}+C=\frac{-1/2}{u^2}+C=\frac{-1/2}{(6x^2+9x+4)^{2}}+C \end{equation*}
3. Start by choosing $u=2x^2+4\text{.}$ As a general rule of thumb, whenever we have a function in the exponent of $e$ we will choose this function as $u\text{.}$ Then $du=4xdx\text{,}$ and

\begin{equation*} \int 4xe^{2x^2+4}\, dx=\int e^udu=e^u+C=e^{2x^2+4}+C. \end{equation*}
4. Start by choosing $u=3x^2+7\text{.}$ As a general rule of thumb, given a rational function without an obvious inside, try to choose $u=$ the denominator. Then $du=6xdx$ and

\begin{equation*} \int \frac{6x}{3x^2+7}\, dx=\int \frac{1}{u}du=\ln|u|+C=\ln|3x^2+7|+C. \end{equation*}

#### SubsectionWhat if $du$ is not exact?

In some cases after we choose $u\text{,}$ the corresponding $du$ is not exactly what is left over in the integral. For example, consider the following integral:

\begin{equation*} \int xe^{x^2}dx. \end{equation*}

For this integral we can use $u$-substitution with $u = x^2$ and $du = 2xdx\text{.}$ Although, this $du$ is not exactly in our integral we can multiply both sides by $\displaystyle \frac{1}{2}$ so that $\frac{1}{2}du=xdx\text{,}$ which is now exactly what is left over in the integral. Thus,

\begin{align*} \int xe^{x^2} \, dx &= \int e^u \cdot \frac{1}{2} \, du\\ &= \frac{1}{2} \int e^u \, du\\ &= \frac{1}{2} e^u + C\\ &= \frac{1}{2} e^{x^2} + C\text{.} \end{align*}

However, for the similar indefinite integral

\begin{equation*} \int e^{x^2} \, dx\text{,} \end{equation*}

the $u$-substitution $u = x^2$ is no longer possible because the factor of $x$ is missing. Hence, part of the lesson of $u$-substitution is just how specialized the process is: it only applies to situations where, up to a missing constant, the integrand is the result of applying the Chain Rule to a different, related function.

###### Example5.82

Evaluate the following indefinite integrals with $u$-substitution

1. $\displaystyle \int x^2(3x^3+8)^5\, dx$

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

3. $\displaystyle \int (2x+1)xe^{3x^4+6x}\, dx$

4. $\displaystyle \int \frac{6x^2}{x^3+10}\, dx$

1. \begin{equation*} \int x^2(3x^3+8)^5\, dx=\frac{(3x^3+8)^6}{54}+C \end{equation*}
2. \begin{equation*} \int \frac{x}{\sqrt{x^2+25}}\, dx=\sqrt{x^2+25}+C \end{equation*}
3. \begin{equation*} \displaystyle \int (2x+1)xe^{3x^4+6x}\, dx=\frac{1}{6}e^{3x^4+6x}+C \end{equation*}
4. \begin{equation*} \int \frac{6x^2}{x^3+10}\, dx=2\ln|x^3+10|+C \end{equation*}
Solution
1. To start with we choose $u=3x^3+8\text{,}$ the "inside" function. Then $du=9x^2dx\text{.}$ The term in the integral is $x^2dx\text{,}$ so we need to multiply both sides by $\frac{1}{9}$ to get $\frac{1}{9}du=x^2dx\text{.}$ Thus

\begin{equation*} \int x^2(3x^3+8)^5\, dx=\int u^5\frac{1}{9}du=\frac{1}{9}\frac{u^6}{6}=\frac{(3x^3+8)^6}{54}+C \end{equation*}
2. To start with we choose $u=x^2+25\text{,}$ the "inside" function. Then $du=2xdx\text{.}$ The term in the integral is $xdx\text{,}$ so we need to multiply both sides by $\frac{1}{2}$ to get $\frac{1}{2}du=xdx\text{.}$ Thus

\begin{equation*} \int \frac{x}{\sqrt{x^2+25}}\, dx=\int \frac{1}{\sqrt{u}}\frac{1}{2}du=\int \frac{1}{2}u^{-1/2}du = \end{equation*}
\begin{equation*} \frac{1}{2} \cdot \frac{u^{1/2}}{1/2}+C=u^{1/2}+C=\sqrt{x^2+25}+C \end{equation*}
3. Start by choosing $u=3x^4+6x\text{,}$ the exponent of $e\text{.}$ Then $du=(12x^3+6)dx\text{.}$ The term in the integral is $(2x+1)dx$ so we need to multiply both sides by $\frac{1}{6}$ to get $\frac{1}{6}du=(2x+1)dx\text{.}$ Thus

\begin{equation*} \displaystyle \int (2x+1)xe^{3x^4+6x}\, dx=\int \frac{1}{6}e^udu=\frac{1}{6}e^u+C=\frac{1}{6}e^{3x^4+6x}+C \end{equation*}
4. Start by choosing $u=x^3+10\text{,}$ the denominator. Then $du=3x^2dx\text{.}$ The term in the integral is $6x^2dx\text{,}$ so we need to multiply both sides by $2$ to get $2du=6x^2dx\text{.}$ Thus

\begin{equation*} \int \frac{6x^2}{x^3+10}\, dx=\int \frac{2}{u}du=2\ln|u|+C=2\ln|x^3+10|+C \end{equation*}

### SubsectionEvaluating Definite Integrals via $u$-substitution

We have introduced $u$-substitution as a means to evaluate indefinite integrals of functions that can be written, up to a constant multiple, in the form $f(g(x))g'(x)\text{.}$ This same technique can be used to evaluate definite integrals involving such functions, though we need to be careful with the corresponding limits of integration. Consider, for instance, the definite integral

\begin{equation*} \int\limits_2^5 xe^{x^2} \, dx\text{.} \end{equation*}

Whenever we write a definite integral, the limits of integration correspond to the variable of integration. To be more explicit, observe that

\begin{equation*} \int\limits_2^5 xe^{x^2} \, dx = \int\limits_{x=2}^{x=5} xe^{x^2} \, dx\text{.} \end{equation*}

When we apply $u$-substitution, we change the variable of integration; it is essential to note that this also changes the limits of integration. For instance, with the substitution $u = x^2$ and $du = 2x \, dx\text{,}$ it also follows that when $x = 2\text{,}$ $u = 2^2 = 4\text{,}$ and when $x = 5\text{,}$ $u = 5^2 = 25\text{.}$ Thus, under the change of variables of $u$-substitution, we now have

\begin{align*} \int\limits_{x=2}^{x=5} xe^{x^2} \, dx &= \int\limits_{u=2^2}^{u=5^2} e^{u} \cdot \frac{1}{2} \, du\\ &= \left. \frac{1}{2}e^u \right|_{u=4}^{u=25}\\ &= \frac{1}{2}e^{25} - \frac{1}{2}e^4\text{.} \end{align*}

Alternatively, we could ignore the bounds. We do this by replacing the bounds with $-$ to indicate that although this is a definite integral with bounds we know that the bounds for $u$ are not the same as the bounds for $x\text{.}$ We then integrate, and once we replace $u$ with the function of $x\text{,}$ then we return to our original bounds. With that method, we'd have

\begin{align*} \int\limits_{2}^{5} xe^{x^2} \, dx &= \int\limits_{-}^- \frac{1}{2}e^udu\\ &=\left.\frac{1}{2}e^u\right|_{-}^-\\ &=\left. \frac{1}{2}e^{x^2} \right|_{2}^{5}\\ &= \frac{1}{2}e^{25} - \frac{1}{2}e^4\text{,} \end{align*}

which is, of course, the same result. This is summarized below:

###### Two Methods to Evaluate a Definite Integral with $u$-substitution

To evaluate the definite integral $\int\limits_a^b h(x) \, dx$ while using a $u$-substitution, there are two different methods to apply the Fundamental Theorem of Calculus. Either method is correct, and they are each summarized below:

1. Change the limits to the corresponding $u$-values. Then find the antiderivative with respect to $u$ and evaluate it according to the Fundamental Theorem of Calculus, using the limits corresponding to $u \text{.}$

2. Ignore the bounds, replacing them with $-\text{,}$ so the integral becomes $\int\limits_{-}^- h(x) \, dx \text{,}$ and find an antiderivative with respect to $x \text{.}$ Make sure your resulting expression is in terms of $x \text{.}$ Then evaluate it according to the Fundamental Theorem of Calculus, using the limits corresponding to $x \text{.}$

###### Example5.83

Evaluate each of the following definite integrals exactly through an appropriate $u$-substitution.

1. $\displaystyle \int\limits_{1}^3 (x^2-2)(x^3-6x)^8 \,dx$

2. $\displaystyle \int\limits_0^1 e^{-x} (2e^{-x}+3)^{9} \, dx$

3. $\displaystyle \int\limits_1^2 \frac{x}{1 + 4x^2} \, dx$

1. \begin{gather*} \int\limits_{1}^3 (x^2-2)(x^3-6x)^8 \,dx=\frac{9^9}{27}-\frac{(-5)^9}{27}\text{.} \end{gather*}
2. \begin{gather*} \int\limits_0^1 e^{-x} (2e^{-x}+3)^{9} \, dx = -\frac{1}{20}(2e^{-1}+3)^{10} + \frac{1}{20}(5)^{10}\text{.} \end{gather*}
3. \begin{gather*} \int\limits_{x=1}^{x=2} \frac{x}{1 + 4x^2} \, dx = \frac{1}{8} (\ln(17) - \ln(5))\text{.} \end{gather*}
Solution

For each of these examples, we will use both methods. It is not necessary to master both approaches. Rather, it is better to pick one and learn it well.

1. For either method we start by choosing $u=x^3-6x\text{.}$ Then $du=(3x^2-6)dx\text{,}$ thus we need to multiply both sides by $\frac{1}{3}$ to match the terms in the integral, so $\frac{1}{3}du=(x^2-2)dx\text{.}$ Then changing the bounds, we get

\begin{align*} \int\limits_1^3 (x^2-2)(x^3-6x)^8 \,dx\mathstrut\amp=\int\limits_{u=(1)^3-6(1)}^{u=(3)^3-6(3)} \frac{1}{3}u^8du \\ \mathstrut \amp =\int\limits_{-5}^{9} \frac{1}{3}u^8du \\ \mathstrut \amp =\left.\frac{1}{3}\frac{u^9}{9}\right|_{-5}^{9} \\ \mathstrut\amp =\frac{9^9}{27}-\frac{(-5)^9}{27} \end{align*}

Alternatively we could evaluate the integral by ignoring the bounds

\begin{align*} \int\limits_1^3 \left((x^2-2)(x^3-6x)^8\right) \,dx \mathstrut\amp=\int\limits_{-}^{-} \frac{1}{3}u^8du\\ \mathstrut\amp=\left.\frac{1}{3}\frac{u^9}{9}\right|_-^{-} \\ \mathstrut \amp =\left.\frac{(x^3-6x)^9}{27}\right|_1^3 \\ \mathstrut\amp=\frac{(3^3-6(3)^9}{27}-\frac{(1)^3-6(1))^9}{27} \\ \mathstrut\amp =\frac{9^9}{27}-\frac{(-5)^9}{27} \end{align*}

Either way we integrate results in the same solution.

2. For either method we start by choosing $u=2e^{-x}+3\text{.}$ Then $du = -2e^{-x}dx\text{,}$ thus we need to multiply both sides by $\frac{-1}{2}$ to get $\frac{-1}{2}du=e^{-x}dx\text{.}$ Changing the bounds, we get

\begin{align*} \int\limits_0^1 e^{-x} (2e^{-x}+3)^{9} \, dx \mathstrut\amp=\int\limits_{u=2e^0+3}^{u=2e^{-1}+3}\frac{-1}{2}u^9 du \\ \mathstrut\amp=\int\limits_5^{2e^{-1}+3} \frac{-1}{2}\\ \mathstrut\amp =\left.\frac{-1}{2}\frac{u^{10}}{10}\right|_5^{2e^{-1}+3} \\ \mathstrut\amp=\frac{-(2e^{-1}+3)^{10}}{20}-\frac{-(5)^{10}}{20} \\ \mathstrut\amp=-\frac{1}{20}(2e^{-1}+3)^{10} + \frac{1}{20}(5)^{10} \end{align*}

Alternatively we could evaluate the integral by ignoring the bounds

\begin{align*} \int\limits_0^1 e^{-x} (2e^{-x}+3)^{9} \, dx \mathstrut\amp=\int\limits_{-}^{-}\frac{-1}{2}u^9 du\\ \mathstrut\amp=\left.\frac{-1}{2}\frac{u^{10}}{10}\right|_-^- \\ \mathstrut\amp=\left.-\frac{(2e^{-x}+3)^{10}}{20}\right|_0^{1}\\ \mathstrut\amp=\frac{-(2e^{-1}+3)^{10}}{20}-\frac{-(2^0+3)^{10}}{20} \\ \mathstrut\amp=-\frac{1}{20}(2e^{-1}+3)^{10} + \frac{1}{20}(5)^{10} \end{align*}

Either way we integrate results in the same solution.

3. For either method we start by choosing $u = 1+4x^2\text{.}$ Then $du=8x dx\text{,}$ thus we need to multiply both sides by $\frac{1}{8}$ to get $\frac{1}{8} du=xdx\text{.}$ Changing the bounds, we get

\begin{align*} \int\limits_1^{2} \frac{x}{1 + 4x^2} \, dx \mathstrut\amp= \int\limits_{u=1+4(1)^2}^{u=1+4(2)^2} \frac{1}{8}\frac{1}{u}du \\ \mathstrut\amp=\int\limits_5^{17}\frac{1}{8}\frac{1}{u}du \\ \mathstrut\amp=\left. \frac{1}{8} \ln|u| \right|_5^{17} \\ \mathstrut\amp= \frac{1}{8} (\ln(17) - \ln(5)). \end{align*}

Alternatively we could evaluate the integral by ignoring the bounds

\begin{align*} \int\limits_1^{2} \frac{x}{1 + 4x^2} \, dx \mathstrut\amp= \int\limits_{-}^{-} \frac{1}{8}\cdot \frac{1}{u}du \\ \mathstrut\amp=\left.\frac{1}{8}\ln|u|\right|_-^- \\ \mathstrut\amp=\left. \frac{1}{8} \ln|1+4x^2| \right|_1^{2} \\ \mathstrut\amp= \frac{1}{8}\ln(1+4(2)^2)-\frac{1}{8}\ln(1+4(1)^2) \\ \mathstrut\amp=\frac{1}{8} (\ln(17) - \ln(5)). \end{align*}

Either way we integrate results in the same solution.

### SubsectionSummary

• To find algebraic formulas for antiderivatives of more complicated algebraic functions, we need to think carefully about how we can reverse known differentiation rules. To that end, it is essential that we understand and recall known derivatives of basic functions, as well as the standard derivative rules.

• The indefinite integral provides notation for antiderivatives. When we write $\int f(x) \, dx\text{,}$ we mean the general antiderivative of $f\text{.}$ In particular, if we have functions $f$ and $F$ such that $F' = f\text{,}$ the following two statements say the exact thing:

\begin{equation*} \frac{d}{dx}[F(x)] = f(x) \ \text{and} \ \int f(x) \, dx = F(x) + C\text{.} \end{equation*}

That is, $f$ is the derivative of $F\text{,}$ and $F$ is an antiderivative of $f\text{.}$

• The technique of $u$-substitution helps us to evaluate indefinite integrals of the form $\int f(g(x))g'(x) \, dx$ through the substitutions $u = g(x)$ and $du = g'(x) \, dx\text{,}$ so that

\begin{equation*} \int f(g(x))g'(x) \, dx = \int f(u) \, du\text{.} \end{equation*}

A key part of choosing the expression in $x$ to be represented by $u$ is the identification of a function-derivative pair. To do so, we often look for an inner function $g(x)$ that is part of a composite function, while investigating whether $g'(x)$ (or a constant multiple of $g'(x)$) is present as a multiplying factor of the integrand.

• There are two methods to use $u$-substitution with a definite integral. In one method, first find the general antiderivative in terms of $x$ and use the bounds of integration corresponding to $x$ when using the Fundamental Theorem of Calculus. For the other method, change the bounds of integration to correspond to $u$ as a step of a $u$-substitution, integrate with respect to $u \text{,}$ and use the bounds corresponding to $u$ when using the Fundamental Theorem of Calculus.

### SubsectionExercises

Consider the indefinite integral $\int x \sqrt{x-1} \, dx\text{.}$

1. At first glance, this integrand may not seem suited to substitution due to the presence of $x$ in separate locations in the integrand. Nonetheless, using the composite function $\sqrt{x-1}$ as a guide, let $u = x-1\text{.}$ Determine expressions for both $x$ and $dx$ in terms of $u\text{.}$

2. Convert the given integral in $x$ to a new integral in $u\text{.}$

3. Evaluate the integral in (b) by noting that $\sqrt{u} = u^{\frac{1}{2}}$ and observing that it is now possible to rewrite the integrand in $u$ by expanding through multiplication.

4. Evaluate each of the integrals $\int x^2 \sqrt{x-1} \, dx$ and $\int x \sqrt{x^2 - 1} \, dx\text{.}$ Write a paragraph to discuss the similarities among the three indefinite integrals in this problem and the role of substitution and algebraic rearrangement in each.