Skip to main content

Unit 11 Integrals

Subsection 11.1 Area

Integrals compute many things, the most fundamental of these being area. The definition of area is more subtle than one might think. Most people's understanding of area is based on a physical concept of how much two-dimensional space is taken up. For example, if you have to paint an irregular flat shape, how much paint does it take?

Looking back at the treatment of area in the pre-college math curriculum, you can see the steps toward a mathematical definition. First, for rectangles with integer sides \(a\) and \(b\text{,}\) you can count the number of \(1 \times 1\) squares needed to make the rectangle, leading to the area formula \(A = a \times b\text{.}\) From the physical point of view this is a formula, but from the mathematical point of view it is a definition, extended later to non-integer side lengths. Areas of triangles are not studied until much later. For right triangles with sides \(a\) and \(b\) and hypotenuse \(c\text{,}\) the area is shown to be equal \(ab/2\) by showing that two of these fit together to make an \(a \times b\) rectangle. This invokes a new principle: areas of congruent figures are equal. To compute the area of a parallelogram or trapezoid, the dissection principle is invoked: cutting up and rearranging the pieces of a figure preserves the area. These principles, all of which make intuitive and physical sense, are illustrated in Figure 11.1.

Figure 11.1. identifying congruent pieces of a dissection to evaluate areas of parallelograms and trapezoids

Write a sentence for each of the two rows explaining how it establishes an area formula. What is being asserted to have the same area as what, why is this true, and what is the conclusion?

