Riemann sum

Last updated
Four of the methods for approximating the area under curves. Left and right methods make the approximation using the right and left endpoints of each subinterval, respectively. Upper and lower 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. Riemann sum convergence.png
Four of the methods for approximating the area under curves. Left and right methods make the approximation using the right and left endpoints of each subinterval, respectively. Upper and lower 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.

Contents

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 be a function defined on a closed interval of the real numbers, , and as a partition of , that is

A Riemann sum of over with partition is defined as

where and . [1] One might produce different Riemann sums depending on which 's are chosen. In the end this will not matter, if the function is Riemann integrable, when the difference or width of the summands approaches zero.

Types of Riemann sums

Specific choices of give different types of Riemann sums:

All these Riemann summation methods are among the most basic ways to accomplish numerical integration. Loosely speaking, a function is Riemann integrable if all Riemann sums converge as the partition "gets finer and finer".

While not derived as a Riemann sum, taking the average of the left and right Riemann sums is the trapezoidal rule and gives a trapezoidal sum. It is one of the simplest of a very general way of approximating integrals using weighted averages. This is followed in complexity by Simpson's rule and Newton–Cotes formulas.

Any Riemann sum on a given partition (that is, for any choice of between and ) is contained between the lower and upper Darboux sums. This forms the basis of the Darboux integral, which is ultimately equivalent to the Riemann integral.

Riemann summation methods

The four Riemann summation methods are usually best approached with subintervals of equal size. The interval [a, b] is therefore divided into subintervals, each of length

The points in the partition will then be

Left rule

Left Riemann sum of x - x over [0, 2] using 4 subintervals LeftRiemann2.svg
Left Riemann sum of xx over [0, 2] using 4 subintervals

For the left rule, the function is approximated by its values at the left endpoints of the subintervals. This gives multiple rectangles with base Δx and height f(a + iΔx). Doing this for i = 0, 1, ..., n − 1, and summing the resulting areas gives

The left Riemann sum amounts to an overestimation if f is monotonically decreasing on this interval, and an underestimation if it is monotonically increasing. The error of this formula will be

where is the maximum value of the absolute value of over the interval.

Right rule

Right Riemann sum of x - x over [0, 2] using 4 subintervals RightRiemann2.svg
Right Riemann sum of xx over [0, 2] using 4 subintervals

For the right rule, the function is approximated by its values at the right endpoints of the subintervals. This gives multiple rectangles with base Δx and height f(a + iΔx). Doing this for i = 1, ..., n, and summing the resulting areas gives

The right Riemann sum amounts to an underestimation if f is monotonically decreasing, and an overestimation if it is monotonically increasing. The error of this formula will be

where is the maximum value of the absolute value of over the interval.

Midpoint rule

Middle Riemann sum of x - x over [0, 2] using 4 subintervals MidRiemann2.svg
Middle Riemann sum of xx over [0, 2] using 4 subintervals

For the midpoint rule, the function is approximated by its values at the midpoints of the subintervals. This gives f(a + Δx/2) for the first subinterval, f(a + 3Δx/2) for the next one, and so on until f(b − Δx/2). Summing the resulting areas gives

The error of this formula will be

where is the maximum value of the absolute value of over the interval. This error is half of that of the trapezoidal sum; as such the middle Riemann sum is the most accurate approach to the Riemann sum.

Generalized midpoint rule

A generalized midpoint rule formula, also known as the enhanced midpoint integration, is given by

where denotes even derivative.

For a function defined over interval , its integral is

Therefore, we can apply this generalized midpoint integration formula by assuming that . This formula is particularly efficient for the numerical integration when the integrand is a highly oscillating function.

Trapezoidal rule

Trapezoidal sum of x - x over [0, 2] using 4 subintervals TrapRiemann2.svg
Trapezoidal sum of xx over [0, 2] using 4 subintervals

For the trapezoidal rule, the function is approximated by the average of its values at the left and right endpoints of the subintervals. Using the area formula for a trapezium with parallel sides b1 and b2, and height h, and summing the resulting areas gives

