Kepler suggested one simple integration method. Develop the function integrate-kepler . It coomputes the area under some the graph of some function f between left and right using Kepler's rule. Another simple method is to think of the area as a sequence of many small rectangles. Each rectangle is as tall as the function graph in, say, the middle of the rectangle.
Figure shows two examples.
By adding up the area of the rectangles, we get a good estimate at the area under the graph. The more rectangles we consider, the closer the estimate is to the actual area. Let us agree that R stands for the number of rectangles that we wish to consider. To determine how large these rectangles are, we need to figure out how large their sides are. The first midpoint is clearly at a plus half of the width of the rectangle, i.e. , if the area is where W stands for width and S for step from now on.