Show the introductory explanations

In the previous chapter, we learned the substitution rule for indefinite integrals. In summary, if we have an indefinite integral of the form \[ \int f(g(x))g'(x)dx \] we make the substitution \[ u=g(x),\qquad du=g'(x)dx \] and transform the integral to the form \[ \int f(\underbrace{g(x)}_{u})\underbrace{g'(x)dx}_{du}=\int f(u)du. \] In this section, we will learn how to evaluate definite integral of the form \[ \int _{a}^{b}f(g(x))g'(x)dx, \] by substitution. For example, suppose that we want to evaluate \[ \int _{1}^{e}\frac{\ln x}{x}dx. \] It follows from the second part of the Fundamental Theorem of Calculus that \[ \int _{1}^{e}\frac{\ln x}{x}dx=\left [\int \frac{\ln x}{x}dx\right ]_{1}^{e}. \] To evaluate the indefinite integral \(\int \frac{\ln x}{x}dx\), we make the substitution \[ u=\ln x,\qquad du=\frac{1}{x}dx \] which converts the indefinite integral to \begin{align*} \int \overbrace{\ln x}^{u}\overbrace{\frac{1}{x}dx}^{du} & =\int udu\\ & =\frac{1}{2}u^{2}+C\\ & =\frac{1}{2}(\ln x)^{2}+C. \end{align*}

Therefore, \begin{align*} \int _{1}^{e}\frac{\ln x}{x}dx & =\left [\int \frac{\ln x}{x}dx\right ]_{1}^{e}\\ & =\bigg [\frac{1}{2}(\ln x)^{2}\bigg ]_{1}^{e}\\ & =\frac{1}{2}\left [(\ln e)^{2}-(\ln 1)^{2}\right ]=\frac{1}{2}\left [1^{2}-0^{2}\right ]\\ & =\frac{1}{2}. \end{align*}

When integrating by the substitution of a new variable (\(u\) in the above example), it is sometimes rather troublesome to express the result in terms of the original variable (\(x\) in the above example). We may avoid the process of restoring the original variable if we change the limits of integration to correspond with the new variable.

In the above example, the lower limit of integration is \(x=1\), so in terms of \(u\), the lower limit becomes \(u=\ln 1=0\). The upper limit of integration is \(x=e\), so the upper limit of integration in terms of \(u\) becomes \(u=\ln e=1\). Therefore, \[ \int _{1}^{e}\frac{\ln x}{x}dx=\int _{0}^{1}udu=\left [\frac{1}{2}u^{2}\right ]_{0}^{1}=\frac{1}{2}, \] and we get the same result as
before.

Geometrically, the equation \[ \int _{1}^{e}\frac{\ln x}{x}dx=\int _{0}^{1}udu \] means that the two different regions shown in Figure 1 have the same area.


 

Figure 1: The area of each shaded region is \(1/2\).
 

 


There are two methods to evaluate a definite integral by substitution:

  1. First, find the corresponding indefinite integral by substitution, and then apply the second part of the Fundamental Theorem of Calculus.
  2. Directly use a substitution in the definite integral by changing both the variable and
    the limits of integration in one step, as stated in the following theorem:


Theorem 1.
(Substitution in Definite Integrals): If the function \(u=g(x)\) has a continuous derivative on the interval \([a,b]\) and \(f\) is continuous on the range of \(g\), then \[ \int _{a}^{b}f(g(x))g'(x)dx=\int _{u=g(a)}^{u=g(b)}f(u)du.\qquad \left (u=g(x)\right ) \]

Show the proof


Proof. Let \(F\) be an integral (or an antiderivative) of \(f\). Then it follows from the chain rule that \begin{align*} \frac{d}{dx}F(g(x)) & =F'(g(x))g'(x)\\ & =f(g(x))g'(x); \end{align*}

that is, \(F(g(x))\) is an antiderivative of \(f(g(x))g'(x)\). Therefore, it follows from the second part of the Fundamental Theorem of Calculus that \begin{align*} \int _{a}^{b}f(g(x))g'(x)dx & =F(g(x)\bigg ]_{x=a}^{x=b}\\ & =F(g(b))-F(g(a))\\ & =F(u)\bigg ]_{u=g(a)}^{u=g(b)}\\ & =\int _{g(a)}^{g(b)}f(u)du. \end{align*}

 

Example 1
Evaluate \[ \int _{0}^{3}x\sqrt{1+x}\ dx. \]

Solution
Method (a): An appropriate substitution is \(u=1+x\) or \(x=u-1\). Then \[ du=dx \] and \begin{align*} \int \overbrace{x}^{u-1}\overbrace{\sqrt{1+x}}^{\sqrt{u}}\ \overbrace{dx}^{du} & =\int (u-1)\sqrt{u}\ du\\ & =\frac{2}{5}u^{5/2}-\frac{2}{3}u^{3/2}\\ & =\frac{2}{5}(1+x)^{5/2}-\frac{2}{3}(1+x)^{3/2}. \end{align*}

Therefore, \begin{align*} \int _{0}^{3}x\sqrt{1+x}\ dx & =\left [\frac{2}{5}(1+x)^{5/2}-\frac{2}{3}(1+x)^{3/2}\right ]_{x=0}^{x=3}\\ & =\frac{2}{5}(4^{5/2})-\frac{2}{3}(4^{3/2})-\frac{2}{5}+\frac{2}{3}\\ & =\frac{116}{15}. \end{align*}

Method (b): Change the variable of integration to \(u=1+x\) and the limits of integration to correspond with \(u\) simultaneously:

The lower limit: When \(x=0\), \(u=1+0=1\).

The upper limit: When \(x=3\), \(u=1+3=4\) .

Therefore, \begin{align*} \int _{0}^{3}x\sqrt{1+x}\ dx & =\int _{1}^{4}(u-1)\sqrt{u}\ du\\ & =\left [\frac{2}{5}u^{5/2}-\frac{2}{3}u^{3/2}\right ]_{u=1}^{u=4}\\ & =\left (\frac{2}{5}(\sqrt{4})^{5}-\frac{2}{3}(\sqrt{4})^{3}\right )-\left (\frac{2}{5}(1)-\frac{2}{3}(1)\right )\\ & =\frac{116}{15}. \end{align*}

  • The previous example has been solved by two different methods. In method (a), first the indefinite integral is evaluated using the Substitution Rule or \(u\)-substitution (this theorem), and then original limits are used. In method (b), the transformed definite integral with transformed limits is evaluated using the Substitution in Definite Integrals (Theorem 1). There is no general rule to say which method is easier.

Example 2
Evaluate \(\displaystyle \int _{0}^{\pi /2}\frac{\cos x}{1+\sin ^{2}x}dx.\)

Solution
Method (a): Because both \(\sin x\) and its derivative \(\cos x\) appear in the integrand, we may try the substitution \(u=\sin x\). So \[ u=\sin x\Rightarrow du=\cos x\,dx \] and \begin{align*} \int \frac{\overbrace{\cos x\:dx}^{du}}{1+\underbrace{\sin ^{2}x}_{u^{2}}} & =\int \frac{du}{1+u^{2}}\\ & =\arctan u+C\\ & =\arctan (\sin x)+C.\tag{$u=\sin x$} \end{align*}

Therefore, \[ \int _{0}^{\pi /2}\frac{\cos x}{1+\sin ^{2}x}dx=\arctan (\sin x)\bigg ]_{x=0}^{x=\pi /2}=\arctan \big (\underbrace{\sin \frac{\pi }{2}}_{1}\big )-\arctan (\sin 0)=\frac{\pi }{4}. \] Method (b): Change both the variable and limits of integration: \[ u=\sin x,\qquad du=\cos x\,dx \]

The lower limit: When \(x=0\), \(u=\sin 0=0\).

The upper limit: When \(x=\frac{\pi }{2}\), \(u=\sin \frac{\pi }{2}=1\).

Therefore \[{\displaystyle \int _{0}^{\pi /2}\frac{\cos x}{1+\sin ^{2}x}dx=\int _{0}^{1}\frac{du}{1+u^{2}}=\arctan u\bigg ]_{u=0}^{u=1}=\arctan 1-\arctan 0=\frac{\pi }{4}-0=\frac{\pi }{4}.} \]

