A Riemann sum is an approximation to the area between a curve and the x axis, made by adding together the areas of a set of rectangles. A summation calculation is involved, of the form Sum[f(x)./\x], where /\x is the width of each rectangle. The limit of the Riemann sum as /\x approaches zero is the (Riemann) integral of the function. This manipulation uses a left Riemann sum, in which the value of f(x) 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!
Contributed by: Phil Ramsden
|