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.

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.

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 to help you understand the differences between the
three different rectangular approximations. Note 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,3); > leftbox(x^2,x=0..4,16); > middlebox(x^2,x=0..4,10);There are also Maple commands

> rightsum(x^2,x=0..4); > evalf(rightsum(x^2,x=0..4,3)); > evalf(leftsum(x^2,x=0..4,16)); > evalf(middlesum(x^2,x=0..4,10));

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

- Plot the function
on the interval with 6 rectangles determined by the right-endpoint rule. Then plot the function with 6 rectangles using the left-endpoint rule.
- Which rule overestimates the area for the given function? Will this rule always overestimate the area for any function? Why?
- Is the midpoint rule an average of the left and right endpoint rules? Verify your claim using the above function with 6 rectangles.

- The triangle with vertices , , and has an exact area of .
- What are the two linear equations that bound this triangle above and below? What is the interval of values that bound this triangle? Supply a plot of these lines over this interval.
- Use the command
`rightsum`to find the minimum number of subintervals needed to approximate this area with error less than 0.1.

- The exact value of can be defined by the definite integral

since this integral represents the area of a circle of radius 1.- Use the command
`leftsum`to find the minimum number of subintervals needed to approximate the value of with error no greater than 0.01. - Use the command
`middlesum`to find the minimum number of subintervals needed to approximate the value of with error no greater than 0.01. - Explain which estimation you think is better and why.

- Use the command

2007-01-14