The error of this formula will be

where is the maximum value of the absolute value of .

The approximation obtained with the trapezoidal sum for a function is the same as the average of the left hand and right hand sums of that function.

Connection with integration

For a one-dimensional Riemann sum over domain , as the maximum size of a subinterval shrinks to zero (that is the limit of the norm of the subintervals goes to zero), some functions will have all Riemann sums converge to the same value. This limiting value, if it exists, is defined as the definite Riemann integral of the function over the domain,

For a finite-sized domain, if the maximum size of a subinterval shrinks to zero, this implies the number of subinterval goes to infinity. For finite partitions, Riemann sums are always approximations to the limiting value and this approximation gets better as the partition gets finer. The following animations help demonstrate how increasing the number of subintervals (while lowering the maximum subinterval size) better approximates the "area" under the curve:

Since the red function here is assumed to be a smooth function, all three Riemann sums will converge to the same value as the number of subintervals goes to infinity.

Example

Comparison of the right Riemann sum with the integral of xx2 over .
Area-under-curve-for-x-squared.svg
A visual representation of the area under the curve y = x2 over [0, 2]. Using antiderivatives this area is exactly .
Riemann sum (y=x^2).gif
Approximating the area under the curve y = x2 over [0, 2] using the right Riemann sum. Notice that because the function is monotonically increasing, the right Riemann sum will always overestimate the area contributed by each term in the sum (and do so maximally).
Riemann sum error.svg
The value of the right Riemann sum of xx2 over . As the number of rectangles increases, it approaches the exact area of .

Taking an example, the area under the curve y = x2 over [0, 2] can be procedurally computed using Riemann's method.

The interval [0, 2] is firstly divided into n subintervals, each of which is given a width of ; these are the widths of the Riemann rectangles (hereafter "boxes"). Because the right Riemann sum is to be used, the sequence of x coordinates for the boxes will be . Therefore, the sequence of the heights of the boxes will be . It is an important fact that , and .

The area of each box will be and therefore the nth right Riemann sum will be:

If the limit is viewed as n → ∞, it can be concluded that the approximation approaches the actual value of the area under the curve as the number of boxes increases. Hence:

This method agrees with the definite integral as calculated in more mechanical ways:

Because the function is continuous and monotonically increasing over the interval, a right Riemann sum overestimates the integral by the largest amount (while a left Riemann sum would underestimate the integral by the largest amount). This fact, which is intuitively clear from the diagrams, shows how the nature of the function determines how accurate the integral is estimated. While simple, right and left Riemann sums are often less accurate than more advanced techniques of estimating an integral such as the Trapezoidal rule or Simpson's rule.

The example function has an easy-to-find anti-derivative so estimating the integral by Riemann sums is mostly an academic exercise; however it must be remembered that not all functions have anti-derivatives so estimating their integrals by summation is practically important.


Higher dimensions

The basic idea behind a Riemann sum is to "break-up" the domain via a partition into pieces, multiply the "size" of each piece by some value the function takes on that piece, and sum all these products. This can be generalized to allow Riemann sums for functions over domains of more than one dimension.

While intuitively, the process of partitioning the domain is easy to grasp, the technical details of how the domain may be partitioned get much more complicated than the one dimensional case and involves aspects of the geometrical shape of the domain. [4]

Two dimensions

In two dimensions, the domain may be divided into a number of two-dimensional cells such that . Each cell then can be interpreted as having an "area" denoted by . [5] The two-dimensional Riemann sum is

where .

Three dimensions

In three dimensions, the domain is partitioned into a number of three-dimensional cells such that . Each cell then can be interpreted as having a "volume" denoted by . The three-dimensional Riemann sum is [6]

where .

Arbitrary number of dimensions

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

where , that is, it is a point in the n-dimensional cell with n-dimensional volume .

Generalization

In high generality, Riemann sums can be written

