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