Chapter 6 Techniques of Integration
Even in the games of children there are things to interest the greatest mathematician.
— Gottfried Wilhelm Leibniz
6.1 Expanding our Toolbox
So far, we have created a sort of integral cookbook which allows us to evaluate a very small set of integrals. This chapter covers a collection of techniques for solving more complex integrals. These are critical for solving real-world problems like those discussed in the relationship between Calculus and Physics in Chapter 11.
6.2 u-substitution (Integration Chain Rule)
Let’s suppose I encounter the integral \(\int x e^{x^2} \, dx\) in the wild (indeed, it is a common integral). The only tool we have currently available is the Fundamental Theorem of Calculus. For this problem, we would need to find a function \(F(x)\) such that
\[\frac{dF}{dx} = xe^{x^2}\]
Finding such a function is not easy. We should devise some new method that would allow us to determine the antiderivative for a function like \(f(x) = x e^{x^2}\). Our first tool will be the integration edition of the chain rule which we saw in Chapter 3, 3.4.3.
Recall that the chain rule for derivatives is given by
\[\frac{d}{dx} f(g(x)) = f'(g(x)) g'(x)\]
If we integrate both sides with respect to \(x\), we have
\[\int_{a}^{b} \frac{d}{dx} f(g(x)) \, dx = \int_{a}^{b} f'(g(x)) g'(x) \, dx\]
By the Fundamental Theorem of Calculus, the left side becomes
\[f(g(b)) - f(g(a)) = \int_{a}^{b} f'(g(x)) g'(x) \, dx\] This formula is very important, so we include it as a theorem:
Theorem 6.1 (Integration Chain Rule) Let \(f(x)\) and \(g(x)\) be differentiable functions. Then
\[\begin{equation} \int_{a}^{b} f'(g(x))g'(x)\, dx = f(g(b)) - f(g(a)) \end{equation}\]
This may look horribly confusing, but don’t worry: we will first provide an example, then we will illustrate what the formula really means. It’s difficult to overstate its importance: it is the most valuable method for evaluating integrals.
Example 6.1 (u-substitution, Example 1) Integrate the function \(f(x) = e^{\sin x}\cos x\) from \(x = -2\) to \(x = 7\). That is, evaluate the integral
\[\int_{-2}^{7} e^{\sin x}\cos x \, dx\]
This integral seems to be a scary one. We can integrate \(\sin x\), \(\cos x\), and \(e^x\) on their own, but it seems very difficult to integrate any function involving \(e^{\sin x}\). In fact, \(u\)-substitutions make evaluating this integral quite simple.
Referring to 6.1, we are going to let \(f(x) = e^x\) and \(g(x) = \sin x\). Therefore, we have \(f(g(x)) = e^{\sin x}\). Moreover, the derivative of sine is cosine, so \(g'(x) = \cos x\). Therefore, we have
\[\int_{-2}^{7} e^{\sin x} \cos x \, dx = \int_{-2}^{7} f(g(x)) g'(x) \, dx = f(g(7)) - f(g(-2))\]
\[= e^{\sin(7)} - e^{\sin(-2)} \approx 1.5262\]
Almost like magic! Note that as \(n\rightarrow \infty\) in the diagram above, the Riemann sum approaches \(1.5262\), as we just found.
You may be wondering why we call this technique u-substitution. This involves rewriting 6.1. Suppose we were interested in evaluating an integral of the form
\[\int_{a}^{b} f(g(x)) g'(x) \, dx\]
We want to integrate with respect to a new variable, which we will call \(u\). In particular, we can reduce \(f(g(x))\) to \(f(u)\) by letting \(u = g(x)\).
Furthermore, if we take a derivative with respect to \(x\), we have \(\frac{du}{dx} = g'(x)\). If we multiply by \(dx\) on both sides, we have \(du = g'(x) dx\).
Two more pieces need to be changed: the limits of integration. If \(x\) goes from \(a\) to \(b\), then it must be that \(u = g(x)\) goes from \(g(a)\) to \(g(b)\). Therefore, we have the following:
\[\int_{a}^{b} \underbrace{f(g(x))}_{f(u)} \underbrace{g'(x) \, dx}_{du} = \int_{g(a)}^{g(b)} f(u) \, du\]
This is the form that u-substitution is normally taught. It is really identical to 6.1, but we will include it as a separate theorem.
Theorem 6.2 (u Substitution) Suppose we wish to evaluate an integral of the form
\[\begin{equation} \int_{a}^{b} f(g(x)) g'(x) \, dx \end{equation}\]
Then define a new variable \(u = g(x)\). Then \(\frac{du}{dx} = g'(x) \Rightarrow du = g'(x) dx\), so
\[\begin{equation} \int_{a}^{b} f(g(x)) g'(x) \, dx = \int_{g(a)}^{g(b)} f(u) du \end{equation}\]
We provide another example of this technique, then we provide an illustration for how we ought to visualize u-substitution.
Example 6.2 (u-subtitution, Example 2) Find the antiderivative of the function \(f(x) = \tan x\).
We want to determine
\[\int \tan x \, dx\]
Recall from Chapter 1 that \(\tan x = \frac{\sin x}{\cos x}\) (1.4.1). We replace the left hand side with the right and find
\[\int \tan x \, dx = \int \frac{\sin x}{\cos x} \, dx\]
Now we can use u-substitution. We define a new variable \(u\) with \(u = \cos x\). Recall that \(\frac{d}{dx}\cos x = -\sin x\) (3.3.4). Therefore, \(\frac{du}{dx} = -\sin x \Rightarrow du = -\sin x dx\). Therefore, we have
\[\int\underbrace{\frac{1}{\cos x}}_{1/u}\underbrace{\sin x \, dx}_{-du} = -\int\frac{1}{u}\, du\] Where we pulled the negative sign out of the integral. Recall that \(\frac{d}{du} \ln u = \frac{1}{u}\). Therefore, we have
\[\int \tan x \, dx = -\int \frac{1}{u} \, du = -\ln u + C\]
Remember that we set \(u = \cos x\). Therefore, we finally have
\[\int \tan x \, dx = -\ln\left(\cos x \right) + C\]
Notice that u-substitution allowed us to compute an integral that would have otherwise been impossible.
6.3 Visualizing u substitutions
How do we visualize theorem 6.1? We can use some examples to convince ourselves that \(u\)-substitutions actually work. Consider the diagram below:
Example 6.3 (u-substitution, Example 2) We wish to evaluate \(f(x) = xe^{-x^2}\) from \(x=1\) to \(x=2\). We can use \(u\)-substitution to reduce this function to a simpler form, one whose integral we can easily compute.
We use the integral and \(u\)-substitution as follows
\[\int_{1}^{2} 5xe^{-x^2} \, dx; \hspace{3mm} u = x^2 \Rightarrow \frac{du}{dx} = 2x, \hspace{1.5mm}\text{so}\hspace{1.5mm} \frac{1}{2}du = x dx\]
This first integral is from \(x = 1\) to \(x = 2\). Because \(u = x^2\), our integral will now extend from \(u = 1^2 = 1\) to \(u = 2^2 = 4\). Therefore, our integral takes the following form
\[\int_{1}^{2} 5 e^{-x^2} (x\, dx) = \int_{1}^{4} 5e^{-u} \frac{1}{2}\, du = \frac{5}{2}\int_{1}^{4} e^{-u} \, du\]
With this \(u\)-substitution, we have reduced an integral that would have been intractable, \(f(x) = 5xe^{-x^2}\), to one that is accessible, \(g(x) = \frac{5}{2}e^{-x}\). Evaluating the integral on the right, we have
\[\frac{5}{2}\int_{1}^{4} e^{-u} \, du = -\frac{5}{2}e^{-u}\hspace{1mm}\bigg|_{1}^{4} = -\frac{5}{2}e^{-4} + \frac{5}{2}e^{-1} \approx 0.8739\]
The critical thing to notice here is that the selection of \(x = 1\) to \(x = 2\) is arbitrary. Indeed, as the illustration shows,
\[\int_{a}^{b} 5xe^{-x^2} \, dx = \int_{a^2}^{b^2} \frac{5}{2} e^{-x} \, dx\]
This is the primary power of u-substitution. We wish to reduce a more complicated function to one whose integral is more easily computable.
6.4 Integration by Parts (Integration Product Rule)
Next, we devise a tool which is the integration edition of the product rule for derivatives, 3.4.2. We start by expressing the product rule:
\[ \frac{d}{dx}\left[f(x) g(x) \right] = f'(x)g(x) + f(x) g'(x)\]
We integrate this function on both sides from \(x = a\) to \(x = b\). This gives us
\[\int_{a}^{b} \frac{d}{dx}\left[f(x) g(x)\right] \, dx = \int_{a}^{b} f'(x) g(x) \, dx + \int_{a}^{b} f(x) g'(x) \, dx \]
By the Fundamental Theorem of Calculus, the integral and derivative undo each other (5.1). Therefore, we have
\[f(b)g(b) - f(a)g(a) = f(x)g(x)\big|_{a}^{b} = \int_{a}^{b} f'(x)g(x) \, dx + \int_{a}^{b} f(x) g'(x) \, dx\]
If we subtract the second integral on both sides, we have
\[\int_{a}^{b}f(x) g'(x) \, dx = f(x)g(x)\big|_{a}^{b} - \int_{a}^{b} f'(x) g(x) \, dx\]
This is another important technique. It is so important, in fact, that we include it as a theorem.
Theorem 6.3 (Integration by Parts) Suppose we wish to evaluate an integral of the form
\[\begin{equation} \int_{a}^{b} f(x) g'(x) \, dx \end{equation}\]
We can change the function with the derivative, with the cost of an additional \(f(x) g(x)\big|_{a}^{b}\) term:
\[\int_{a}^{b} f(x)g'(x) \, dx = f(x)g(x)\big|_{a}^{b} - \int_{a}^{b} f'(x)g(x)\, dx\]
We provide a few examples of using integration by parts to evaluate otherwise intractable integrals.
Example 6.4 (Integration by Parts, Example 1) Integrate the function \(f(x) = x\cos x\) from \(a = 0\) to \(b = 3\pi\).
We wish to evaluate
\[\int_{0}^{3\pi} x\cos x \, dx\] In the integral above, we define \(f(x) = x\) and \(g'(x) = \cos x\). Now we must take the derivative of \(f(x)\) and the integral of \(g'(x)\). We have the following
\[f'(x) = 1 \hspace{5mm}\text{and}\hspace{5mm} g(x) = \int \cos x\, dx = \sin x \]
Now we can apply integration by parts, 6.3. We have
\[\int_{0}^{3\pi} \underbrace{x}_{f(x)}\underbrace{\cos x}_{g'(x)} \, dx = \underbrace{x}_{f(x)}\underbrace{\sin x}_{g(x)}\bigg|_{0}^{3\pi} - \int_{0}^{3\pi} \underbrace{1}_{f'(x)}\cdot \underbrace{\sin x}_{g(x)}\, dx\]
The first term on the right side is
\[x\sin x\bigg|_{0}^{3\pi} = 3\pi\sin 3\pi- 0\sin 0 = 3\pi\sin 3\pi\]
The second term on the right side is an integral we know (??). Therefore, we have
\[ \int_{0}^{3\pi} \sin x\, dx = -\cos x\bigg|_{0}^{3\pi} = -\cos 3\pi- (-\cos 0) = 1 - \cos 3\pi \] Putting everything together, we have
\[\int_{0}^{3 \pi} x\cos x\, dx = 3\pi\sin 3\pi - 1 + \cos 3\pi = -2\]
Indeed, if you let \(n\) become larger and larger in the illustration above, you will find that it converges to \(-2\), as we just computed by hand.
6.5 Visualizing Integration by Parts
As always, we don’t want to only know formulas. We want to understand where they came from, in every sense: we want formulas and diagrams. Below is the diagram we will use to understand the integration by parts formula, 6.3.
In this little demonstration, we will be using a technique that we have not encountered so far called parametric equations (See Chapter 11). Don’t worry that we’ve not encountered it yet; it’s a minor part of the illustration. Really, we are only doing a change of variables (like a u-substitution) but with both \(x\) and \(y\) now. We let the \(x\) coordinates of our curve be determined by function \(g(t)\), and we let the \(y\) coordinates of our curve be determined by \(f(t)\). Specifically, we define \(x = g(t)\) and \(y = f(t)\), exactly as illustrated in the diagram. A change in variable \(t\) leads to a simultaneous change in \(x\) and \(y\) along the function in red. Furthermore, we will assume that \(f\) and \(g\) are one-to-one. This assumption is restrictive, but will help us visualize what is going on in 6.3.
Let’s suppose we are interested in computing the green plus the purple areas in the diagram above. There are two ways that we can do this:
- We can compute the area of the blue rectangle and subtract the area of the orange rectangle.
or
- We can compute the areas of the green and purple regions using integrals, then add up the results.
Notice that the area of the blue rectangle is \(f(b)g(b)\), while the area of the orange rectangle is \(f(a)g(a)\). Therefore, the purple region plus the green region is given by \(\color{blue}{f(b)g(b)} - \color{orange}{f(a)g(a)}\).
Now let’s compute the area of the green region. Right now, our \(x\) coordinate is defined by the function \(g\): \(x = g(t)\). We will be integrating with respect to \(x\), so we have:
\[\int_{g(a)}^{g(b)} f(t) \, dg\]
We can be clever here. In the integral above, \(x\) is going from \(g(a)\) to \(g(b)\). In that case, \(t\) is going from \(a\) to \(b\) (since \(x = g(t)\) and \(g\) was assumed to be one-to-one). We can multiply and divide by \(dt\) in the integral to obtain
\[\color{green}{\text{Green Region}} = \int_{g(a)}^{g(b)} f(t) \, dg = \int_{a}^{b} f(t) \frac{dg}{dt} dt = \color{green}{\int_{a}^{b} f(t)g'(t) dt}\]
We can now compute the area of the purple region. We are doing almost the exact same thing, but now we will switch functions \(f\) and \(g\). Specifically, we need to compute
\[\int_{f(a)}^{f(b)} g(t) df\]
We can use the same clever trick again (once again assuming that \(f\) is one-to-one):
\[\color{purple}{\text{Purple Region}} = \int_{f(a)}^{f(b)} g(t) df = \int_{a}^{b} g(t)\frac{df}{dt} dt = \color{purple}{\int_{a}^{b}g(t)f'(t) dt}\]
We now have (1) and (2). We can set these equal, and find
\[\color{blue}{f(b)g(b)} - \color{orange}{f(a)g(a)} = \color{green}{\int_{a}^{b} f(t)g'(t) dt} + \color{purple}{\int_{a}^{b}g(t)f'(t) dt}\]
This is the integration by parts formula 6.3.