next up previous
Next: About this document ... Up: lab_template Previous: lab_template


Area Approximations


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

Rectangular Approximations

Integration, the second major theme of calculus, deals with areas, volumes, masses, and averages such as centers of mass and gyration. In lecture you have learned that the area under a curve between two points $a$ and $b$ can be found as a limit of a sum of areas of rectangles which approximate the area under the curve of interest. As these sums, and their limits, are often tedious to calculate, there is clear motivation for the analytical techniques which will be introduced shortly in class. However, not all ``area finding'' problems can be solved using analytical techniques, and the Riemann sum definition of area under a curve gives rise to several numerical methods which can approximate the area of interest with great accuracy.

Suppose $f(x)$ is a non-negative, continuous function defined on some interval $[a,b]$. Then by the area under the curve $y=f(x)$ between $x=a$ and $x=b$ we mean the area of the region bounded above by the graph of $f(x)$, 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 in this lab depend on subdividing the interval $[a,b]$ into subintervals of uniform length. For example, dividing the interval [0,4] into four uniform pieces produces the subintervals $[0,1]$, $[1,2]$, $[2,3]$, and $[3,4]$.

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 left, right and midpoint rules. When using the left endpoint rule, the height of the rectangle is the value of the function $f(x)$ at the left-hand endpoint of the subinterval. When using the right endpoint rule, the height of the rectangle is the value of the function $f(x)$ at the right-hand endpoint of the subinterval. The midpoint rule uses the value of the function $f(x)$ at the midpoint of the subinterval for the height of the rectangle.

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);
> evalf(rightsum(x^2,x=0..4));
> evalf(leftsum(x^2,x=0..4));
> evalf(middlesum(x^2,x=0..4));


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. The example below approximates the area under $y=x^2$ from $x=0$ to $x=4$ using the rightsum command with 4, 10, 20 and 100 subintervals. As the number of subintervals increases, the approximation gets closer and closer to the exact answer. You can see this by assigning a label to the approximation, assigning a label to the exact answer $(4^3/3)$ and taking their difference. The closer you are to the actual answer, the smaller the difference. The example below shows how we can use Maple to approximate this area with an error no greater than 0.1.
> exact := 4^3/3;
> estimate := evalf(rightsum(x^2,x=0..4));
> evalf(exact-estimate);
> estimate := evalf(rightsum(x^2,x=0..4,50));
> evalf(exact-estimate);
> estimate := evalf(rightsum(x^2,x=0..4,100));
> evalf(exact-estimate);
> estimate := evalf(rightsum(x^2,x=0..4,320));
> evalf(exact-estimate);
> estimate := evalf(rightsum(x^2,x=0..4,321));
> evalf(exact-estimate);


  1. For the function $\displaystyle f(x) = x^4+2x+3$ over the interval $0 \leq x \leq 5$, use the rightbox, leftbox, and middlebox commands to plot the rectangular approximation of the area above the $x$-axis and under $f(x)$ with 20 rectangles. State in your opinion which graph gives the best approximation to the area and give a reason why.

  2. The area under $g(x)=-\cos(\sqrt{x^2+5})$ above the $x$ axis over the interval $-4 \leq x \leq 4$ accurate to 10 decimal places is 6.0632791021. Plot $g(x)$ over the given interval. Use each of the approximations rightsum and middlesum to determine the minimum number of subintervals required so that the approximation of this area has an error no greater than 0.001. Which method requires the least number of subintervals?

next up previous
Next: About this document ... Up: lab_template Previous: lab_template
Dina Solitro