World Library  
Flag as Inappropriate
Email this Article

Riemann sum

Article Id: WHEBN0000176478
Reproduction Date:

Title: Riemann sum  
Author: World Heritage Encyclopedia
Language: English
Subject: Integral, Line integral, Partition of an interval, Calculus, Missing science topics/ExistingMathR
Collection: Integral Calculus
Publisher: World Heritage Encyclopedia

Riemann sum

Four of the Riemann summation methods for approximating the area under curves. Right and left methods make the approximation using the right and left endpoints of each subinterval, respectively. Maximum and minimum 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 an approximation that takes the form \sum f(x) \Delta x. It is named after German mathematician Bernhard Riemann. One very common application is approximating the area of functions or lines on a graph, but also the length of curves and other approximations.

The sum is calculated by dividing the region up into shapes (rectangles, trapezoids, parabolas, or cubics) 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 filled 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 1
  • Methods 2
    • Left Riemann Sum 2.1
    • Right Riemann Sum 2.2
    • Middle sum 2.3
    • Trapezoidal Rule 2.4
  • Example 3
  • Animations 4
  • See also 5
  • References 6
  • External links 7


Let f : DR be a function defined on a subset, D, of the real line, R. Let I = [a, b] be a closed interval contained in D, and let

P= \left \ \right \},

be a partition of I, where


A Riemann sum of f over I with partition P is defined as

S = \sum_{i=1}^{n} f(x_i^*)(x_{i}-x_{i-1}), \quad x_{i-1}\le x_i^* \le x_i.

Notice the use of "a" instead of "the" in the previous sentence. This is due to the fact that the choice of x_i^* in the interval [x_{i-1},x_i] is arbitrary, so for any given function f defined on an interval I and a fixed partition P, one might produce different Riemann sums depending on which x_i^* is chosen, as long as x_{i-1}\le x_i^* \le x_i holds true.

Example: Specific choices of x_i^* give us different types of Riemann sums:

  • If x_i^*=x_{i-1} for all i, then S is called a left Riemann sum.
  • If x_i^*=x_i for all i, then S is called a right Riemann sum.
  • If x_i^*=\tfrac{1}{2}(x_i+x_{i-1}) for all i, then S is called a middle Riemann sum.
  • The average of the left and right Riemann sum is the trapezoidal sum.
  • If it is given that
S = \sum_{i=1}^{n} v_i(x_{i}-x_{i-1}),
where v_i is the supremum of f over [x_{i-1},x_i], then S is defined to be an upper Riemann sum.
  • Similarly, if v_i is the infimum of f over [x_{i-1},x_i], then S is a lower Riemann sum.
Riemann sum methods of x3 over [0,2] using 4 subdivisions

Any Riemann sum on a given partition (that is, for any choice of x_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.


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

\Delta x = \frac{b-a}{n}.

The points in the partition will then be

a, a + \Delta x, a + 2 \Delta x, \ldots, a + (n-2) \Delta x, a + (n-1) \Delta x, b.

Left Riemann Sum

For the left Riemann sum, approximating the function by its value at the left-end point gives multiple rectangles with base Δx and height f(a + iΔx). Doing this for i = 0, 1, ..., n − 1, and adding up the resulting areas gives

\Delta x \left[f(a) + f(a + \Delta x) + f(a + 2 \Delta x)+\cdots+f(b - \Delta x)\right].

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

Right Riemann Sum

f is here approximated by the value at the right endpoint. This gives multiple rectangles with base Δx and height f(a + iΔx). Doing this for i = 1, ..., n, and adding up the resulting areas produces

Middle sum

Approximating f at the midpoint of intervals gives f(a + Δx/2) for the first interval, for the next one f(a + 3Δx/2), and so on until f(b − Δx/2). Summing up the areas gives

\Delta x\left[f(a + \tfrac{\Delta x}{2}) + f(a + \tfrac{3\Delta x}{2})+\cdots+f(b-\tfrac{\Delta x}{2})\right].

The error of this formula will be

\left \vert \int_{a}^{b} f(x) \, dx - A_\mathrm{mid} \right \vert \le \frac{M_2(b-a)^3}{24n^2},

where M_2 is the maximum value of the absolute value of f^{\prime\prime}(x) on the interval.

Trapezoidal Rule

In this case, the values of the function f on an interval are 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 b1, b2 and height h produces

\tfrac{1}{2}\Delta x\left[f(a) + 2f(a+\Delta x) + 2f(a+2\Delta x) + 2f(a+3\Delta x)+\cdots+f(b)\right].

The error of this formula will be

\left \vert \int_{a}^{b} f(x) \, dx - A_\mathrm{trap} \right \vert \le \frac{M_2(b-a)^3}{12n^2},

where M_2 is the maximum value of the absolute value of f^{\prime\prime}(x).

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


A visual representation of the area under the curve y = x2 for the interval from 0 to 2
The value of the Riemann sum under the curve y = x2 from 0 to 2. As the number of rectangles increases, it approaches the exact area of 8/3.

Taking an example, the area under the curve of y = x2 between 0 and 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 \tfrac{2}{n}; 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 x_1, x_2, \ldots, x_n. Therefore, the sequence of the heights of the boxes will be x_1^2, x_2^2, \ldots, x_n^2. It is an important fact that x_i = \tfrac{2i}{n}, and x_n = 2.

The area of each box will be \tfrac{2}{n} \times x_i^2 and therefore the nth right Riemann sum will be:

\begin{align} S &= \frac{2}{n} \times \left(\frac{2}{n}\right)^2 + \cdots + \frac{2}{n} \times \left(\frac{2i}{n}\right)^2 + \cdots + \frac{2}{n} \times \left(\frac{2n}{n}\right)^2 \\ &= \frac{8}{n^3} \left(1 + \cdots + i^2 + \cdots + n^2\right)\\ &= \frac{8}{n^3} \left(\frac{n(n+1)(2n+1)}{6}\right)\\ &= \frac{8}{n^3} \left(\frac{2n^3+3n^2+n}{6}\right)\\ &= \frac{8}{3} + \frac{4}{n} + \frac{4}{3n^2} \end{align}

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:

\lim_{n \to \infty} S = \lim_{n \to \infty}\left(\frac{8}{3} + \frac{4}{n} + \frac{4}{3n^2}\right) = \frac{8}{3}

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

\int_0^2 x^2\, dx = \frac{8}{3}


See also


  • Thomas, George B. Jr.; Finney, Ross L. (1996), Calculus and Analytic Geometry (9th ed.), Addison Wesley,  

External links

  • A simulation showing the convergence of Riemann sums
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.