Riemann Sums: A Simple Illustration
A Riemann sum is an approximation to the area between a curve and the axis, made by adding together the areas of a set of rectangles. A summation calculation is involved, of the form , where is the width of each rectangle. The limit of the Riemann sum as approaches zero is the (Riemann) integral of the function. This manipulation uses a left Riemann sum, in which the value of that is used is the one at the left edge of each rectangle. It is easy to adapt the code for right Riemann sums and for the trapezoidal rule; try it!