- Riemann sum
In
mathematics , a Riemann sum is a method for approximating the total area underneath a curve on a graph, otherwise known as anintegral . It may also be used to define the integration operation. The sums are named after the German mathematicianBernhard Riemann .Definition
Consider a function "f": "D" → R, where "D" is a subset of the
real number s R, and let "I" = ["a", "b"] be aclosed interval contained in "D". A finite set of points {"x"0, "x"1, "x"2, ... "x""n"} such that "a" = "x"0 < "x"1 < "x"2 ... < "x""n" = "b" creates a partition:"P" = {
[ "x"0, "x"1),[ "x"1, "x"2), ... ["x""n"-1, "x""n"] }of "I".
If "P" is a partition with "n" elements of "I", then the Riemann sum of "f" over "I" with the partition "P" is defined as
:
where "x""i"-1 ≤ "y""i" ≤ "x""i". The choice of "y""i" in this interval is arbitrary. If "y""i" = "x""i"-1 for all "i", then "S" is called a left Riemann sum. If "y""i" = "x""i", then "S" is called a right Riemann sum. If "y""i" = ("x""i"+"x""i-1")/2, then "S" is called a middle Riemann sum. By averaging the left and right Riemann sum one obtains the so-called trapezoidal sum.
Suppose we have
:
where "v""i" is the
supremum of "f" over ["x""i"-1, xi] ; then "S" is defined to be an upper Riemann sum. Similarly, if "v""i" is theinfimum of "f" over ["x""i"−1, "x""i"] , then "S" is a lower Riemann sum.Any Riemann sum on a given partition (that is, for any choice of "y""i" between "x""i"-1 and "x""i") is contained between the lower and the upper Riemann sums. A function is defined to be "Riemann integrable" if the lower and upper Riemann sums get ever closer as the partition gets finer and finer. This fact can also be used for
numerical integration .Methods
As seen above, there are four common methods to compute a Riemann sum: left, right, middle, and trapezoidal. We will elaborate on them in the simple case when the partition is made up of intervals of equal size. Thus, divide the interval ["a", "b"] into "n" subintervals, each of length "Q" = ("b" − "a") / "n". The points in the partition will then be
: "a", "a" + "Q", "a" + 2"Q", ..., "a" + ("n"−2)"Q", "a" + ("n"−1)"Q"," b".
Left Riemann sum
For the left Riemann sum, we will approximate the function by its value at the left-end point. This gives multiple rectangles with base "Q" and height "f"("a" + "iQ"). Doing this for "i" = 0, 1, ..., "n"−1, and adding up the resulting areas gives us :
The left-hand Riemann sum will be an overestimation if "f" is
monotonically decreasing on this interval, and an underestimation if it ismonotonically increasing .Right Riemann sum
Here, for each interval we will approximate "f" by the value at the right endpoint. This gives multiple rectangles with base "Q" and height "f"("a" + "iQ"). Doing this for "i" = 1, 2, ..., "n"−1, n, and adding up the resulting areas gives us :
The right-hand Riemann sum will be an overestimation if the function "f" is
monotonically increasing , and an underestimation if it ismonotonically decreasing .Middle sum
In this case we will take as approximation for "f" in each interval its value at the midpoint. For the first interval we will thus have "f"("a" + "Q"/2), for the next one "f"("a" + 3"Q"/2), and so on until "f"("b"-"Q"/2) is reached. Summing up the areas, we find
:
The error of this formula will be
:
where is the maximum value of the
absolute value of on the interval.Trapezoidal rule
In this case, the values of the function "f" on an interval will be approximated by the average of the values at the left and right endpoints. In the same manner as above, a simple calculation using the area formula for a trapezium with parallel sides "b"1, "b"2 and height "h" one calculates the Riemann sum to be
:
The error of this approximation for the integral is
:
where is the maximum value of the absolute value of
ee also
*
Riemann-Stieltjes integral
*Lebesgue integral
*Simpson's rule External links
* [http://www.vias.org/simulations/simusoft_riemannsum.html A simulation showing the convergence of Riemann sums]
Wikimedia Foundation. 2010.