right|thumb|300px|Four of the [[#Riemann summation methods|methods for approximating the area under curves. <span style="color:#fec200">Left </span> and <span style="color:#0081cd">right</span> methods make the approximation using the left and right endpoints of each subinterval, respectively. <span style="color:#009246">Upper</span> and <span style="color:#bc1e47">lower</span> methods make the approximation using the largest and smallest endpoint values of each subinterval, respectively. The values of the sums converge as the subintervals halve from top-left to bottom-right.]]

In mathematics, a Riemann sum is a certain kind of approximation of an integral by a finite sum. It is named after nineteenth century German mathematician Bernhard Riemann. One very common application is in numerical integration, i.e., approximating the area of functions or lines on a graph, where it is also known as the rectangle rule. It can also be applied for approximating the length of curves and other approximations.

The sum is calculated by partitioning the region into shapes (rectangles, trapezoids, parabolas, or cubics—sometimes infinitesimally small) that together form a region that is similar to the region being measured, then calculating the area for each of these shapes, and finally adding all of these small areas together. This approach can be used to find a numerical approximation for a definite integral even if the fundamental theorem of calculus does not make it easy to find a closed-form solution.

Because the region by the small shapes is usually not exactly the same shape as the region being measured, the Riemann sum will differ from the area being measured. This error can be reduced by dividing up the region more finely, using smaller and smaller shapes. As the shapes get smaller and smaller, the sum approaches the Riemann integral.

Definition

Let <math>f: [a, b] \to \mathbb R</math> be a function defined on a closed interval <math>[a, b]</math> of the real numbers, <math>\mathbb R</math>, and <math>P = (x_0, x_1, \ldots, x_n)</math> as a partition of <math>[a, b]</math>, that is

<math display="block">a = x_0 <x_1 < x_2 < \dots < x_n = b.</math>

A Riemann sum <math>S</math> of <math>f</math> over <math>[a, b]</math> with partition <math>P</math> is defined as

<math display="block">S = \sum_{i = 1}^{n} f(x_i^*)\, \Delta x_i,</math>

where <math>\Delta x_i = x_i - x_{i - 1}</math> and <math>x_i^* \in [x_{i - 1}, x_i]</math>.

One might produce different Riemann sums depending on which <math>x_i^*</math>s are chosen. In the end this will not matter, if the function is Riemann integrable, when the difference or width of the summands <math>\Delta x_i</math> approaches zero.

Types of Riemann sums

Specific choices of <math>x_i^*</math> give different types of Riemann sums:

  • If <math>x_i^*=x_{i-1}</math> for all i, the method is the left rule and gives a left Riemann sum.
  • If <math>x_i^* = x_i</math> for all i, the method is the right rule

Two dimensions

In two dimensions, the domain <math>A</math> may be divided into a number of two-dimensional cells <math>A_i</math> such that <math display="inline">A = \bigcup_i A_i</math>. Each cell then can be interpreted as having an "area" denoted by <math>\Delta A_i</math>. The two-dimensional Riemann sum is

<math display="block">S = \sum_{i = 1}^n f(x_i^*, y_i^*)\, \Delta A_i,</math>

where <math>(x_i^*, y_i^*) \in A_i</math>.

Three dimensions

In three dimensions, the domain <math>V</math> is partitioned into a number of three-dimensional cells <math>V_i</math> such that <math display="inline">V = \bigcup_i V_i</math>. Each cell then can be interpreted as having a "volume" denoted by <math>\Delta V_i</math>. The three-dimensional Riemann sum is

<math display="block">S = \sum_{i = 1}^n f(x_i^*, y_i^*, z_i^*)\, \Delta V_i,</math>

where <math>(x_i^*, y_i^*, z_i^*) \in V_i</math>.

Arbitrary number of dimensions

Higher dimensional Riemann sums follow a similar pattern. An n-dimensional Riemann sum is

<math display="block">S = \sum_i f(P_i^*)\, \Delta V_i,</math>

where <math>P_i^* \in V_i</math>, that is, it is a point in the n-dimensional cell <math>V_i</math> with n-dimensional volume <math>\Delta V_i</math>.

Generalization

In high generality, Riemann sums can be written

<math display="block">S = \sum_i f(P_i^*) \mu(V_i),</math>

where <math>P_i^*</math> stands for any arbitrary point contained in the set <math>V_i</math> and <math>\mu</math> is a measure on the underlying set. Roughly speaking, a measure is a function that gives a "size" of a set, in this case the size of the set <math>V_i</math>; in one dimension this can often be interpreted as a length, in two dimensions as an area, in three dimensions as a volume, and so on.

See also

  • Antiderivative
  • Euler method and midpoint method, related methods for solving differential equations
  • Lebesgue integration
  • Riemann integral, limit of Riemann sums as the partition becomes infinitely fine
  • Simpson's rule, a powerful numerical method more powerful than basic Riemann sums or even the Trapezoidal rule
  • Trapezoidal rule, numerical method based on the average of the left and right Riemann sum

References

  • A simulation showing the convergence of Riemann sums