next up previous
Next: Analytical and Numerical Up: Labs and Projects for Previous: Parametric curves in

Area Approximations


The purpose of this lab is to acquaint you with some rectangular approximations to areas under curves.


Integration, the second major theme of calculus, deals with areas, volumes, masses, and averages such as centers of mass and gyration. Later on in the course, we will learn analytical techniques for computing these quantities. Unfortunately, these analytical techniques do not always work and numerical schemes are required. In this lab we will concentrate on rectangular approximations to areas. These turn out not to be very efficient numerical schemes, but they will be very useful in the theoretical development of the integral.

Suppose is a non-negative, continuous function defined on some interval . Then by the area under the curve between x=a and x=b we mean the area of the region bounded above by the graph of , below by the x axis, on the left by the vertical line x=a, and on the right by the vertical line x=b.

All of the numerical methods that we will deal with depend on subdividing the interval into subintervals of uniform length and then approximating the area above each subinterval. For example, dividing the interval into four uniform pieces produces the subintervals , , , and .

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. The rules we will be concerned with are as follows.

left endpoint rule
The height of the rectangle is the value of the function at the left-hand endpoint of the subinterval.

right endpoint rule
The height of the rectangle is the value of the function at the right-hand endpoint of the subinterval.

midpoint rule
The height of the rectangle is the value of the function 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.

  > 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);

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

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

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

The Maple commands above use the short-hand summation notation. Since there are only four terms in the sums above, it isn't hard to write them out explicitly, as follows.

However, if the number of terms in the sum is large, summation notation saves a lot of time and space.

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. See the example below for the area under y=x from x=0 to x=2 using therightsum command with 4, 10, 20 and 100 subintervals. (This area can be calculated to be exactly 2.) Try it yourself with the leftsum and middlesum commands.

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

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

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

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

More on partitions

In general, we call such subdivisions of an interval partitions. Partitions are usually specified by giving the set of endpoints of the subintervals, listed in increasing order, e.g. for our example of dividing the interval into 4 equal subintervals we would write .

To describe a general partition of the interval , we use subscript notation, , to denote the i-th point in the partition. That is, a partition with N subintervals would be written , where the points satisfy

In the case of a uniform partition, there is a simple formula for , which is

For example, there are five points in the uniform partition with four subintervals of the interval . Plugging the values a=0, b=4, and N=4 into the equation above, we get


  1. Use the commands to calculate and display the various rectangular approximations to the integrals of the following functions. Your goal should be to make the connection between the formula for the approximation and the display of the function along with the rectangles involved in the approximation. You do not need to include any plots with your report, but you must be able to explain where the sums come from.
    1. on the interval .

    2. on the interval .

    3. on the interval .

  2. Use the midpoint rule and one of the other rectangular rules to approximate the following areas to four decimal places. Your report should include the approximate values of the areas and the number of subintervals you used for each method.

    An accuracy of four decimal places means that your result, rounded to four decimal places, does not change when you increase the number of subintervals further.

    1. from x=0 to x=10.

    2. from x=0 to .

next up previous
Next: Analytical and Numerical Up: Labs and Projects for Previous: Parametric curves in

William W. Farr
Mon Jun 26 15:29:53 EDT 1995