## Riemann Sums

### Learning Outcomes

• Use Riemann sums to approximate area

So far we have been using rectangles to approximate the area under a curve. The heights of these rectangles have been determined by evaluating the function at either the right or left endpoints of the subinterval $[x_{i-1},x_i]$. In reality, there is no reason to restrict evaluation of the function to one of these two points only. We could evaluate the function at any point $x_i^*$ in the subinterval $[x_{i-1},x_i]$, and use $f(x_i^*)$ as the height of our rectangle. This gives us an estimate for the area of the form

$A \approx \displaystyle\sum_{i=1}^{n} f(x_i^*)\Delta x$.

A sum of this form is called a Riemann sum, named for the 19th-century mathematician Bernhard Riemann, who developed the idea.

### Definition

Let $f(x)$ be defined on a closed interval $[a,b]$ and let $P$ be a regular partition of $[a,b]$. Let $\Delta x$ be the width of each subinterval $[x_{i-1},x_i]$ and for each $i$, let $x_i^*$ be any point in $[x_{i-1},x_i]$. A Riemann sum is defined for $f(x)$ as

$\displaystyle\sum_{i=1}^{n} f(x_i^*)\Delta x$.

Recall that with the left- and right-endpoint approximations, the estimates seem to get better and better as $n$ get larger and larger. The same thing happens with Riemann sums. Riemann sums give better approximations for larger values of $n$. We are now ready to define the area under a curve in terms of Riemann sums.

### Definition

Let $f(x)$ be a continuous, nonnegative function on an interval $[a,b]$, and let $\displaystyle\sum_{i=1}^{n} f(x_i^*)\Delta x$ be a Riemann sum for $f(x)$. Then, the area under the curve $y=f(x)$ on $[a,b]$ is given by

$A=\underset{n\to \infty }{\lim}\displaystyle\sum_{i=1}^{n} f(x_i^*)\Delta x$.

Some subtleties here are worth discussing. First, note that taking the limit of a sum is a little different from taking the limit of a function $f(x)$ as $x$ goes to infinity. Limits of sums are discussed in detail in the chapter on Sequences and Series in the second volume of this text; however, for now we can assume that the computational techniques we used to compute limits of functions can also be used to calculate limits of sums.

Second, we must consider what to do if the expression converges to different limits for different choices of $\{x_i^*\}$. Fortunately, this does not happen. Although the proof is beyond the scope of this text, it can be shown that if $f(x)$ is continuous on the closed interval $[a,b]$, then $\underset{n\to \infty }{\lim}\displaystyle\sum_{i=1}^{n} f(x_i^*)\Delta x$ exists and is unique (in other words, it does not depend on the choice of $\{x_i^*\}$).

We look at some examples shortly. But, before we do, let’s take a moment and talk about some specific choices for $\{x_i^*\}$. Although any choice for $\{x_i^*\}$ gives us an estimate of the area under the curve, we don’t necessarily know whether that estimate is too high (overestimate) or too low (underestimate). If it is important to know whether our estimate is high or low, we can select our value for $\{x_i^*\}$ to guarantee one result or the other.

If we want an overestimate, for example, we can choose $\{x_i^*\}$ such that for $i=1,2,3,\cdots,n, \, f(x_i^*)\ge f(x)$ for all $x\in [x_{i-1},x_i]$. In other words, we choose $\{x_i^*\}$ so that for $i=1,2,3,\cdots,n, \, f(x_i^*)$ is the maximum function value on the interval $[x_{i-1},x_i]$. If we select $\{x_i^*\}$ in this way, then the Riemann sum $\displaystyle\sum_{i=1}^{n} f(x_i^*)\Delta x$ is called an upper sum. Similarly, if we want an underestimate, we can choose $\{x_i^*\}$ so that for $i=1,2,3,\cdots,n, \, f(x_i^*)$ is the minimum function value on the interval $[x_{i-1},x_i]$. In this case, the associated Riemann sum is called a lower sum. Note that if $f(x)$ is either increasing or decreasing throughout the interval $[a,b]$, then the maximum and minimum values of the function occur at the endpoints of the subintervals, so the upper and lower sums are just the same as the left- and right-endpoint approximations.

Tip: If a function is increasing over a closed interval, the right endpoints will be used to calculate the upper sum and the left endpoints the lower sum. If a function is decreasing over a closed interval, the right endpoints will be used for the lower sum and the left endpoints the upper sum.

### example: Finding Lower and Upper Sums

Find a lower sum for $f(x)=10-x^2$ on $[1,2]$; use $n=4$ subintervals.

Watch the following video to see the worked solution to Example: Finding Lower and Upper Sums.

### Try It

1. Find an upper sum for $f(x)=10-x^2$ on $[1,2]$; let $n=4$.
2. Sketch the approximation.

### Example: Finding Lower and Upper Sums for $f(x)= \sin x$

Find a lower sum for $f(x)= \sin x$ over the interval $[a,b]=[0,\frac{\pi }{2}]$; let $n=6$.

Watch the following video to see the worked solution to Example: Finding Lower and Upper Sums for $f(x)= \sin x$.

### Try It

Using the function $f(x)= \sin x$ over the interval $[0,\frac{\pi}{2}]$, find an upper sum; let $n=6$.