$$ \newcommand{\norm}[1]{\left\Vert#1\right\Vert} \newcommand{\abs}[1]{\left\vert#1\right\vert} \newcommand{\set}[1]{\left\{#1\right\}} \newcommand{\Comp}{\mathbb C} \newcommand{\Real}{\mathbb R} \newcommand{\Nat}{\mathbb N} \newcommand{\of}[1]{\left ( #1 \right ) } \newcommand{\To}{\rightarrow} \newcommand{\eps}{\varepsilon} $$

Integral Calculus lecture notes: Substitution

Eugene Kritchevski, Vanier College, last updated on February 12, 2016


Indefinite integrals

Suppose that the function $F$ is an antiderivative of the function $f$, that is $F'(u)=f(u)$. According to the Chain Rule, we have $$\frac{d}{dx}F(g(x))=F'(g(x))g'(x)=f(g(x))g'(x),$$ It follows that the function $F(g(x))$ is an antiderivative of the function $f(g(x))g'(x)$, and so we have a new formula for indefinite integrals:
$$\int f(g(x))g'(x)\,dx=F(g(x))+C$$
As usual, $C$ is an arbitrary constant.

Example 1: Consider $g(x)=x^2+5$, $F(u)=\sin(u)$ and $f(u)=\cos(u)$. Of course, here $F$ is an antiderivative of $f$. Then we have $g'(x)=2x$, $$\frac{d}{dx}\sin(x^2+5)=\cos(x^2+5)2x,$$ and so $$\int \cos(x^2+5)2x\,dx=\sin(x^2+5)+C.$$ Example 2: We want to evaluate the indefinite integral $$\int (x^4+7)^{10}x^3\,dx.$$ Our job is to come up with functions $F$, $f'$ and $g$ such that $F'=f$ and $x^3(x^4+7)^{10}=f(g(x))g(x)$. We start by finding $g(x)$. In the composition $(x^4+7)^{10}$, the inner function is $x^4+7$ and so a natural candidate for $g$ is $$g(x)=x^4+7.$$ Then $g'(x)=4x^3$, which is almost the same as the $x^3$ present in our integral, except for a multiplicative factor of $4$. We can artificially introduce a factor of $4$ and rewrite the integrand as $$(x^4+7)^{10}x^3=\frac{1}{4}(x^4+7)^{10}(4x^3)=f(g(x))g'(x),$$ where $$f(u)=\frac{1}{4}u^{10}.$$ We can then take the antiderivative $$F(u)=\frac{1}{4}\frac{u^{11}}{11}=\frac{u^{11}}{44},$$ and conclude that $$\int (x^4+7)^{10}x^3\,dx=\int f(g(x))g'(x)\,dx=F(g(x))+C=\frac{(x^4+7)^{11}}{44}+C.$$ Note: In principle, instead of the solution just presented, we can expand the integrand and (after a a long computation) get $$(x^4+7)^{10}x^3=x^{43}+70 x^{39}+2205 x^{35}+41160 x^{31}+504210 x^{27}+4235364 x^{23}$$ $$+24706290 x^{19}+98825160 x^{15}+259416045 x^{11}+403536070 x^7+282475249 x^3.$$ Then, we can integrate the resulting polynomial and get the answer $$\int (x^4+7)^{10}x^3\,dx=\frac{x^{44}}{44}+\frac{7 x^{40}}{4}+\frac{245 x^{36}}{4}+\frac{5145 x^{32}}{4}+\frac{36015 x^{28}}{2}+\frac{352947 x^{24}}{2}$$ $$+\frac{2470629 x^{20}}{2}+\frac{12353145 x^{16}}{2}+\frac{86472015 x^{12}}{4}+\frac{201768035 x^8}{4}+\frac{282475249 x^4}{4} +C.$$

Evaluating integrals like those in examples 1 and 2 can be done very elegantly using differentials. Using the substitution $$u=g(x),$$ we have $$du=g'(x)\,dx$$ and so
$$\int \underbrace{f(g(x))}_{f(u)}\,\underbrace{g'(x)\,dx}_{du}=\int f(u) \,du = F(u)+C=F(g(x))+C.$$
Let us redo examples 1 and 2 using differentials.
Example 1: With the substitution $u=x^2+5$, we have $du=(x^2+5)'dx=2x\,dx$, and so $$\int \cos(x^2+5)2x\,dx=\int \cos(u)\,du=\sin(u)+C=\sin(x^2+5)+C.$$ Example 2: With the substitution $u=4^2+7$, we have $du=(x^4+7)'dx=4x^3\,dx$. Then $4x^3\,dx=\frac{1}{4}\,du$ and so $$\int (x^4+7)^{10}x^3\,dx=\int u^{10}\frac{1}{4}\,du=\frac{1}{4}\frac{u^{11}}{11}=\frac{u^{11}}{44}+C=\frac{(x^4+7)^{11}}{44}+C.$$
An advantage of working with differentials is that we avoid explictly naming the functions $f$, $F$ and $g$, which greatly reduces the amount of writing. For the remaining examples, we will be using differentials.

Example 3: Evaluate the indefinite integral $$I=\int \tan(x)\,dx.$$
Solution: Recall that $\tan(x)=\frac{\sin(x)}{\cos(x)}$ and that $\cos'(x)=-\sin(x)$. We use the substituion $u=\cos(x)$. Then $du=-\sin(x)\,dx$ and $\sin(x)\,dx=-du$. It follows that $$I=\int \frac{\sin(x)}{\cos(x)}\,dx=\int \frac{-1}{u}\, du=-\ln\abs{u}+C=\ln\abs{\frac{1}{u}}+C=\ln\abs{\frac{1}{\cos(x)}}+C=\ln\abs{\sec(x)}+C.$$ This adds an important antiderivative to our catalogue:
$$\int \tan(x)\,dx =\ln\abs{\sec(x)}+C$$
Note that the formula is valid on any interval that does not include a zero of $\cos(x)$, that is the interval is not allowed to include any of the numbers from the set $\set{\pm \pi /2, \pm 3\pi/2,\pm 5\pi/2,\pm 7\pi/2,\cdots}$.

Example 4: Evaluate the indefinite integral $$I=\int x^2\sqrt{2x+3}\,dx.$$
Solution: Let $u=2x+3$. Then $du=2\,dx$ and $dx=\frac{1}{2}\, du$ . In order to replace $x^2$ in the integral with an expression invloving $u$ only, we isolate $x$ from the substitution equation: $$u=2x+3 \qquad\Rightarrow\qquad x=\frac{u-3}{2}.$$ Then $$ \begin{equation*} \begin{split} I&=\int \of{\frac{u-3}{2}}^2\sqrt{u}\frac{1}{2}\,du \\ &=\int \frac{1}{8} (u-3)^2\sqrt{u}\, du \\ &=\int \frac{1}{8} (u^2-6u+9)\sqrt{u}\, du \\ &=\int \frac{1}{8} (u^{2.5}-6u^{1.5}+9 u^{0.5})\, du \\ &= \frac{1}{8} \of{\frac{u^{3.5}}{3.5}-6\frac{u^{2.5}}{2.5}+9 \frac{u^{1.5}}{1.5}}+C \\ &= \frac{1}{8} \of{\frac{(2x+3)^{3.5}}{3.5}-6\frac{(2x+3)^{2.5}}{2.5}+9 \frac{(2x+3)^{1.5}}{1.5}}+C \\ \end{split} \end{equation*} $$
Practice problems: Use the given substitution to evaluate the indefinite integrals.
  1. $\int (x^2+1)^3 2x\,dx,\qquad u=x^2+1$
  2. $\int (x^2+1)^3 x\,dx,\qquad u=x^2+1$
  3. $\int \sqrt{3x+2}\,dx,\qquad u=3x+2$
  4. $\int x\sqrt{x^2+1}\,dx,\qquad u=x^2+1$
  5. $\int \sqrt{1+\sin(x)}\cos(x)\,dx,\qquad u=1+\sin(x)$
  6. $\int \frac{x^2}{\sqrt{x^3+1}}\,dx,\qquad u=x^3+1$
  7. $\int x^2\sin(x^3+1)\,dx,\qquad u=x^3+1$
  8. $\int \sin^3(x)\cos(x)\,dx,\qquad u=\sin(x)$
  9. $\int \tan^2(x)\sec^2(x)\,dx,\qquad u=\tan(x)$
  10. $\int \frac{x}{(x-1)^3}\,dx,\qquad u=x-1$
You can find the solution to each problem in this excellent video on substitution by Selwin Hollis. The problems are worked out from 5:08 to 15:08. Note that in this video, the notation $du=u'(x)\,dx$ is used instead of our $du=g'(x)\,dx$. A complete set of video lectures on Calculus by Selwin Hollis can be found here.
The sustitution method gives us a very useful general formula in the case when $u$ is a nonconstant linear function $$u=mx+b,\qquad m\neq 0.$$ We have $du=m\,dx$, $dx=\frac{1}{m}\,du$, and so $$\int f(mx+b)\,dx = \int f(u)\frac{1}{m} \,du = \frac{1}{m}F(u)+C= \frac{1}{m}F(mx+b)+C.$$ We can summarize the computation as
$$\int f(x)\,dx = F(x)+C \qquad \Rightarrow\qquad \int f(mx+b)\,dx = \frac{1}{m}F(mx+b) +C.$$
Thus, if we already know an antiderivative of $f$, we get for free an antiderivative formula for $f(mx+b)$. For example, knowing that $\int \cos(x)\,dx=\sin(x)+C$, we conclude that $\int \cos(5x+3)\,dx=\frac{1}{5}\sin(5x+3)+C$, $\int \cos(2x)\,dx=\frac{1}{2}\sin(2x)+C$, and, more generally, $\int \cos(mx+b)\,dx=\frac{1}{m}\sin(mx+b)+C$. This adds new functions to our catalogue of antiderivatives:
Assuming that $m$ and $b$ are constants and that $m\neq 0$, we have:
$$ \begin{equation*} \begin{split} \int \cos(x)\,dx=\sin(x)+C\qquad &\Rightarrow\qquad \int \cos(mx+b)\,dx=\frac{1}{m}\sin(mx+b)+C \\ \int \sin(x)\,dx =-\cos(x)+C\qquad &\Rightarrow\qquad \int \sin(mx+b)\,dx=\frac{-1}{m}\cos(mx+b)+C \\ \int e^x\,dx =e^x+C\qquad &\Rightarrow\qquad \int e^{mx+b}\,dx=\frac{1}{m}e^{mx+b}+C \\ \int \frac{dx}{x}=\ln\abs{x}+C\qquad &\Rightarrow\qquad \int \frac{dx}{mx+b}=\frac{1}{m}\ln\abs{mx+b}+C \\ \int x^p\,dx=\frac{x^{p+1}}{p+1}+C\qquad &\Rightarrow\qquad \int (mx+b)^p\,dx=\frac{1}{m}\frac{(mx+b)^{p+1}}{p+1}+C \qquad (p\neq -1) \\ \int \frac{dx}{1+x^2}=\arctan(x)+C\qquad &\Rightarrow\qquad \int\frac{dx}{1+(mx+b)^2}=\frac{1}{m}\arctan(mx+b)+C \\ \end{split} \end{equation*} $$

Definite integrals

When $F'=f$, we have seen that $F(g(x))$ is an antiderivative of $f(g(x))g'(x)$. Using FTC2, we then have $$\int_a^b f(g(x))g'(x)\,dx=F(g(x))\Big|_a^b=F(g(b))-F(g(a)).$$ Also, $$\int_{g(a)}^{g(b)} f(u)\,du=F(u)\Big|_{g(a)}^{g(b)}=F(g(b))-F(g(a)).$$ It follows that
$$\int_a^b f(g(x))g'(x)\,dx=\int_{g(a)}^{g(b)} f(u)\,du,$$
which called the substitution formula for definite integrals. The substitutions $u=g(x)$ and $du=g'(x)\,dx$ are just what we did in the last section on indefinite integrals. The main new feature here with definite integrals is that the limits of integration have to be updated. In the $u$ - integral, the lower limit becomes $g(a)$, which is the value of $u$ corresponding to $x=a$, and the upper limit becomes $g(b)$, which is the value of $u$ corresponding to $x=b$.

Example 1: Evaluate the definite integral $$\int_0^1 \frac{2x}{x^2+1}\,dx.$$
Solution: We use the substitution $u=g(x)=x^2+1$. Then $du=2x\,dx$ and the limit of integration have to be updated as follows: $x=0 \to u=g(0)=0^2+1=1$ and $x=1 \to u=g(1)=1^2+1=2$. The substitution formula for definite integrals yields $$\int_0^1 \frac{2x}{x^2+1}\,dx = \int_1^2 \frac{1}{u}\,du=\ln(u)\Big|_1^2=\ln(2)-\ln(1)=\ln(2)-0=\ln(2).$$

Example 2: Evaluate the definite integral $$\int_0^\pi e^{\sin(x)}\cos(x)\,dx.$$
Solution: We use the substitution $u=g(x)=\sin(x)$. Then $du=\cos(x)\,dx$ and the limit of integration have to be updated as follows: $x=0 \to u=g(0)=\sin(0)$ and $x=\pi \to u=g(\pi)=\sin(\pi)=0$. The substitution formula for definite integrals yields $$\int_0^\pi e^{\sin(x)}\cos(x)\,dx = \int_0^0 e^{u}\,du=0.$$
Practice problems: Evaluate the definite integrals. You will have to decide yourself what substitution to use.
  1. $\int_0^2 \frac{x^2}{x^3+1}\,dx$
  2. $\int_0^{\pi/2}\sin^3(x)\cos(x)\,dx$
  3. $\int_0^{\pi/2}(x+1)\sqrt{1-x^2}\,dx$
You can find the solution to each problem in this excellent video on substitution by Selwin Hollis. The problems are worked out from 15:08 until the end of the video.