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

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

- For the function
over the interval
, use the
`rightbox`,`leftbox`, and`middlebox`commands to plot the rectangular approximation of the area above the -axis and under with 20 rectangles. State in your opinion which graph gives the best approximation to the area and give a reason why. - The area under
above the axis over the interval
accurate to 10 decimal places is 6.0632791021. Plot 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?

2001-09-24