WOLFRAM|DEMONSTRATIONS PROJECT

Riemann Sums: A Simple Illustration

​
n
5
function
sin(x)
cos(x)
2
x
min
0
max
π
2
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
∑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!