next up previous
Next: Exercises Up: Labs and Projects for Previous: Labs and Projects for

Subsections


Riemann Sums

Background

Much of Calculus II is devoted to the definite integral since that is the concept needed to deal with applications such as area, volume, work, etc. (as presented in Chapter 6 of the text). In order to know what definite integral to use in a given application, one needs to understand the Riemann sums that are used to define the definite integral (see Section 5.5 of the text) and to appreciate what each term in a Riemann sum stands for.

In this lab we consider Riemann sums associated with area problems (see Sections 5.3 and 5.4 of the text for the appropriate background). As you have seen, in an area problem, each term of the Riemann sum represents the area of a rectangle and the Riemann sum itself gives an approximation to the area under discussion. We now look in more detail at these rectangular approximations. Note that all the rectangular approximations considered in this lab depend on dividing the interval in question into n subintervals of equal length.

Rectangular approximations

In these simple approximation schemes, the area above each subinterval is approximated by the area of a rectangle, with the height of the rectangle being chosen according to some rule. In particular, we will consider the following rules:
left endpoint rule
The height of the rectangle is the value of the function f(x) at the left-hand endpoint of the subinterval.
right endpoint rule
The height of the rectangle is the value of the function f(x) at the right-hand endpoint of the subinterval.

midpoint rule
The height of the rectangle is the value of the function f(x) at the midpoint of the subinterval.

The Maple student package has commands for visualizing these three rectangular area approximations. To use them, you first must load the package via the with command. Then try the three commands given below. Make sure you understand the differences between the three different rectangular approximations. Take a moment to see that the different rules choose rectangles which in each case will either underestimate or overestimate the area.

  > with(student):

  > rightbox(x^2,x=0..4);

  > leftbox(x^2,x=0..4);

  > middlebox(x^2,x=0..4);

There are also Maple commands leftsum, rightsum, and middlesum to sum the areas of the rectangles, see the examples below. Note the use of evalf to obtain numerical answers.

  > rightsum(x^2,x=0..4);

\begin{maplelatex}
\begin{displaymath}
{\displaystyle \sum_{{i}=1}^{4}} \,{i}^{2}\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x^2,x=0..4));

\begin{maplelatex}
\begin{displaymath}
30.\end{displaymath}\end{maplelatex}

  > middlesum(x^2,x=0..4);

\begin{maplelatex}
\begin{displaymath}
{\displaystyle \sum_{{i}=0}^{3}} \, \left...
 ...
{\displaystyle \frac {1}{2}}\, \! \right) ^{2}\end{displaymath}\end{maplelatex}

  > evalf(middlesum(x^2,x=0..4));

\begin{maplelatex}
\begin{displaymath}
21.00000000\end{displaymath}\end{maplelatex}

It should be clear from the graphs that adding up the areas of the rectangles only approximates the area under the curve. However, by increasing the number of subintervals the accuracy of the approximation can be increased. All of the Maple commands described so far in this lab permit a third argument to specify the number of subintervals. The default is 4 subintervals. See the example below for the area under y=x from x=0 to x=2 using the rightsum command with 4, 10, 20 and 100 subintervals. (As this region describes a right triangle with height 2 and base 2, this area can be easily calculated to be exactly 2.) Try it yourself with the leftsum and middlesum commands.

  > evalf(rightsum(x,x=0..2));

\begin{maplelatex}
\begin{displaymath}
2.500000000\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x,x=0..2,10));

\begin{maplelatex}
\begin{displaymath}
2.200000000\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x,x=0..2,20));

\begin{maplelatex}
\begin{displaymath}
2.100000000\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x,x=0..2,100));

\begin{maplelatex}
\begin{displaymath}
2.020000000\end{displaymath}\end{maplelatex}

Since, in this trivial example, we know that the area is exactly 2, it appears that, as the number of subintervals increases, the rectangular approximation becomes more accurate. What would happen with a not so trivial region? The next section describes a way of assessing the accuracy of a pair of rectangular approximations.

Upper and lower sums

We introduce two more rectangular approximations.
upper sum approximation
The height of the rectangle is the global maximum of f(x) on the subinterval.
lower sum approximation
The height of the rectangle is the global minimum of f(x) on the subinterval.

It should be clear that, if the area being approximated has A square units of area, then

lower sum $\leq$ A $\leq$ upper sum

In general, it is rather complicated to compute upper and lower sums. However, if f(x) is monotonic, the situation is much easier. If f(x) is increasing on the interval [a,b], then the upper sum is just the right sum and the lower sum is just the left sum. In the last example with f(x) = x, the right sums (which are upper sums) moved down toward the value of A as the number of subintervals increased. What happens with the left sums (which are lower sums) as n, the number of subintervals, increases? The approximations of the area using these two rules do not generate approximations which are necessarily more or less accurate than the first three rules presented. However, they are informative in that they give lower and upper bounds on what the true area is.


next up previous
Next: Exercises Up: Labs and Projects for Previous: Labs and Projects for

Christine Marie Bonini
3/25/1999