Area Between Two Curves as  Limits of Riemann Sums

Note:  There are many examples of good visualization utilities for Riemann Sum approximations that are suitable for first term Calculus.  Some routines display the approximating rectangles together with the sum.  This demo incorporates another visualization aspect: specifically, it combines the visualization of approximating rectangles together with a graph of the approximate areas as a function of the number of rectangles.  Thus, the limiting behavior of the approximating sums can be observed on the graph.

Objective: The basis for determination of area under a curve and areas between two curves is the successive approximation of the area using Riemann sums over an appropriate partition of an interval .   The actual area is determined by taking the limit of Riemann sums as the number of rectangles increases without bound in such a way that the norm of the partition approaches zero.  The purpose of this demo is to graphically illustrate Riemann sum approximations of areas between two curves and the limiting behavior of the approximation.   This demo can be used to introduce the idea of area between two curves.

Level:  This demo can be presented in first term Calculus.

Prerequisites: Students should be familiar with Riemann sums and the idea of approximating rectangles. The concepts of upper and lower sums should have been introduced.  In addition, it would be useful if students have been introduced to graphical notions of limits and limiting behavior.

Platform:  Any  computer system with MATLAB, v5 Release 11 and the Symbolic Math Toolbox OR the Student Edition of MATLAB v5.3.

The MATLAB m-file arears.m provides a demonstration of area approximations.

The MATLAB script prompts the user for two nonconstant input functions, an interval, and the maximum number of rectangles, nmax.

If functions of x, the partition of the interval [a,b] is

a=x0, x1,...,xn-1,xn=b

with increments given by

.

In this case, the area between graphs of ftop(x) and fbottom(x)  is approximated using vertical rectangles (see Figure 1) with height determined using left hand endpoints of the partition subintervals.

 Area of Approximating Rectangle:

Figure 1.Vertical Rectangles using left hand endpoints.

If functions of y, the partition of the y-interval [a,b] is

a=y0, y1,...,yn-1,yn=b

with increments given by

.

In this case, the area between graphs of fright(y) and fleft(y)  is approximated using horizontal rectangles (see Figure 2) with  length determined using lower endpoints of the partition subintervals.

 Area of Approximating Rectangle:

Figure 2.  Horizontal rectangles using lower endpoints.

In either case, approximation begins with 2 rectangles and increases to nmax in increments of 2.

The graphics display is divided into two subplots (see animation in title display above). The left hand plot illustrates the approximating rectangles. The right hand plot displays the numerical values of the successive approximations. As the number of rectangles is increased, the approximations approach a limiting value which can be computed using definite integrals, provided the antiderivative can be found.

Instructor's Notes:  The area between two curves can be approximated using Riemann sums.  For example, the area between the graphs of y = x2 and y = 1-x2 on the interval can be approximated using vertical rectangles as in Figure 3 below.

 The area of a representative approximating rectangle is: where xi-1 is the left hand endpoint in the ith subinterval of .  Note that as the rectangles track across the region, the top of the rectangle is always on the "top" graph, y = 1- x2.  That is not always the case as Figure 4 shows.

Figure 3.

The area between the graphs of y = x2 and y = 1-x2 in the interval can be also be approximated using vertical rectangles, however, at a point on the interval, the graphs of the functions cross each other.

 Note that when the functions cross each other, the "top" and "bottom" functions switch at the point of intersection.    We can use Riemann sums to approximate the area nonetheless.

Figure 4.

There is nothing sacred about approximating area between two curves using vertical rectangles.  It is also possible (and sometimes necessary) to approximate using horizontal rectangles.  Consider the area bounded by the graphs of  and on the interval [0, 2], shown in Figure 5.

 The area of a representative  approximating rectangle is given by  where yi-1 is the lower endpoint in the ith subinterval of [0, 2].  Note that [0,2] this is an interval of y values.

Figure 5.

It is important to observe that as the number of subintervals increases, the area approximation approaches a limiting value.

The MATLAB m-file arears.m generates a graph that illustrates the approximating rectangles as well as a graph that illustrates the limiting behavior of the approximations.  Click the picture below to enlarge.

The MATLAB M-file arears.m can be used with a variety of functions.  However, this M-file was designed to be an instructional tool.  It is important that you choose examples carefully for maximum benefit.  Use nmax between 10 and 50, inclusive.

Below are links to several Riemann Sum routines available for various platforms.  The links listed below will direct you to web pages from which you may obtain additional information about various routines and author contact information.  Commercially available products are denoted by *.

The links are provided below with the understanding that these routines are the property of the owners/publishers and should be used only with their permission.

University of Tennessee:  Visual Calculus
A collection of visualization and computational tools, including interactive modules, for Riemann Sums.  Includes demos using TI-85 and TI-86 calculators, MathView, Maple, and other software packages.  Visual Calculus was authored by Larry Husch and is hosted by Math Archives. http://archives.math.utk.edu/visual.calculus/4/

University of Arizona:
Integral
An MSDOS application by Clark Benson and David Lovelock
that allows computation and visualization of Riemann Sums
http://archives.math.utk.edu/software/msdos/calculus/integral/.html

Mathematica* Riemann Sum Package, Charles Wells.  Displays and computes Riemann Sums
http://library.wolfram.com/infocenter/MathSource/752/

Animating Calculus*, Ed Packel and Stan Wagon.  A collection of 22 labs utilizing animations.  One of these labs deals with investigation of the definite integral using Riemann Sums. (Mathematica)

Additionally, we offer a MATLAB Riemann Sum Routine described below.

MATLAB Riemann Sum Routine:  This routine requires MATLAB v5 R11 and the Symbolic Math Toolbox OR the Student Version of MATLAB v5.3.  Use the slider to increase the number of approximating rectangles.

When executed, the user may select 3 "demo" functions or input a different function. Click on the picture below for a larger view of the graphics.

Both M-files are required.

riesum.m
rsummerh.m

Credits:  This demo was submitted by

Dr. Lila F. Roberts
College of Information & Mathematical Sciences
Clayton State University
Morrow, GA 30260

and is included in Demos with Positive Impact with her permission.

MATLAB codes were generated by Lila Roberts and David R. Hill.

LFR May 13, 2000.    Last updated 9/15/2010 (DRH)

Previous counter information was lost.

Visitors since 1/30/2005