Change of Variables or Substitution

In this section, we will discuss one of the most powerful techniques for finding antiderivatives. If we think of the process of antidifferentiation as reversing the process of differentation, this technique is what reverses derivatives computed with the Chain Rule.


An example

We'll begin by looking at an example. Suppose we want to evaluate a definite integral $  \int_0^4 f(u)~ du  $ where f is some continuous function which is given to us. Let's also suppose that the variable u is related to another variable x by the relationship $  u(x) = 2x $ . Our goal will be to write the definite integral in terms of an integral in the variable x .

As is typical, let's think of this by dividing the interval $ 
[0,4]  $ into n pieces. This means we form the points

\[  u_0 = 0, u_1 = \frac 4n, u_2 = \frac 8n, \ldots, u_k = 
\frac{4k}{n}, \ldots, u_n = 4.  \]

Now, since $  u = 2x  $ we have the points $  x_0, x_1, \ldots, x_k, \ldots, x_n  $ defined by $  u_k = 2x_k  $ which says that

\[ 
x_k = \frac{u_k}{2} = \frac {2k}n 
 \]

and in particular, $  x_0 = 0  $ and $  x_n = 2  $ . This brings us to our first observation: whereas we integrate over the region $  [0,4]  $ in the u variable, we integrate over the region $  [0,2]  $ in the x variable.

Now we have that

\begin{eqnarray*} 
\int_0^4 f(u)~du & \approx & \sum_{k=1}^n f(u_k) \Delta u \\ 
& \approx & \sum_{k=1}^n f(u_k) (u_k - u_{k-1}) \\ 
& \approx & \sum_{k=1}^n f(2x_k) (2x_k - 2x_{k-1}) \\ 
& \approx & \sum_{k=1}^n f(2x_k) 2\Delta x \\ 
\end{eqnarray*}

In other words,

\[ 
\int_0^4 f(u)~du = \int_0^2 f(2x)~2~dx 
 \]

Observations:

As we will see, these are common phenomena in what follows. We can understand them graphically using the following demonstrations. First, we'll study the relationship of u and x .

Notice how the rectangles in the x variable are half as wide as the corresponding rectangles in the u variable. You can also see how the endpoints in the two variables are different from one another.

The effect of this stretching is seen below: the integral we are trying to compute, $  \int_0^4 f(u)~du  $ , is the area under the curve on the right. In terms of the graph on the left, the area is much different because of the scaling between the two variables.


More generally

Here we'll consider a more general situation where u is again a function of x ---that is, $  u(x) $ . The endpoints of the regions we'll consider are related by $  u(a) = c  $ and $  u(b) = d $ . We will compute the integral $  \int_c^d f(u)~du  $ in terms of the x variable.

As always, break the interval $  [a,b]  $ into n pieces:

\[  x_0 = a, x_1=a+\Delta x, \ldots, x_k = a + k\Delta x, \ldots, x_n = b 
 \]

where $  \Delta x = \frac{b-a}{n}  $ . Now we will relate this to the u variable:

\[  u_0 = u(a) = c, u_1 = u(x_1), u_2 = u(x_2), \ldots, u_k = u(x_k), \ldots, u(x_n) = d 
 \]

Now here is the important thing to notice: if n is very large, then the points $  x_k  $ are very close to one another. This means that

\[ 
\frac{u_{k+1} - u_k}{x_{k+1} - x_k} = \frac{u(x_{k+1}) - u(x_k)} 
{x_{k+1} - x_k} \approx \frac{du}{dx}(x_k). 
 \]

This effect may be seen in the demonstration below. Notice that the width of the rectangles in the x variable are uniform. However, in the u variable, they are stretched. This stretching is precisely measured by the derivative $  \frac{du}{dx}  $ .


\begin{eqnarray*} 
\int_c^d f(u)~du & \approx & \sum_{k=0}^{n-1} f(u_k)(u_{k+1} - u_k) \\ 
& \approx & \sum_{k=0}^{n-1} f(u(x_k)) \frac{du}{dx}(x_k) 
(x_{k+1} - x_k) 
\end{eqnarray*}

So now we arrive at

\[ 
\int_c^d f(u)~du = \int_a^b f(u(x))\frac{du}{dx}~dx 
 \]

Again, we see that the endpoints are changed and there is a new factor of $  \frac{du}{dx}  $ which records the stretching of the rectangles between the two variables. We will often express this stretching by saying

\[  du = \frac{du}{dx}~dx 
 \]

You can again see how the definite integral is affected by the change of variables.


Examples

