Skip to main content

Unit 10.6 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 10.29.

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 10.30 for a picture of this when \(n=9\text{.}\)
Figure 10.30.
representing the harmonic sum as upper and lower Riemann sums
Figure 10.30 shows that \(H_{n-1}\) is an upper Riemann sum for \(\displaystyle\int_1^n 1/x \, dx\text{.}\) It turns out (see Proposition 10.27 below) that this integral has a nice formula:
\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 10.30.) 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{.}\)