Example 3

Evaluate \({\displaystyle \int _{0}^{5}\frac{x}{\sqrt [3]{x^{2}+2}}}dx\).

Solution
Method (a): Let \[ u=x^{2}+2,\qquad du=2xdx. \] Then \begin{align*} \int \frac{x}{\sqrt [3]{x^{2}+2}}dx & =\int \frac{1}{\sqrt [3]{u}}\overbrace{\frac{du}{2}}^{xdx}=\frac{1}{2}\int u^{-1/3}du\\ & =\frac{1}{2}\times \frac{3}{2}u^{2/3}\\ & =\frac{3}{4}(x^{2}+2)^{2/3}+C\tag{$u=x^{2}+2$} \end{align*}

Therefore, \begin{align*}{\displaystyle \int _{0}^{5}x\sqrt [3]{x^{2}+2}}dx & =\frac{3}{4}(x^{2}+2)^{2/3}\bigg ]_{0}^{5}\\ & =\frac{3}{4}\left (27^{2/3}-2^{2/3}\right )=\frac{3}{4}\left (9-\sqrt [3]{4}\right ) \end{align*}

Method (b): Let \[ u=x^{2}+2,\qquad du=2xdx. \] The lower and upper limits: When \(x=0\), \(u=2\), and when \(x=5\), \(u=27\). Therefore, \begin{align*} \int _{0}^{5}\frac{x}{\sqrt [3]{x^{2}+2}}dx & =\frac{1}{2}\int _{2}^{27}u^{-1/3}du\\ & =\frac{1}{2}\times \frac{3}{2}u^{2/3}\bigg ]_{2}^{27}\\ & =\frac{3}{4}\left (27^{2/3}-2^{2/3}\right )\\ & =\frac{3}{4}\left (9-\sqrt [3]{4}\right ) \end{align*}