The way in which this observation is used is very powerful. In general, we can use it if we have a complicated integral in the x . By making a good choice for the substitution $  u(x)  $ , we can simplify the integral. Let's see this in a few examples:

  1. Example 1: $  \int_0^{\pi/2} \sin(2x)~dx  $

    Here we'll use the substitution $  u = 2x  $ . Then we see that $  du = \frac{du}{dx}~dx = 2~dx  $ or $  dx = \frac 12~du  $ . Also, when $  x = 0  $ , we have $  u = 2x = 0  $ and when $  x = \frac \pi 2  $ we have $  u = 2x = \pi  $ .

    \[ 
\int_0^{\pi/2} \sin(2x)~dx = \int_0^\pi \sin(u) \frac 12~du = \frac 12 
\int_0^\pi \sin(u)~du = \frac 12 (-\cos(u))|_0^\pi = 1 
 \]

    In this example, we have been able to convert a definite integral into another one whose antiderivative is immediately known to us.

  2. Example 2: $  \int_0^1 \frac{1}{(2x+1)^2}~dx  $ .

    The trick is to try a substitution which will make the integral look like one of the ones on our list of functions whose antiderivative we know. Let's try the substitution $  u(x) = 2x+1 
 $ . Then $  du = 2 dx  $ or $  dx = \frac 12 du 
 $ .

    Now it follows that

    \[ \int_0^1 \frac{1}{(2x+1)^2} ~dx = \int_1^3 \frac{1}{u^2} \frac 12 
~du = -\frac 12 \frac 1u |_1^3 = \frac 13  \]

  3. Example 3: Now we'll just look at some indefinite integrals. This just means finding the antiderivative rather than evaluating a definite integral. We will first consider: $  \int \frac{x}{1+x^2}~dx  
 $ .

    The tricky thing about making a substitution is that you need to identify some part of the integrand which looks like the derivative of some other part. When you look at the integrand above, notice that x , which appears in the numerator, is closely related to the derivative of the denominator. For that reason, let's try the substitution $  u(x) = 1+x^2  $ .

    Then $  du = 2x~dx  $ or $  x~dx = \frac 12 ~du  $ . This means that

    \[ 
\int \frac{x}{1+x^2}~dx = \frac 12 \int \frac 1u ~du = \frac 12 \ln 
|u| + C = \frac 12 \ln(1+x^2) + C  
 \]

  4. Example 4: $  \int \tan(x)~dx = \int 
\frac{\sin(x)}{\cos(x)}~dx  $ .

    Here, you might recognize that the $  \sin(x)  $ which occurs in the numerator is related to the derivative of the denominator. So let's try the substitution: $  u(x) = \cos(x)  $ .

    Then $  du = -\sin(x) ~dx  $ and so

    \[  \int \frac{\sin x}{\cos x}~dx = \int -\frac 1u~ du =-\ln |u| + C = -\ln |\cos x| + C = \ln |\sec x| + C 
 \]

  5. Example 5: $  \int e^{1-x}~dx  $ . Let's try the substitution $  u = 1-x  $ . In that case, $  du = -dx  $ so that

    \[ 
\int e^{1-x}~dx = \int -e^u~du = -e^u + C = -e^{1-x} + C 
 \]

  6. Example 6: $  \int x\sqrt{1+x^2}~dx  $ . Here the substitution $  u = 1+x^2  $ works nicely since $  du = 2x~dx $ . Then

    \[ 
\int x\sqrt{1+x^2}~dx = \int \frac 12 \sqrt{u}~du = \frac 12 \frac 23 u^{3/2} + C = \frac 13 (1+x^2)^{3/2} 
 \]

  7. Example 7: $  \int \frac{1}{x^2 + 2x + 1}~dx  $ . The trick here is to rewrite the integrate as a perfect square: $  \frac{1}{x^2 + 2x +1} = \frac{1}{(x+1)^2}  $ . We can then find the antiderivative by the substitution: $  u = x+1  $ where $  du = dx  $ .

    \[ 
\int \frac{1}{x^2 + 2x +1 } ~dx = \int \frac{1}{(x+1)^2} ~dx 
=\int \frac 1{u^2}~du = -\frac 1u + C = -\frac 1{x+1}+C 
 \]

  8. Example 8: $  \int \frac{1}{x^2 + 2x + 2}~dx  $ . Guided by our experience with the last example, we will complete the square. This means we will rewrite:

    \[ 
x^2 + 2x + 2 = (x^2 + 2x + 1) + 2 -1 = (x+1)^2 + 1 
 \]

    Then we will use the substitution $  u = x+ 1  $ so that

    
\begin{eqnarray*} 
\int \frac{1}{x^2 + 2x + 2} ~dx & = &\int \frac{1}{(x+1)^2 + 1}~dx \\ 
& = & \int \frac{1}{1 + u^2}~du \\ 
& = & \tan^{-1}(u) + C \\ 
& = & \tan^{-1}(x+1)+C 
\end{eqnarray*}

  9. Example 9: $  \int \frac{1}{x^2 + 2x + 5}~dx  $ . This example is pretty similar to the previous one so we'll just show the idea:

    
\begin{eqnarray*} 
\int \frac{1}{x^2 + 2x + 5} ~dx & = & 
\int \frac{1}{(x+1)^2 + 4}~dx \\ 
& = & \int\frac{1}{4+u^2}~du \\ 
& = & \frac 14 \int \frac{1}{1+(\frac u2)^2} 
~du \\ 
& = & \frac 12 \tan^{-1}(\frac u2)+C \\ 
& = & \frac 12 \tan^{-1}(\frac{x+1}{2}) + C 
\end{eqnarray*}

    After reading the examples above, if you feel that this method requires a certain amount of guessing and luck, then you've got the idea. However, with experience, you will quickly see how to make educated guesses and it will go much more smoothly. Don't be afraid to make some mistakes as you go along, provided you think about what went wrong when you do make a mistake. Remember that you can always check your answer by differentiating.


Relations to the Chain Rule

We have shown you this method by thinking about a definite integral and measuring how the width of rectangles change under a change of variables. However, the Fundamental Theorem of Calculus tells us that integration is the same as reversing the process of differentiation. Consequently, this method should be, and is, related to a well known fact about derivatives.

If G is the antiderivative of f , this means that $  G^\prime(u) = f(u)  $ . In other words,

\[ 
\int f(u)~du = G(u) + C 
 \]

However, if we also have $  u(x)  $ , then

\[ 
\frac{d}{dx} G(u(x)) = G^\prime(u(x)) ~u^\prime(x) = f(u(x)) ~\frac{du}{dx} 
 \]

In other words, $  G(u(x))  $ is an antiderivative of $ 
f(u(x))~\frac{du}{dx}  $ too. This leads to the relationship that we have already found:

\[ 
\int f(u(x))~\frac{du}{dx} ~dx = \int f(u)~du 
 \]