Integration by substitution

The idea of integration by substitution is to perform a change of variables in order to transform a complicated into one which is simpler to integrate. We usually perform a substitution on integrals of chains and so integration by substitution is often thought of as the reverse process to the chain rule.

The Steps of Integration by Substitution

Recall from the further integration page that the integral of \cos(kx) is \frac{1}{k}\sin(kx)+c. We use this to illustrate how to perform the steps of integration by substitution on the integral \int_0^{\frac{\pi}{6}}\cos(3x)dx.

  1. Choose u. Choose u=f(x) the function of x which you would like to replace. Change all x terms in the integrand for u terms. For this example, we choose u=3x.  
  2. Replace dx.  Using your choice of u, find an expression for \frac{du}{dx}. Rearrange this to find an expression for dx. In the example above, u=3x and so \frac{du}{dx}=3. It follows that dx=\frac{1}{3}du.
  3. Change the Limits.  Of course, if it is a indefinite integral then you may skip this step as there are no limits. However, definite integrals have limits that we must also change. The limits on the original integral are x-limits and so we must change them to u-limits. Since u=3x, if x=0 then u=0 and if x=\frac{\pi}{6} then u=\frac{\pi}{2}.
  4. Integrate.  We may now perform the integration:

\begin{array}{lll}\int_0^{\frac{pi}{6}}\cos(3x)dx\rightarrow \int_0^{\frac{pi}{2}}\cos(u)\times\frac{1}{3}du&=&\frac{1}{3}\int_0^{\frac{\pi}{2}}\cos(u) du\\&=&\frac{1}{3}\left[\sin(u)\right]_0^{\frac{\pi}{2}}\\&=&\frac{1}{3}\left[\sin\left(\frac{\pi}{2}\right)-\sin(0)\right]\\&=&\frac{1}{3}\end{array}

Note that we transformed the integral to one that we could integrate immediately. Recall that we saw how to integrate \cos(3x) by inspection in further integration. It is also possible to integrate functions of a linear variable (such as 2x+1) by inspection or by using substitution – see Example 1.

We can use integration by substitution for more complicated functions. Consider \int\frac{2x}{1+x^2}dx. By choosing the substitution u=1+x^2, we have \frac{du}{dx}=2x and so dx=\frac{1}{2x}du. There are no limits to change and the integral becomes \int \frac{2x}{u}\times\frac{1}{2x}du.  Normally we would have to deal with the additional x terms but in this case we can see that the derivative cancels. The integral becomes \int\frac{1}{u}du=\ln\vert u\vert+c=\ln\vert 1+x^2\vert +c. Notice that for definite integrals we must change the function back to being in terms of x. We can differentiate \ln\vert 1+x^2\vert +c to check the above integral. We use the chain rule to get \frac{2x}{1+x^2} as expected. This is why integration by substitution can be thought of as the reverse of chain rule differentiation. In other integrals, the derivative will also cancel if we can see a multiple of the derivative in the integrand – see Example 2.  If there is still a function, even after cancelling any derivatives, this function of x will also have to be replaced for a function of u – see Example 3.

Integrals of the form f'(x)/f(x)

Some schools (or other institutions) like to teach the following as separate from integration by substitution along with the reverse chain rule as seen above:

\int\frac{f'(x)}{f(x)}dx=\ln\vert f(x)\vert dx+c

This states that if we integrate a fraction where a function is the denominator and its derivative is the numerator then the result will be the natural log of that function (+c). We can show this using integration by substitution as follows:

  1. Choose u=f(x).
  2. The derivative is given by \frac{du}{dx}=f'(x) and so dx=\frac{1}{f'(x)}du.
  3. There are no limits to replace in this case.
  4. The integral becomes: \int\frac{f'(x)}{f(x)}dx=\int\frac{f'(x)}{u}\times\frac{1}{f'(x)}du=\int \frac{1}{u}du=\ln\vert u\vert +c=\ln\vert f(x)\vert +c.

Notice how the derivative cancelled in a very similar way to the example above.  This is simply another application of integration by substitution. See Example 4.

Integrating curves defined parametrically

We can also consider parametric integration to be another application of integration by substitution. Suppose we are given the parametric equations x=f(t) and y=g(t) (see more on parametric equations). Any integral of the form \int^{x_2}_{x_1} y, dx can be written in terms of parameter t:

  1. The integrand is simply y which can be written as g(t).
  2. This is not a function of x but we can obtain an expression for dx by differentiating f(t) with respect to t, and so dx=\frac{dx}{dt}\times dt=f'(t)dt.
  3. The x-limits can be changed to t-limits using the equation x=f(t).
  4. The integral is transformed as follows: \int_{x_1}^{x_2} y\,dx\rightarrow \int^{t_2}_{t_1}y\frac{dx}{dt}dt=\int_{t_1}^{t_2}g(t)f'(t)dt.

See Example 5.

Examples

  1. Integrate e^{2x-5} by inspection.
  2. Integrate \frac{1}{3-7x} using substitution.

Solution:

  1. We differentiate e^{2x-5} to get 2e^{2x-5} and so \int 2 e^{2x-5}dx=e^{2x-5}+c. It follows that \int e^{2x-5}dx=\frac{1}{2}e^{2x-5}+c.
  2. Let u=3-7x, hence \frac{du}{dx}=-7 and so dx=-\frac{1}{7}du. The integral becomes \int \frac{1}{3-7x}dx\rightarrow\int\frac{1}{u}\times -\frac{1}{7}du=-\frac{1}{7}\int \frac{1}{u}du=-\frac{1}{7}\ln(u)+c=-\frac{1}{7}\ln(3-7x)+c

Find \int 4\tan(\theta)\sec^5(\theta)d\theta.

Solution:

We can find this integral by making the substitution u=\sec(\theta). It follows that \frac{du}{d\theta}=\sec(\theta)\tan(\theta) using the formula booklet and so d\theta=\frac{1}{\sec(\theta)\tan(\theta)}du. Hence,

\begin{array}{lll}\int 4\tan(\theta)\sec^5(\theta)d\theta&\rightarrow&\int 4\tan(\theta)\sec^5(\theta)\times \frac{1}{\sec(\theta)\tan(\theta)}du\\&=&\int4\sec^4(\theta)du\\&=&\int 4u^4du\\&=&\frac{4}{5}u^5(x)+c\\&=&\frac{4}{5}\sec^5(x)+c\end{array}

Find \int_0^1 2x\sqrt{4-3x},dx.

Solution:

Let u=4-3x and so \frac{du}{dx}=-3 or dx=-\frac{1}{3}du. The x term doesnโ€™t cancel in this example and so we also need an expression for x. We can rearrange the expression for u to get x=\frac{4}{3}-\frac{1}{3}u. We also need to change the limits and so the integral becomes:

\begin{array}{lll}\int_0^1 2x\sqrt{4-3x}\,dx&\rightarrow& \int_4^12\left(\frac{4}{3}-\frac{1}{3}u\right)\sqrt{u}\times -\frac{1}{3}du\\&=&\frac{2}{9}\int_1^4\left(4u^{\frac{1}{2}}-u^{\frac{3}{2}}\right)du\\&=&\frac{2}{9}\left[\frac{8}{3}u^{\frac{3}{2}}-\frac{2}{5}u^{\frac{5}{2}}\right]_1^4\\&=&\frac{2}{9}\left[\left(\frac{8}{3}(4)^{\frac{3}{2}}-\frac{2}{5}(4)^{\frac{5}{2}}\right)-\left(\frac{8}{3}(1)^{\frac{3}{2}}-\frac{2}{5}(1)^{\frac{5}{2}}\right)\right]\\&=&\frac{2}{9}\left[\left(\frac{64}{3}-\frac{64}{5}\right)-\left(\frac{8}{3}-\frac{2}{5}\right)\right]\\&=&\frac{188}{135}\end{array}

Find \int \frac{2\cos(2x)}{\sin(2x)+1}dx.

Solution:

The integrand in this integral is of the form \frac{f'(x)}{f(x)} where f(x)=\sin(2x)+1. Hence, the integral will be \ln\vert \sin(2x)+1\vert+c. We can check this with integration by substitution. Let u=\sin(2x)+1, and so \frac{du}{dx}=2\cos(2x). It follows that dx=\frac{1}{2\cos(2x)}du and the integral becomes:

\begin{array}{lll}\int \frac{2\cos(2x)}{\sin(2x)+1}dx\rightarrow\int \frac{2\cos(2x)}{u}\times \frac{1}{2\cos(2x)}du&=&\int \frac{1}{u}du\\&=&\ln\vert u\vert +c\\&=&\ln\vert \sin(2x)+1\vert +c\end{array}

Find \int_0^2 y\, dx given the parametric equations x=2t and y=\frac{3}{2+t} for t\geq 0.

Solution:

We can differentiate to get \frac{dx}{dt}=2. When x=0 we have t=0 and when x=2, we have t=1. Hence the integral becomes

\int_0^2y\,dx\rightarrow\int_0^1 y\frac{dx}{dt}dt=\int_0^1\frac{6}{2+t}dt\left[6\ln(2+t)\right]_0^1=6\ln(3)-6\ln(2)=6\ln\left(\frac{3}{2}\right)