Example 4
Evaluate \[ \int _{0}^{3}\frac{x-2}{\sqrt{5x+1}}dx. \]

Solution
Let \(u=5x+1\) or \(x=(u-1)/5\). Then \[ dx=\frac{1}{5}du. \] The lower limit: When \(x=0\), we have \[ u=5(0)+1=1, \] The upper limit: when \(x=3\), we have \[ u=5(3)+1=16. \]

Therefore, \begin{align*} \int _{0}^{3}\frac{x-2}{\sqrt{5x+1}}dx & =\int _{1}^{16}\frac{\frac{u-1}{5}-2}{\sqrt{u}}\underbrace{\frac{du}{5}}_{dx}\\ \\ & =\frac{1}{25}\int _{1}^{16}\frac{u-11}{\sqrt{u}}du\\ \\ & =\frac{1}{25}\int _{1}^{16}(u^{1/2}-11u^{-1/2})du\\ & =\frac{1}{25}\left [\frac{2}{3}u^{3/2}-22u^{1/2}\right ]_{1}^{16}\\ & =\frac{1}{25}\left [\left (\frac{2}{3}(4^{3})-22(4)\right )-\left (\frac{2}{3}-22\right )\right ]\\ & =-\frac{24}{25} \end{align*}

A different substitution: Another substitution that also works is \(u=\sqrt{5x+1}\) or \[ u^{2}=5x+1. \] Taking the differential of each side we get \[ 2u\ du=5dx \] or \[ dx=\frac{2}{5}u\ du. \] The numerator can be written in terms of \(u\) as \[ x-2=\frac{1}{5}(u^{2}-1)-2=\frac{u^{2}-11}{5} \] The upper and lower limits
in terms of \(u\) are \[ x=3\Rightarrow u=\sqrt{5(3)+1}=4 \] \[ x=0\Rightarrow u=\sqrt{5(0)+1}=1 \] Therefore \begin{align*} \int _{0}^{3}\frac{x-2}{\sqrt{5x+1}}dx & =\int _{1}^{4}\frac{u^{2}-11}{5u}\left (\frac{2}{5}u\ du\right )\\ & =\frac{2}{25}\int _{1}^{4}(u^{2}-11)du\\ & =\frac{2}{25}\left [\frac{1}{3}u^{3}-11u\right ]_{u=1}^{u=4}\\ & =\frac{2}{25}\left [\left (\frac{1}{3}(4^{3})-11(4)\right )-\left (\frac{1}{3}(1^{3})-11(1)\right )\right ]\\ & =-\frac{24}{25}. \end{align*}

  • When evaluating a definite integral by substitution, it is possible that the upper limit in terms of the new variable becomes smaller than the lower limit. See the following example:

Example 5
 Evaluate \({\displaystyle \int _{0}^{1}\frac{x}{\sqrt{1-x^{2}}}dx}.\)

Solution
Let \(u=1-x^{2}\). Then \[ du=-2xdx\qquad \text{or}\qquad xdx=-\frac{1}{2}du \]

The lower limit: When \(x=0\), \(u=1\).

The upper limit: When \(x=1\), \(u=0\).

Therefore, \begin{align*} \int _{0}^{1}\frac{x}{\sqrt{1-x^{2}}}dx & =\int _{1}^{0}\frac{\overbrace{-\frac{1}{2}du}^{xdx}}{\sqrt{u}}\\ & =-\frac{1}{2}\int _{1}^{0}u^{-1/2}du\\ & =-\frac{1}{2}\times 2u^{1/2}\bigg ]_{1}^{0}\\ & =-(0-1)=1. \end{align*}

  • The original variable of integration is not always \(x\), and we do not have to call the new variable \(u\). See the following example:

Example 6
Evaluate \(\displaystyle \int _{0}^{16}\frac{\sqrt [4]{z}}{1+\sqrt{z}}dz.\)

Solution
To get rid of the roots, we let \[ t=\sqrt [4]{z},\qquad \text{or}\qquad z=t^{4}. \] Taking the differential of each side, we obtain \[ dz=4t^{3}dt. \] When \(z=0\),

\(t=\sqrt [4]{0}=0\), and when \(z=16\), \(t=\sqrt [4]{16}=2\). Therefore, \begin{align*} \int _{0}^{16}\frac{\sqrt [4]{z}}{1+\sqrt{z}}dz & =\int _{0}^{2}\frac{t}{1+\sqrt{t^{4}}}\overbrace{4t^{3}dt}^{du}\\ & =4\int _{0}^{2}\frac{t^{4}}{1+t^{2}}dt\\ & =4\int _{0}^{2}\frac{t^{4}-1+1}{1+t^{2}}dt\\ & =4\int _{0}^{2}\left [\frac{(t^{2}-1)(t^{2}+1)}{1+t^{2}}+\frac{1}{1+t^{2}}\right ]dt\\ & =4\int _{0}^{2}\left [t^{2}-1+\frac{1}{1+t^{2}}\right ]dt\\ & =4\left [\frac{t^{3}}{3}-t+\arctan t\right ]_{0}^{2}\\ & =\frac{4}{3}\times 8-4\times 2+4\arctan 2\\ & =\frac{8}{3}+4\arctan 2. \end{align*}

Example 7
Evaluate \(\displaystyle \int _{0}^{2}\frac{r^{3}}{\sqrt [3]{r^{2}+8}}dr.\)

Solution
To get rid of the cubic root let \(u^{3}=r^{2}+8\) . Taking the differential of each side of this substitution, we obtain \[ 3u^{2}du=2r\,dr. \]

The upper limit: When \(r=0\), \(u^{3}=8\) or \(u=2\).

The lower limit: When \(r=2\), \(u^{3}=12\) or \(u=\sqrt [3]{12}\).

Therefore,