The area of a circle is introduced, usually without much explanation. Do you know why the area of a circle of radius \(r\) is equal to \(\pi r^2\text{?}\) One common explanation is that areas of similar figures are related by a scaling principle. Recalling that area has units of squared length, it makes sense that scaling a figure by \(\lambda\) should scale the area by \(\lambda^2\text{.}\) All circles are similar; if follows that the area of a circle should be \(K r^2\) for some constant \(K\text{.}\) We can name this constant \(\pi\) but that leaves a nagging question unanswered. Scaling also shows that the circumference of a circle should be proportional to the radius, therefore \(C = K' r\) for some other constant \(K'\text{.}\) This turns out to be \(2 \pi\text{.}\) But why should \(K'\) be double \(K\text{?}\) An argument involving dissections and limits is shown in Figure 11.2.

Figure 11.2. a limit of dissections relates the constants for circumference and area

In Figure 11.2 the measure \(\pi r\) on the right refers to the total curved length of the bottom.

We have not defined limits of shapes, but intuitively, what is the limiting shape on the right?

What are its dimensions? by

Answer. 1

\(\text{rectangle}\)

Answer. 2

\(r\hbox{ or }\pi r\)

Answer. 3

\(r\hbox{ or }\pi r\)

Once limits are brought into the discussion, there is a way to define areas of much more general shapes. The idea is this: put as many non-overlapping squares of some small side length \(\varepsilon\) as you can inside the shape. These cover an area less than the area of the shape, but if \(\varepsilon\) is small, it seems credible that the area is getting close to the area of the shape. If the limit as \(\varepsilon \to 0^+\) exists, this should be the area of the shape. Similarly, you could completely cover the shape with squares of side \(\varepsilon\) if you are willing to cover a slightly too big region. When \(\varepsilon\) is small, you don't cover too much extra area. The limit as \(\varepsilon \to 0^+\) should also be the area of the shape. To make a long story short (you can hear the full story in Math 360), there are many shapes for which it is possible to prove that these two limits exist and are equal. For these shapes we can define area to be this common limiting value. This mathematical definition captures our existing physical intuition and is also consistent with the principles we already adpoted: congrunce, scaling and dissection.

Subsection 11.2 Riemann sums and the definite integral

With this build up, we will give a mathematical definition for the area for a certain restricted class of shapes. These are rectangular on three sides but whose top is described by a continuous function. More precisely, let \(a \lt b\) be real numbers and let \(f\) be positive and continuous on the closed interval \([a,b]\text{.}\) We will define the area of the region \(R\) bounded on the left by the vertical line \(x=a\text{,}\) on the right by the vertical line \(x=b\text{,}\) on the bottom by the \(x\)-axis (the line \(y=0\)), and on the top by the graph of \(f\) (the curve \(y = f(x)\)). This region is shown in Figure 11.3.

Figure 11.3. region between the \(x\)-axis and the graph of a function

We now define the lower and upper Riemann sums with \(n\) rectangles for a function \(f\) on an interval \([a,b]\text{.}\) If you prefer a picture, refer to Figure 11.4.

Figure 11.4. lower and upper Riemann sums

In Figure 11.4, what value of \(n\) was used?

Answer.

\(3\)

Definition 11.5.

Let \(f\) be a nonnegative continuous function on an interval \([a,b]\) and let \(n\) be a positive integer. Let \(I_1, \ldots , I_n\) denote the intervals you get when you divide \([a,b]\) into \(n\) equally sized intervals. For each interval \(I_k\text{,}\) let \(y_k\) be the minimum value of \(f\) on \(I_k\) and let \(R_k\) be the rectangle with base \(I_k\) on the \(x\)-axis and height \(y_k\text{.}\) The lower Riemann sum for \(f\) on \([a,b]\) with \(n\) rectangles is the sum of the areas of the rectangles \(R_k\text{,}\) for \(1 \leq k \leq n\text{.}\) The upper Riemman sum is defined similarly, with the maximum value instead of the minimum value on each interval.

What are the endpoints of the interval \(I_2\) in Figure 11.4?

left endpoint of \(I_2\text{:}\)

right endpoint of \(I_2\text{:}\)

What is the approximate value of \(y_2\) for the lower Riemann sum?

Answer. 1

\(4\)

Answer. 2

\(5\)

Answer. 3

\(1.75\)

Example 11.6.
We are not given precise values for the function \(f\) in Figure 11.4, but we can estimate from the graph. The rectangles each have width \(4/3\text{.}\) The respective heights for the lower Riemann sum appear to be roughly \(1.9, 1.6\) and \(1.7\text{,}\) making the lower Riemann sum equal to \((4/3) 1.9 + (4/3) 1.6 + (4/3) 1.7 = (4/3) 5.2 \approx 6.93\text{.}\) The upper Rieman sum is computed from rectangles with approximate heights \(3.3, 1.9\) and \(2.15\text{,}\) leading to a total area of \((4/3) 7.35 = 9.8\text{.}\)
Figure 11.7. left and right Riemann sums

The left Riemann sums and right Riemann sums are defined similarly, except that instead of using the minimum or maximum values of the function on each sub-interval the left Riemann sums uses the value at the left endpoint of each interval \(I_k\text{,}\) while the right Riemann sum uses the value at the right endpoint of each sub-interval \(I_k\text{.}\) Examples are shown in Figure 11.7.

Which of the two images in Figure 11.7 is the left Riemann sum?

  • the graph on the left is a left Riemann sum

  • the graph on the right is a left Riemann sum

Answer.

\(\text{the graph ... Riemann sum}\)

The upper and lower Riemann sums give upper and lower bounds on the area of the figure. The left and right Riemann sums are neither upper nor lower bounds for the area, but they are sandwiched in between the lower and upper Riemann sums, so they also converge to the area. They are useful because always choosing the left endpoint (or always choosing the right endpoint) leads to a simpler formula.

Write a summation formula for the left Riemann sum for \(f\) on \([a,b]\) with 10 rectangles. It should have 10 terms and look like this:

\(\displaystyle\sum_{n=1}^{10}\)

Answer.

\(\frac{f\!\left(a+\frac{\left(n-1\right)\!\left(b-a\right)}{10}\right)\!\left(b-a\right)}{10}\)

The values of the lower and upper Riemann sums in Figure 11.4 are approximately \(6.9\) and \(9.8\text{.}\) These are not very close to each other, leaving considerable uncertainty about the true area. Replacing by the left (say) Riemann sums, we can program the sum into a computing device and compute for much greater values of \(n\text{.}\) If we increase \(n\) from 3 to 10, as in Figure 11.7, we find the Riemann sums come out to approximately 8.48 and 8.02 -- somewhat better. These are not necessarily bounds: the true value could be greater than both, or less than both, or in between. Replacing \(n\) by 50 gives 8.28. This is again not a bound, however the following theorem guarantees that as \(n \to \infty\text{,}\) this will converge to the area.

Definition 11.9.

The common limit in Theorem 11.8 is called the definite integral of \(f\) from \(a\) to \(b\) and is denoted \(\displaystyle\int_a^b f(x) \, dx\text{.}\)

Let \(f\) be the constant function \(c\text{.}\) How far apart are the lower and upper Riemann sums for \(\displaystyle\int_3^9 c \, dx\) (pick any value of \(n\))?

What does that tell you about the definite integral \(\displaystyle\int_a^b c \, dx\text{?}\)

Remark 11.10.
The variable \(x\) is a bound variable; the notation \(\displaystyle\int_a^b f(u) \, du\) would represent the same thing. Also, as in the notation for derivatives, you shouldn't try to interpret what the symbol \(du\) means on its own. It evokes the width of an infinitesimal rectangle, but you can't always count on it to behave nicely in equations.

From this construction and theorem, you can deduce some identities for integrals.

Let’s say we know that \(\displaystyle\int_a^bf(x)\ dx=3\) and \(\displaystyle \int_b^c f(x)\ dx=5\text{.}\) Compute each of the following:

  1. \(\displaystyle\int_a^b f(x) \, dx + \displaystyle\int_b^c f(x) \, dx=\)

  2. \(\displaystyle\int_a^b 3 + 10 f(x) \, dx=\)

Answer. 1

\(8\)

Answer. 2

\(15\)

Subsection 11.3 Interpretations of the integral

Area is the most visually obvious interpretation but there are many others. If material (or charge, or mass, etc.) is spread out unevenly over an interval, the density at any point is the amount of material per length near that point. It has units of material divided by length. The total amount of material in the interval is gotten by summing how the amount of material over small intervals. When the interval is small enough, we can estimate the amount of material as \(f(x)\) times the length of the interval where \(x\) is any point in the interval. This is not exact because \(f\) generally will still vary over the interval, but not by much when \(x\) is small. The limit as the interval lengths go to zero will be \(\displaystyle\int_a^b f(x) \, dx\) and will represent the total material.

Example 11.11.

A 3-inch blade of grass is covered in mold. The amount of mold decreases up the blade because it is killed by sunlight. The density of mold per inch is \(1000 e^{-x/3}\) spores per inch at height \(x\) inches from the ground. The total number of spores on the blade of grass is given by \(\displaystyle\int_0^3 1000 e^{-x/3} \, dx\text{.}\)

Why did we use 0 and 3 for the limits of integration in Example 11.11?

Integrals can also be used to give averages. For a finite collection, the average is defined to be the total divided by the number you added to get the total. Averages over an interval are defined similarly.
Definition 11.12. average over an interval.

The average of a quantity varying over an interval \([a,b]\) according to a function \(f\) is defined to be \(\frac{1}{b-a} \displaystyle\int_a^b f(x) \, dx\text{.}\)

Example 11.13.

Suppose the temperature over a day is \(f(t)\) degrees Celsius \(t\) hours after midnight. The average temperature over the day is then \(\frac{1}{24} {\displaystyle\int_0^{24} f(t) \, dt}\text{.}\)

Suppose \(f(x)\) is some constant \(c\) on the interval \([a,b]\text{.}\) Intuitively, what is the average of \(f\) on \([a,b]\text{?}\) Compute the average value of \(f\) on \([a,b]\) directly from the definitions and check that it is what you expected.

An integral is a limit of a sum of rectangles' areas. The units are therefore the same units as the rectangles' areas. The rectangles live on a graph where the \(x\)-axis has units of the argument variable and the \(y\)-axis has units of the function. Therefore the rectangle units, hence the integral units, are units of the argument times units of the function. In the grass example, the function was density (spores per inch) and the argument was inches, therefore the integral had units of spores. It is a good thing that this agrees with our interpretation of the integral as the total number of spores. In the temperature example, \(f\) has units of temperature and \(t\) is in units of time, so the integral of \(f\) has units of temperature times time. This sounds like a strange unit but it's not unheard of. Severity of cold spells is measured, for example, in heating degree-days. The average is the integral divided by the time, so it is in units of temperature. Of course: the average temperature should be a temperature!

In physics there are countless things represented by integrals. One is the moment. Suppose mass is spread out along \([a,b]\) with density \(f\) (you know what that means now, right?). Integrate \(f\) and you get the total mass. If instead you compute \(\displaystyle\int_a^b x \, f(x) \, dx\) you get the moment of inertia, which tells you how much the weight counts when balancing (imagine a teeter-totter pivoting on the origin), or how much torque is needed to produce a given angular acceleration.

In probability theory, random quantities can be discrete or continuous. If the random quantity \(X\) is discrete it means that there is a sset of values \(x_1, x_2 , \ldots\) such that probabilities for \(X = x_k\) sum to 1. This could be a finite sum or the sum of an infinite sequence (you now know the definition of an infinite sum, right?). For continuous quantities, you need integrals. The probabilities for finding \(X\) to take various values are spread continuously over an interval (possibly an infinite interval such as the whole real line). There will be a probability density function \(f\) such that the probability of finding \(X\) in a given interval \([a,b]\) will be \(\displaystyle\int_a^b f(x) \, dx\text{.}\) We will say more about this in Unit 13, after we have defined integrals where one or both of the limits of integration can be infinite.

Going back to the area interpretation, you may ask what about more general shapes? It turns out you don't really need straight sides. The vertical walls on the left and right sides of the regions Figure 11.3 and Figure 11.4 can disappear. For example, letting \(f(x) = \sqrt{1-x^2}\) and \([a,b] = [-1,1]\) produces the upper half of a disk.

So far we have required \(f\) to be a nonnegative function. What if \(f\) is negative?

Let \(\Delta_k\) denote the width of \(I_k\text{.}\) The most useful definition turns out to be that the integral is still the limit of sums of the quantities \(\displaystyle\sum_k f(x_k) \cdot \Delta_k\) but we must interpret this as a new concept, called signed area rather than area. We won't worry too much about signed area; it just means we need to keep track of whether \(f\) is positive or negative before we know whether \(\displaystyle\int_a^b f(x) \, dx\) computes area or its negative. Figure 11.14 shows a function which is positive on \([0,0.42]\) and negative on the interval \([0.42,1]\text{.}\) The integral \(\displaystyle\int_0^1 f(x) \, dx\) will be slightly negative because it adds a positive area \(A_1\) to a negative signed area \(A_2\text{.}\)

Figure 11.14. the signed area \(A_2\) will be negative because it is below the \(x\)-axis

Another useful definition along the same lines switches the upper and lower limits.

Definition 11.15.
If \(a < b\) then \(\displaystyle\int_b^a f(x) \, dx\) is defined to equal \(- \displaystyle\int_a^b f(x) \, dx\text{.}\)

Suppose \(f\) and \(g\) are functions such that \(f \geq g\) on \([a,b]\text{.}\) One interpretation of \(\displaystyle\int_a^b [f(x) - g(x)] \, dx\) is that it is the area of the shape with upper boundary \(f\) and lower boundary \(g\text{.}\)

We started out computing areas of a very specific set of shapes, looking like three sides of a rectangle and a possibly curved upper boundary. Using the idea of upper and lower boundaries we can use integrals to give the area of a much greater variety of shapes.

On a coordinate axis, draw a heart shape (you know, the classic Valentine's heart). Then draw in values \(a\) and \(b\) on the \(x\)-axis and graphs of functions \(f\) and \(g\) such that the area of the heart is computed by \(\displaystyle\int_a^b [f(x) - g(x)] \, dx\text{.}\)
Figure 11.16. a solid volume (left) cut into slabs (right)

The examples of densities of quantities spread out along a line is somewhat limited. When quantities spread out, usually they spread over a region in a plane or in three dimensions.

The next calculus course covers multivariable integration. Still, there are some higher dimensional things you can do with ordinary integrals. One of these is to compute a volume of an object if you know the area of its cross-sections. Dividing the object into \(n\) very thin slabs, the volume of the \(k^{th}\) one is roughly the thickness \(\Delta_k\) times the cross-sectional area of the \(k^{th}\) slab, call it \(A_k\text{;}\) see Figure 11.16.

The limit of \(\displaystyle\sum_{k=1}^n A_k \Delta_k\) should give the volume. Line up the slabs so that the \(x\)-axis goes perpendicular to the slabs. This limit looks awfully similar to the limit of \(\displaystyle\sum_{k=1}^n f(x_k) \Delta_k\) where \(x_k\) is any point on the \(x\)-axis inside the \(k^{th}\) slab and \(f\) is the function telling the cross-sectional area at every \(x\)-value. Therefore, the volume is computed by \(\displaystyle\int_a^b f(x) \, dx\) where \(a\) and \(b\) are the \(x\)-values at the first and last slab respectively.

Example 11.17. volume of a pyramid.
We write an integral for volume of a pyramid whose base is a square of side length \(s\) and whose height is \(h\text{.}\) It corresponds best to the description above if we orient it so the height is measured along the \(x\)-direction with the apex at the origin. See Figure 11.18. The cross-section is a square with side increasing linearly from 0 to \(s\) as \(x\) increases from 0 to \(h\text{.}\) Thus, the side length is given by \(\ell (x) = (s/h) x\text{,}\) hence the cross-sectional area is given by \(f(x) = (s/h)^2 x^2\) between \(x=0\) and \(x=h\text{.}\) The volume is therefore given by \(\displaystyle\int_0^h (s/h)^2 x^2 \, dx\text{.}\) When you learn to compute integrals, this will turn out to be a pretty easy one.
Figure 11.18. a pyramid, cut into slabs along the \(x\)-direction

Subsection 11.4 The fundamental theorem of calculus

The reason we make such a fuss over integrals is that they can often be exactly computed. To see how this works, we look at the indefinite integral. Replacing the upper limit on the integral by a variable yields a function of that variable. To say this in another way, we may consider \(\displaystyle\int_a^b f(x) \, dx\) as a function of the free variables \(a\) and \(b\) (it can't be a function of \(x\) because \(x\) is a bound variable). Let \(a\) remain a constant but consider \(b\) to be a variable. We then have a function, \(b \mapsto \displaystyle\int_a^b f(x) \, dx\text{.}\) Denote this function by \(G\text{,}\) in other words \(G(b) := \displaystyle\int_a^b f(x) \, dx\text{.}\)

Example 11.19.
Let \(f (x) := 3x\) and \(a = 0\text{.}\) Then \(G(b) := \displaystyle\int_0^b 3x \, dx\text{.}\) Definite integrals compute area, hence \(G(b)\) is the area of the triangle with vertices at the origin, \((b,0)\) and \((b,3b)\text{.}\) The triangle area formula gives \(G(b) = (3/2) b^2\text{.}\)

For fun (we have a warped sense of fun), compute \(G'\text{.}\) That's an easy one: \(G'(b) = 3b\text{.}\) Note that this is the integrand of the original integral, with the free variable \(b\) in place of the bound variable \(x\text{.}\) This is not a coincidence, as the following theorem asserts.

Sketch of proof.
The derivative from the derivative from the right is given by
\begin{equation*} G' (b^+) = \lim_{h \to 0^+} \frac{G(b+h) - G(b)}{h} \, . \end{equation*}
When \(h\) is small, the value of \(G(b+h)\) is very well approximated by \(G(b) + h f(b)\text{;}\) in the picture at the right, \(G(b)\) is the blue area and \(G(b+h)\) is the blue area plus the shaded black and white area. Plugging this in gives \(\frac{G(b) + h f(b) - G(b)}{h} = f(b)\text{.}\) To turn this into a proof, you need to use continuity of \(f\) to show that the error replacing \(G(b+h)\) by \(G(b) + h f(b)\) is \(\ll h\text{,}\) so the approximation does not affect the limit. You already know enough to understand the argument, but in the interest of time, the details are left to a course in mathematical analysis.
Figure 11.21.
anti-derivatives.

The Fundamental Theorem of Calculus says we can evaluate integrals of \(f\) if we know a function \(G\) whose derivative is \(f\text{.}\) That motivates the next definition.

Definition 11.22.
An anti-derivative of a function \(f\) is any function \(G\) such that \(G' = f\text{.}\)

How do we find anti-derivatives? The next chapter is entirely about computing these. Like rules for differentiation, rules for anti-differentiation start from a collection known results. For derivatives, we obtained these from the definition by computing limits. For anti-derivatives, we will get these simply by remembering some basic derivatives. The simple rule yielding the derivative of a polynomial may be run backwards. So for example the monomial \(a x^m\) has anti-derivative \(\frac{a}{m+1} x^{m+1}\text{.}\) We can sum these, obtaining the anti-derivative of any polynomial: an anti-derivative of \(\displaystyle\sum_{k=0}^m a_k x^k\) is given by \(\displaystyle\sum_{k=0}^m \frac{a_k}{k+1} x^{k+1}\text{.}\) In fact this works for negative or fracdtional powers, as long as the power is not \(-1\text{.}\)

  1. Why can’t the power be \(-1\text{?}\)

  2. Compute an anti-derivative of \(x^2 - 5x + 6\text{.}\)

  3. Compute a different anti-derivative of \(x^2 - 5x + 6\text{.}\)

Answer. 1

Undefined

Answer. 2

\(0.333333x^{3}-2.5x+6x\)

We say "an anti-derivative" rather than "the anti-derivative" because for any given \(f\text{,}\) is always more than one anti-derivative. The functions \(G\) and \(G + c\text{,}\) where \(c\) is a constant, have the same derivative, so one is an anti-derivative of \(f\) if the other is. This is the only way anti-derivatives can differ.

Once you know the value of the anti-derivative at any point, it is easy to reconstruct the correct anti-derivative as an integral, as in the following example.

Example 11.23.
Suppose \(G\) is an anti-derivative of \(f\) and \(G(3) = 7\text{.}\) We will look for an anti-derivative of the form \(G(b) = c + \displaystyle\int_a^b f(x) \, dx\text{.}\) To write \(G\) as an integral with a variable upper limit, begin by choosing the constant for the lower limit. The most convenient choice is 3, because we are supposed to know the value of \(G\) at 3. The function \(b \mapsto \displaystyle\int_3^b f(x) \, dx\) is zero at 3, so we will need to add 7. We therefore choose
\begin{equation*} G(b) = 7 + \displaystyle\int_3^b f(x) \, dx \, . \end{equation*}
For concreteness, let's see how this works with the example from above: \(f(x) = 3x\text{.}\) Then \(G(b) = 7 + \displaystyle\int_3^b 3x \, dx\text{.}\) We already computed \(\displaystyle\int_0^b 3x \, dx = \frac{3}{2} b^2\) and similarly \(\displaystyle\int_0^3 3x \, dx = (3/2) 3^2 = 27/2\text{.}\) Subtracting, \(\displaystyle\int_3^b 3x \, dx = (3/2) b^2 - 27/2\text{.}\) Thus the anti-derivative we are looking for is \(7 + (3/2) b^2 - 27/2 = (3/2) b^2 - 13/2\text{.}\)

What area is represented by the quantity \(G(7)\text{?}\)

This example shows a general principle, which we record as a proposition.
Remark 11.25.

This implies that \(H(b) - H(a) = G(b) - G(a)\) when \(H\) is any other anti-derivative of \(f\text{.}\) In other words, differences of an anti-derivative at a specified pair of points do not depend on which particular anti-derivative was chosen.

Compute \(\displaystyle\int_1^6 x^2 - 5x + 6 \, dx\text{.}\)

Answer.

\(\frac{6^{3}}{3}-\frac{5}{2}\cdot 6^{2}+36-\left(\frac{1}{3}-\frac{5}{2}+6\right)\)

Subsection 11.5 Estimating sums via integrals

We have seen integrals interpreted as areas and volumes, totals and averages, moments, and probabilities. One more use of an integral is to estimate a sum. In a way this is the reverse of the definition, which tells you that an integral is estimated by Riemann sums, in fact is a limit of such sums. Going the other way, if we have a sum, we can write an integral for which it is a Riemann sum. We may then expect the integral to be a good approximation for the sum. This will be easier when we know how to compute more integrals, but there are plenty we can already compute. We illustrate with a long example. It starts with the fact that the derivative of \(\ln x\) is \(1/x\text{.}\) This means that an anti-derivative of \(1/x\) is \(\ln x\text{.}\)
Example 11.26. harmonic sum estimated by an integral.
Problem: estimate the \(100^{th}\) harmonic number \(1 + 1/2 + 1/3 + \cdots + 1/100\text{.}\) To solve this, we may as well estimate \(H_n := \displaystyle\sum_{k=1}^n 1/k\) for any positive integer \(n\text{.}\) Summing \(1/n\) looks a lot like integrating \(1/x\text{.}\) In fact, suppose we write a Riemann sum for \(\displaystyle\int_1^n 1/x \, dx\) that has precisely \(n-1\) rectangles. Then the intervals \(I_k\) are just the intervals \([1,2], [2,3], \ldots , [n-1,n]\text{.}\) Even better, we can make areas of the rectangles be exactly the same as in the sum. We just need to use the upper Riemann sum: \(1 + 1/2 + \cdots + 1/(n-1)\text{;}\) see the left-hand side of Figure 11.27 for a picture of this when \(n=9\text{.}\)
Figure 11.27. representing the harmonic sum as upper and lower Riemann sums

Figure 11.27 shows that \(H_{n-1}\) is an upper Riemann sum for \(\displaystyle\int_1^n 1/x \, dx\text{.}\) By Proposition 11.24 the integral is the difference of anti-derivatives:

\begin{equation*} \displaystyle\int_1^n \frac{1}{x} \, dx = \ln n - \ln 1 = \ln n \, . \end{equation*}

Therefore, we have shown the bound \(H_{n-1} \geq \ln n\text{.}\) In particular, choosing \(n = 101\text{,}\) we see that \(H_{100} \geq \ln 101 \approx 4.615\text{.}\)

Is this an upper bound or a lower bound? It depends on your point of view. If we were trying to figure out the integral up to 100, \(H_{100}\) would be an upper bound on the value. But in this case we know the integral and are trying to estimate \(H_{100}\text{.}\) The integral provides a lower bound, in this case \(4.615\text{.}\)

What about an upper bound on \(H_{100}\text{.}\) The obvious thing is to see if we can make the same sum be a lower Riemann sum. Watch what happens when you try to do this. Take the graph, shift all the rectangles one unit left, and voilà! (See the right-hand side of Figure 11.27.) This shows that \(H_{100}\) is a lower Riemann sum for a slightly different integral, namely \(\displaystyle\int_0^{100} \frac{1}{x} \, dx\text{.}\) Alas, this is not an integral we can do because \(1 / x\) is not continuous at \(x=0\text{.}\) In fact, when we study improper integrals, we will see this evaluates to \(+ \infty\text{.}\) Sure, we get the upper bound \(H_{100} \leq \infty\text{,}\) but that is hardly useful. All is not lost, however, if we use some common sense. The same picture shows that an upper bound for the harmonic sum starting at 2 instead of 1 is

\begin{equation*} \displaystyle\sum_{k=2}^{100} \frac{1}{k} \leq \displaystyle\int_1^{100} \frac{1}{x} \, dx = \ln 100 \approx 4.605 \, . \end{equation*}

So, adding back the 1, we see that \(H_{100} \leq 1 + \ln 100 \approx 5.605.\) This is about as good as we can do with the techniques we have so far: \(4.615 \leq H_{100} \leq 5.605\text{.}\) For the record, \(H_{100} \approx 5.1874\text{.}\)

Trapezoidal approximation.

Sometimes it can be frustrating using Riemann sums because a lot of calculation doesn't get you all that good an approximation. You can see a lot of "white space" between the function \(f\) and the horzontal lines at the top of the rectangles that make up the upper or lower Riemann sum. If instead you let the rectangle become a right trapezoid, with both its top-left and top-right corner on the graph \(y = f(x)\text{,}\) then you get what is known as the trapezoidal approximation. The figure shows a trapezoidal approximation of an integral \(\displaystyle\int_0^4 f(x) \, dx\) with five trapezoids. Note that the first and last trapezoid are degenerate, that is, one of the vertical sides has length zero and the trapezoid is actually a right triangle. It is perfectly legitimate for one or more of the trapezoids to be degenerate.

Figure 11.28.

Because the tops of the slices are allowed to slant, they remain much closer to the graph \(y = f(x)\) than do the Riemann sums. Because the area of a right trapezoid is the average of the areas of the two rectangles whose heights are the value of \(f\) at the two endpoints, it is easy to compute the trapezoidal approximation: it is just the average of the left-Riemann sum and the right-Riemann sum corresponding to the same partition into vertical strips.

Example 11.29.

Let's compute the trapezoidal approximation for \(\displaystyle\int_1^2 \frac{1}{1+x^2}\) with 10 trapezoids.

Averaging the left and right Riemann sums always gives a sum containing the \(n-1\) common terms plus half the first term for the left Riemann sum and the last term for the right Riemann sum. In this case one gets

\begin{equation*} \frac{1}{2} \frac{f(1)}{10} + \frac{1}{2} \frac{f(0)}{10} + \displaystyle\sum_1^9 \frac{1}{10} f \left ( 1 + \frac{j}{10} \right ) \, . \end{equation*}

The outcome of trapezoidal approximation in general can be summarized as,

Sum the values of \(f\) along a regular grid of \(x\)-values, counting endpoints as half, and multiply by the spacing between consecutive points.

The trapezoidal estimate is usually much closer than the upper or lower estimate, though it has the drawback of being neither an upper nor a lower bound. However, if you know the function to be concave upward then the trapezoidal estimate is an upper bound. Similarly if \(f'' \lt 0\) on the interval then the trapezoidal estimate is an lower bound. In the figure, \(f\) is concave downward and the trapezoidal estimate is indeed a lower bound.

Example 11.30.
The function \(1/(1+x^3)\) is concave upward on \([1,2]\) (compute and see that the second derivative is a positive quantity divided by \((1+x^3)^3\)) so the trapezoidal estimate should be not only very close but an upper bound. Indeed, the trapezoidal estimate is the average of the upper and lower previously computed and is equal to \(0.25485...\) which is indeed just slightly higher than the true value of \(0.25425...\text{.}\)