where stands for any arbitrary point contained in the set and 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 ; 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

Related Research Articles

<span class="mw-page-title-main">Antiderivative</span> Concept in calculus

In calculus, an antiderivative, inverse derivative, primitive function, primitive integral or indefinite integral of a function f is a differentiable function F whose derivative is equal to the original function f. This can be stated symbolically as F' = f. The process of solving for antiderivatives is called antidifferentiation, and its opposite operation is called differentiation, which is the process of finding a derivative. Antiderivatives are often denoted by capital Roman letters such as F and G.

In number theory, an arithmetic, arithmetical, or number-theoretic function is generally any function f(n) whose domain is the positive integers and whose range is a subset of the complex numbers. Hardy & Wright include in their definition the requirement that an arithmetical function "expresses some arithmetical property of n". There is a larger class of number-theoretic functions that do not fit this definition, for example, the prime-counting functions. This article provides links to functions of both classes.

<span class="mw-page-title-main">Integral</span> Operation in mathematical calculus

In mathematics, an integral is the continuous analog of a sum, which is used to calculate areas, volumes, and their generalizations. Integration, the process of computing an integral, is one of the two fundamental operations of calculus, the other being differentiation. Integration was initially used to solve problems in mathematics and physics, such as finding the area under a curve, or determining displacement from velocity. Usage of integration expanded to a wide variety of scientific fields thereafter.

<span class="mw-page-title-main">Riemann integral</span> Basic integral in elementary calculus

In the branch of mathematics known as real analysis, the Riemann integral, created by Bernhard Riemann, was the first rigorous definition of the integral of a function on an interval. It was presented to the faculty at the University of Göttingen in 1854, but not published in a journal until 1868. For many functions and practical applications, the Riemann integral can be evaluated by the fundamental theorem of calculus or approximated by numerical integration, or simulated using Monte Carlo integration.

In mathematics, the branch of real analysis studies the behavior of real numbers, sequences and series of real numbers, and real functions. Some particular properties of real-valued sequences and functions that real analysis studies include convergence, limits, continuity, smoothness, differentiability and integrability.

<span class="mw-page-title-main">Numerical integration</span> Methods of calculating definite integrals

In analysis, numerical integration comprises a broad family of algorithms for calculating the numerical value of a definite integral. The term numerical quadrature is more or less a synonym for "numerical integration", especially as applied to one-dimensional integrals. Some authors refer to numerical integration over more than one dimension as cubature; others take "quadrature" to include higher-dimensional integration.

<span class="mw-page-title-main">Simpson's rule</span> Method for numerical integration

In numerical integration, Simpson's rules are several approximations for definite integrals, named after Thomas Simpson (1710–1761).

In vector calculus, Green's theorem relates a line integral around a simple closed curve C to a double integral over the plane region D bounded by C. It is the two-dimensional special case of Stokes' theorem.

In mathematics, the Riemann–Stieltjes integral is a generalization of the Riemann integral, named after Bernhard Riemann and Thomas Joannes Stieltjes. The definition of this integral was first published in 1894 by Stieltjes. It serves as an instructive and useful precursor of the Lebesgue integral, and an invaluable tool in unifying equivalent forms of statistical theorems that apply to discrete and continuous probability.

In mathematics, the Henstock–Kurzweil integral or generalized Riemann integral or gauge integral – also known as the (narrow) Denjoy integral, Luzin integral or Perron integral, but not to be confused with the more general wide Denjoy integral – is one of a number of inequivalent definitions of the integral of a function. It is a generalization of the Riemann integral, and in some situations is more general than the Lebesgue integral. In particular, a function is Lebesgue integrable if and only if the function and its absolute value are Henstock–Kurzweil integrable.

<span class="mw-page-title-main">Trapezoidal rule</span> Numerical integration method

In calculus, the trapezoidal rule is a technique for numerical integration, i.e., approximating the definite integral:

