We can approximate the area underneath the graph of a function with a sequence of rectangles.

Consider a function f(x) and some interval a ≤ x ≤ b. To approximate the area underneath the graph of f(x) over this interval, start by forming a partition of [a,b] into n segments. That is choose points \{x1, x2, ..., xn-1\} such that a = x0 < x1 < ... < xn-1 < xn = b. Then, construct a rectangle for each segment [xj, xj+1] such that the side of the rectangle opposite this segment intersects the graph of f(x). The sum of the areas of this sequence of n rectangles is called a Riemann sum.

Demos

Riemann Integral

In this demonstration, you may input a function f(x) in the control panel. The number of rectangles in the partition is determined by the variable "resolution". The partition is constructed so that the rectangles have equal width (b - a)/n. Two sets of Riemann sums can be displayed. The "LeftRectangles" option uses rectangles with height f(xj) over the segment [xj, xj+1] and the sum is written as Sleft(f) = ∑j f(xj) (xj+1 - xj), where j goes from 0 to n - 1. The "RightRectangles" option uses rectangles with height f(xj+1) over the segment [xj, xj+1] and the sum is written as Sright(f) = ∑j f(xj+1) (xj+1 - xj), where j goes from 0 to n - 1. If f(x) is monotone increasing or decreasing over the given interval, then these two sums can also be called upper and lower Riemann sums because they would set upper and lower limits on the area A under the function graph: Slower(f) < A < Supper(f). As the number of partitions increases, the difference between the upper and lower sums goes to zero if the function is Riemann integrable. The limit that the upper and lower sums approach is called the Riemann integral and expressed notationally as ∫ab f(x) dx.