\begin{align*} \int _{0}^{2}\frac{r^{2}}{\sqrt [3]{r^{2}+8}}rdr & =\int _{2}^{\sqrt [3]{12}}\frac{\overbrace{u^{3}-8}^{r^{2}}}{{\underbrace{u}_{\sqrt [3]{r^{2}+8}}}}\overbrace{\frac{3}{2}u^{2}du}^{rdr}\\ & =\frac{3}{2}\int _{2}^{\sqrt [3]{12}}(u^{4}-8u)udu\tag{simplify}\\ & =\frac{3}{2}\left [\frac{1}{5}u^{5}-4u^{2}\right ]_{2}^{\sqrt [3]{12}}\\ & =\frac{3}{10}\left [u^{2}(u^{3}-20)\right ]_{2}^{\sqrt [3]{12}}\\ & =\frac{3}{10}\left (12^{2/3}(12-20)-4(8-20)\right )\\ & =\frac{3}{10}\left (48-8\times 12^{2/3}\right )\\ & =\frac{3}{10}\left (48-16\times 2^{1/3}\times 3^{2/3}\right ) \end{align*}

Different substitution: Another substitution: that also works is \(u=r^{2}+8\): \[ u=r^{2}+8\qquad \Longrightarrow \qquad du=2r\,dr \]

The lower limit: When \(r=0\), \(u=8\).

The upper limit: When \(r=2\), \(u=12.\) \begin{align*} \int _{0}^{2}\frac{r^{2}}{\sqrt [3]{r^{2}+8}}rdr & =\int _{8}^{12}\frac{u-8}{u^{1/3}}\cdot \frac{1}{2}du\\ & =\frac{1}{2}\int _{8}^{12}\left (u^{2/3}-8u^{-1/3}\right )du\\ & =\frac{1}{2}\left [\frac{3}{5}u^{5/3}-12u^{2/3}\right ]_{8}^{12}\\ & =\frac{3}{10}\left [u^{2/3}(u-20)\right ]_{8}^{12}\\ & =\frac{3}{10}\left (12^{2/3}\times (-8)-\overset{4}{\cancel{8^{2/3}}}\times (-12)\right )\\ & =\frac{3}{10}\left (48-16\times 2^{1/3}\times 3^{2/3}\right ). \end{align*}

Geometric Interpretation

Show the geometric interpretation