In mathematics, nonstandard calculus is the modern application of infinitesimals, in the sense of nonstandard analysis, to infinitesimal calculus. It provides a rigorous justification for some arguments in calculus that were previously considered merely heuristic.

In the branch of mathematics known as real analysis, the Darboux integral is constructed using Darboux sums and is one possible definition of the integral of a function. Darboux integrals are equivalent to Riemann integrals, meaning that a function is Darboux-integrable if and only if it is Riemann-integrable, and the values of the two integrals, if they exist, are equal. The definition of the Darboux integral has the advantage of being easier to apply in computations or proofs than that of the Riemann integral. Consequently, introductory textbooks on calculus and real analysis often develop Riemann integration using the Darboux integral, rather than the true Riemann integral. Moreover, the definition is readily extended to defining Riemann–Stieltjes integration. Darboux integrals are named after their inventor, Gaston Darboux (1842–1917).

In mathematics, a sequence (s1, s2, s3, ...) of real numbers is said to be equidistributed, or uniformly distributed, if the proportion of terms falling in a subinterval is proportional to the length of that subinterval. Such sequences are studied in Diophantine approximation theory and have applications to Monte Carlo integration.

<span class="mw-page-title-main">Dirac comb</span> Periodic distribution ("function") of "point-mass" Dirac delta sampling

In mathematics, a Dirac comb is a periodic function with the formula

<span class="mw-page-title-main">Arc length</span> Distance along a curve

Arc length is the distance between two points along a section of a curve.

A product integral is any product-based counterpart of the usual sum-based integral of calculus. The first product integral was developed by the mathematician Vito Volterra in 1887 to solve systems of linear differential equations. Other examples of product integrals are the geometric integral, the bigeometric integral, and some other integrals of non-Newtonian calculus.

The fundamental theorem of calculus is a theorem that links the concept of differentiating a function with the concept of integrating a function. The two operations are inverses of each other apart from a constant value which depends on where one starts to compute area.

In mathematics, a line integral is an integral where the function to be integrated is evaluated along a curve. The terms path integral, curve integral, and curvilinear integral are also used; contour integral is used as well, although that is typically reserved for line integrals in the complex plane.

In the branch of mathematics known as integration theory, the McShane integral, created by Edward J. McShane, is a modification of the Henstock-Kurzweil integral. The McShane integral is equivalent to the Lebesgue integral.

References

  1. Hughes-Hallett, Deborah; McCullum, William G.; et al. (2005). Calculus (4th ed.). Wiley. p. 252. (Among many equivalent variations on the definition, this reference closely resembles the one given here.)
  2. 1 2 3 Hughes-Hallett, Deborah; McCullum, William G.; et al. (2005). Calculus (4th ed.). Wiley. p. 340. So far, we have three ways of estimating an integral using a Riemann sum: 1. The left rule uses the left endpoint of each subinterval. 2. The right rule uses the right endpoint of each subinterval. 3. The midpoint rule uses the midpoint of each subinterval.
  3. 1 2 3 Ostebee, Arnold; Zorn, Paul (2002). Calculus from Graphical, Numerical, and Symbolic Points of View (Second ed.). p. M-33. Left-rule, right-rule, and midpoint-rule approximating sums all fit this definition.
  4. Swokowski, Earl W. (1979). Calculus with Analytic Geometry (Second ed.). Boston, MA: Prindle, Weber & Schmidt. pp. 821–822. ISBN   0-87150-268-2.
  5. Ostebee, Arnold; Zorn, Paul (2002). Calculus from Graphical, Numerical, and Symbolic Points of View (Second ed.). p. M-34. We chop the plane region R into m smaller regions R1, R2, R3, ..., Rm, perhaps of different sizes and shapes. The 'size' of a subregion Ri is now taken to be its area, denoted by ΔAi.
  6. Swokowski, Earl W. (1979). Calculus with Analytic Geometry (Second ed.). Boston, MA: Prindle, Weber & Schmidt. pp. 857–858. ISBN   0-87150-268-2.