# Rectangular Method

The most straightforward way to approximate the area under a curve is to divide up the interval along the x-axis between x=a and x=b into a number of smaller intervals, each of the same length. For example, if we divide the interval into N subintervals, then the width of each one is given by

We then form N rectangles of height approximately equal to f(x) and width equal to h. The approximate area under the curve is then simply the sum of the areas of all the rectangles formed by our subintervals,

where stands for the approximate value of f in the ith interval. See this for a graphical illustration of this process.

How do we approximate the value of f in a particular interval? One way to do this is to use the value of the function in the middle of the interval, as illustrated in the last figure. The midpoint of the ith interval is a + (i - 1/2)h, so

Putting this all together, the integral is approximated by

Newton showed that as the approximation becomes exact. Computationally, of course, using lots of very skinny rectangles isn't at all practical. In fact, we would like to use the largest value of h that yields a close approximation so as to minimize computational costs.

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