So far, we have learned the substitution for definite integrals is \[ \int _{a}^{b}f(g(x))g'(x)dx=\int _{g(a)}^{g(b)}f(u)du.\tag{i} \] Instead of thinking of this rule as an algebraic consequence of the chain rule, let’s see what it means geometrically.

For convenience, assume that:

  • \(a<b\),
  • \(f(x)>0\), and
  • \(g\) is an increasing function; that is, \(g'(x)>0\).

Let’s represent \(g\) with a separate domain and range, as in Figure 2. The function \(g\) maps the interval \([a,b]\) on the \(x\)-axis to the interval \([g(a),g(b)]\) on the \(u\)-axis. Now let’s subdivide the interval \([a,b]\) by \(a=x_{0},x_{1},\dots ,x_{n}=b\). The images of the points \(x_{0},\dots ,x_{n}\) under \(g\) are \[ u_{0}=g(x_{0}),u_{1}=g(x_{1}),\dots ,u_{n}=g(x_{n}) \] on the \(u\)-axis. Specifically, the image of the subinterval \([x_{i-1},x_{i}]\) under \(g\) is the subinterval \([g(x_{i-1}),g(x_{i})]\).

Figure 2

 

Even if the division points \(x_{0},\dots ,x_{n}\) are equally spaced, those image subintervals on the \(u\)-axis will not all have the same width. In fact, the width of \([u,u+\Delta u]\) is approximately \(g'(x)\) times the width of \([x,x+\Delta x]\) because by using linear approximation (Figure 3) we have \[ \Delta u\approx g'(x)\Delta x. \] The approximation becomes equality and \(\Delta u\to du=g'(x)dx\) as \(\Delta x=dx\to 0\). If \(g'(x)>1\), then the image of each subinterval on the \(x\)-axis is stretched on the \(u\)-axis and if \(0<g'(x)<1\), the image of each subinterval is compressed on the \(u\)-axis.

Figure 3

Now let’s compare the graphs of \(f\circ g\) and \(f\) (Figure 4). Notice that the value of \(f\circ g\) at \(x_{i}\) is the same as the value of \(f\) at \(u_{i}\) \begin{align*} f\circ g(x_{i}) & =f(g(x_{i}))\\ & =f(u_{i}).\tag{$u_{i}=g(x_{i})$} \end{align*}

 

Figure 4

 

Therefore, the rectangle with the corners \((x_{i},0),(x_{i}+\Delta x,0),(x_{i},f\circ g(x_{i})),\) and \((x_{i}+\Delta x,f\circ g(x_{i}))\) under the graph of \(f\circ g\) and the rectangle with the corners \((u_{i},0),(u_{i}+\Delta u,0),(u_{i},f(u_{i}))\) and \((u_{i}+\Delta u,f(u_{i}))\) under the graph of \(f\) have the same height but the width of the second one is approximately \(g'(x_{i})\Delta x\) (Figure 5). So if we multiply the height of the first rectangle by \(g'(x_{i})\) then both rectangles will have the same area (Figure 5).

Figure 5

In other words, the role of \(g'(x)\) in the formula \[ \int _{a}^{b}f(g(x))g'(x)dx=\int _{g(a)}^{g(b)}f(u)du \] is to cancel the change in the width by the change in the height such that the net signed areas remain the same (Figure 6).

Figure 6
 

For example, let \(f(u)=1.5\) for \(0\leq u\leq 4\) and \(u=g(x)=x^{2}\). Then \(g\) maps the interval \([0,2]\) to \([0,4]\). Figure 7 shows the graphs of \(f(u),\) \(f\circ g(x)\), and \((f\circ g)(x)g'(x)\). Because \(f\) is a constant function, then \[ \int _{0}^{4}f(u)du=1.5\times 4=6 \] and \[ \int _{0}^{2}f(g(x))dx=1.5\times 2=3. \]

Figure 7

We notice that \(g'(x)=2x\) and \[ 0\leq g'(x)\leq 1,\qquad \text{when }0\leq x\leq \frac{1}{2}. \] The function \(g\) maps the interval \([0,\frac{1}{2}]\) on the \(x\)-axis to a smaller interval \([0,\frac{1}{4}]\) on the \(u\)-axis. In fact, \(g\) maps any subinterval of \([0,\frac{1}{2}]\) to a smaller interval because by the Mean-Value Theorem we have \[ |u_{2}-u_{1}|=|g(x_{2})-g(x_{1})|=\underbrace{|g'(c)|}_{\leq 1}\ |x_{2}-x_{1}|\leq |x_{2}-x_{1}|, \] for every \(x_{1},x_{2}\in [0,\frac{1}{2}]\) and some \(c\) between \(x_{1}\) and \(x_{2}\). The area under graph of \(f\circ g\) on the interval \([0,\frac{1}{2}]\) is twice the area under the graph of \(f\) on the interval \([0,\frac{1}{4}]\) (compare the shaded areas in Figure 7(a) and (b)). If we multiply \(f\circ g\) by \(g'(x)=2x\), then the graph \((f\circ g)g'(x)\) is a straight line whose area on the interval \([0,\frac{1}{2}]\) is exactly the same as the area under the graph of \(f\) on the interval \([0,\frac{1}{4}]\) (compare the shaded areas in Figure 7(a) and (c)).

On the other hand, because \[ 1<g'(x)\qquad \text{when }x>\frac{1}{2}, \] for every \(x_{1},x_{2}\) in \([\frac{1}{2},2]\), the image of \([x_{1},x_{2}]\) under \(g\) is a larger interval \([g(x_{1}),g(x_{2})]\) \[ |u_{2}-u_{1}|=|g(x_{2})-g(x_{1})|=\underbrace{\left |g'(c^{*})\right |}_{>1}\,\left |x_{2}-x_{1}\right |\geq |x_{2}-x_{1}|. \] Therefore, the area under the graph of \(f\circ g\) on the interval \([x_{1},x_{2}]\) is less than the area under the graph of \(f\) on the interval \([g(x_{1}),g(x_{2})]\). Again multiplying \(f\circ g\) by \(g'(x)\) makes the area under \((f\circ g)g’\) on \([x_{1},x_{2}]\) equal to the area under \(f\) on \([g(x_{1}),g(x_{2})]\).

  • If \(g\) is a decreasing function, then \(g'(x)<0\), and \(g(b)<g(a)\). Therefore, if \(f\) is a positive function, then both of the integrals on the left-hand side and on the right-hand side of Equation (i) are negative. The integral on the left hand-side is negative because  \(\underbrace{f(g(x))}_{>0}\underbrace{g'(x)}_{<0}<0\) and the integral on the right-hand side is negative because \(g(a)>g(b),\) and \[ \int _{{\color{blue}g(a)}}^{{\color{red}g(b)}}f(u)du=-\underbrace{\int _{{\color{red}g(b)}}^{{\color{blue}g(a)}}f(u)du}_{>0}. \]
  • Note that in Theorem 1, \(g\) does not have to be a one-to-one function. Let’s see what will happen if \(g\) is not a one-to-one function through an example. Suppose \(f(u)=1\) for \(1\leq u\leq 4\). Then \[ \int _{1}^{4}f(u)du=\int _{1}^{4}du=3. \] Now consider \(g:[-1,2]\to \mathbb{R}\) and \(h:[1,2]\to \mathbb{R}\) with \[ u=g(x)=h(x)=x^{2}. \]
 Figure 8: Both \(g\) and \(h\) map the endpoints of their domains to \(u=1\) and \(u=4\).

 

Notice that \(g(-1)=h(1)=1\) and \(g(2)=h(2)=4\) (see Figure 8). Unlike \(h\), the function \(g\) is not one-to-one. If we integrate \(f(g(x))g'(x)\) on the domain of \(g\) and \(f(h(x))h'(x)\) on the domain of \(h\), both integrals will be equal to \(\int _{1}^{4}f(u)du\): \[ \int _{-1}^{2}f(g(x))g'(x)dx=\int_{-1}^{2}(1)(2x)dx=x^{2}\big |_{-1}^{2}=2^{2}-(-1)^{2}=3, \] \[ \int _{1}^{2}f(h(x))h'(x)dx=\int _{1}^{2}(1)(2x)dx=x^{2}\big |_{1}^{2}=2^{2}-1^{2}=3. \] We notice that \[ Dom(g)=Dom(h)\cup [-1,1], \] the function \(g\) is decreasing on \([-1,0]\) and increasing on \([0,1]\), and \[ \int _{-1}^{0}f(g(x))g'(x)dx=-\int _{0}^{1}f(g(x))g'(x)dx \] \[ \Rightarrow \int _{-1}^{1}f(g(x))g'(x)dx=\int _{-1}^{0}f(g(x))g'(x)dx+\int _{0}^{1}f(g(x))g'(x)dx=0. \] Therefore, \[ \int _{-1}^{2}f(g(x))g'(x)dx=\overset{0}{\cancel{\int _{-1}^{1}f(g(x))g'(x)dx}}+\underbrace{\int _{1}^{2}f(g(x))g'(x)dx}_{g(x)=h(x)\text{ on }[1,2]}. \] In general, in Theorem 1, if \(g\) is not a one-to-one function, then the value of the integral on the intervals in which \(g\) is increasing and on the intervals in which \(g\) is decreasing balance each other such that the total value of the integral of \(f(g(x))g'(x)\) on the entire interval \([a,b]\) will be equal to \(\displaystyle \int _{g(a)}^{g(b)}f(u)du\). See Figure 9.
      

(a)
\(\int _{0}^{1}f(g(x))g'(x)dx\) cancel
out \(\int _{-1}^{0}f(g(x))g'(x)dx\)
(b) (c)
Figure 9: All of the shaded regions have the same net area.