Suppose is a non-negative, continuous function defined on some interval . Then by the area under the curve between and we mean the area of the region bounded above by the graph of , below by the -axis, on the left by the vertical line , and on the right by the vertical line . All of the numerical methods in this lab depend on subdividing the interval into subintervals of uniform length. For example, dividing the interval [0,4] into four uniform pieces produces the subintervals , , , and .

In these simple rectangular approximation methods, 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 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 at the right-hand endpoint of the subinterval. The midpoint rule uses the value of the function 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

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

In the case of the rectangular approximations considered in this lab,
the way to improve the approximation is to increase the number of
subintervals in the partition. All of the Maple commands described so
far in this lab can include a third
argument to specify the number of subintervals. The default is 4
subintervals. The example below approximates the area under
from to using the `rightsum` command with 4, 50,
100, 320 and 321 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 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 absolute error no greater than 0.1.

> exact := 4^3/3; > estimate := evalf(rightsum(x^2,x=0..4)); > evalf(abs(exact-estimate)); > estimate := evalf(rightsum(x^2,x=0..4,50)); > evalf(abs(exact-estimate)); > estimate := evalf(rightsum(x^2,x=0..4,100)); > evalf(abs(exact-estimate)); > estimate := evalf(rightsum(x^2,x=0..4,320)); > evalf(abs(exact-estimate)); > estimate := evalf(rightsum(x^2,x=0..4,321)); > evalf(abs(exact-estimate));

- Consider the function
on the interval
. Use the command
`leftsum`to approximate the definite integral

so that the absolute error is less than . Looking at the graph of , can you explain why the value given by the`leftsum`command is always less than the value of the integral? - Suppose that the the velocity of an object traveling in one
dimension is given by
for
. Let
be the position of the object at time , assuming that .
- As explained in your text, the position of the object at is equal to the area under the velocity curve from to . Use the midpoint rule with subdivision to approximate the position of the object at .
- Let be the right endpoint rule and the left endpoint
rule approximations with subdivisions to the position of the
object at . Explain why the following relation holds for any
value of .

(Hint - look at the results of`leftbox`and`rightbox`commands for values of from about 4 to 10.) - Evaluate and . Based on your results, do you think your approximation using the midpoint rule with subintervals was within of the exact value for the area? Explain why or why not.

2002-03-18