Trapezoidal Method

If you were to do a bit of experimentation, you would see that using rectangles is not always the most effective way to approximate the area under a curve. One simple improvement that we can make to obtain better approximations is to estimate the area under a curve by using a series of trapezoids instead of rectangles. See this for an illustration.

As before, we divide the interval (a, b) into N equal subintervals, each of size

displaymath268

Also as before the endpoints of the ith subinterval are a+(i-1)h and a+ih. The (x,y)-coordinates of the four corners of the trapezoid that we use to approximate the area under the curve in this subinterval are then

The area of this trapezoid is given by the length of the base times the average of the heights of the two sides:

displaymath318

Now to approximate the area under the curve, we simply add up the areas of all of the trapezoids:

displaymath320

If you think about what is going on in this summation, you can come up with a new summation that can be computed more efficiently. Except for f(a) and f(b), every other value of f that is computed in this summation is computed twice. Why is that?

Click here for the answer

Based upon this realization, it is not difficult to come up with a summation that requires half as much work to compute:

displaymath328


Christopher R. Johnson
Hamlet Project
Department of Computer Science
University of Utah