Riemann Sums and the Riemann Integral
How do we make precise the area under a curve? Every calculus student learns to slice a region into thin rectangles. They add up their areas, then let the slices shrink to nothing. But turning this picture into a rigorous limit is surprisingly delicate. The difficulty is that a "limit as the slices shrink" is not a limit along the natural numbers. It is also not a limit along the real line in the usual sense. Instead, it is a limit over an enormous, only partially ordered collection of partitions. Each partition carries arbitrary sample points. This article gives the precise definition of a Riemann sum over a tagged partition. It defines the Riemann integral as the limit of these sums as the mesh tends to zero. It also proves the basic existence and uniqueness facts that make the definition sound. The payoff of doing this carefully is enormous. Once the limit is properly defined, one can prove things rather than merely illustrate them. We can prove that continuous functions are integrable. We can prove that the integral is linear and monotone. Eventually, we can show differentiation and integration are inverse processes via the Fundamental Theorem of Calculus. Nearly every later theorem about integrals rests on the exact quantifier structure of the definition given here. For every tolerance there is a mesh size . Every tagged partition finer than must satisfy a condition. With any choice of sample points, it produces a Riemann sum within of the integral. Getting this quantifier order wrong is the single most common error students make with this material. The big picture is that the Riemann integral is a limit of a net of numbers. These are the Riemann sums, indexed by tagged partitions ordered by refinement. Mesh going to zero is a cofinal condition on that net. It is not a sequential limit. This article treats that limit rigorously using an – formulation. This formulation is equivalent to the net/filter formulation. It proves that the limit is unique when it exists. It proves integrability of monotone and continuous functions directly from the definition. It also gives a genuine, checkable counterexample: the Dirichlet function. This example shows why some regularity hypothesis on is unavoidable. By the end you will be able to state the definition of the Riemann integral precisely. You will verify integrability of a specific function from the – definition by hand. You will also see exactly where this definition connects to the upper/lower sum (Darboux) approach developed elsewhere.
- A Riemann sum approximates area using a tagged partition of .
- The mesh measures how fine the partition is.
- is Riemann integrable on if the Riemann sums converge to a single number as , for every choice of tags.
- The limit, when it exists, is unique and is denoted .
- Existence of this limit is a genuinely strong condition: it fails for wildly discontinuous functions like the Dirichlet function.
- Key idea: integrability means Riemann sums cluster near one number uniformly over all tag choices, once the partition is fine enough — not just for some clever choice of tags.
Where this lives today
The Riemann integral, built exactly from the tagged-partition limit defined here, is the computational backbone of introductory and applied calculus: areas, volumes of revolution, arc length, work, and probability densities are all first computed as such limits before any Fundamental Theorem shortcut is invoked. In numerical analysis, Riemann sums with specific tag rules (left, right, midpoint, trapezoidal) are the starting point for quadrature algorithms used throughout scientific computing and engineering simulation, where mesh refinement is literally implemented in code as the partition becomes finer. In probability and statistics, Riemann-type sums underlie the discretization of continuous density functions when computing expectations numerically, and the entire framework of Riemann–Stieltjes integration (a direct generalization allowing sums against an increasing function rather than length) extends this article's definition to weighted measures used in statistics and financial mathematics. In physics, Riemann sums are the rigorous justification for treating continuous mass, charge, or energy distributions as limits of discrete point samples, connecting directly to the definitions of center of mass and moments of inertia. Finally, this framework is the historical and pedagogical bridge to the Darboux and Lebesgue theories: understanding precisely how the mesh-tends-to-zero limit is built here is prerequisite to appreciating why the Darboux approach via suprema and infima of sums gives an equivalent but more tractable theory, and why Lebesgue's measure-theoretic integral is needed to integrate functions, like the Dirichlet function, that defeat the Riemann definition entirely.
:::quiz[Which of the following functions on [0,1] is guaranteed integrable by the theorems proved in this article?]
- the Dirichlet function
- any bounded function
- a nondecreasing bounded function ✓
- any function taking only finitely many values, regardless of structure
Ask the tutor: Can you show me step-by-step why the Riemann integral of a function with a single removable discontinuity still exists, using the oscillation argument from the monotone case?
Let be a closed bounded interval with , and let be a bounded function. A partition of is a finite set of points
A tagged partition is a pair where satisfies for each ; the point is called the tag of the subinterval . The mesh (or norm) of is
Given a tagged partition of , the Riemann sum of over is
We say is Riemann integrable on with integral , and write
if for every there exists such that for every partition with and every choice of tags ,
Equivalently, in net language: order the set of tagged partitions of by refinement, and consider the family indexed by of the sets ; these sets form a base of a filter (they are nonempty and nested downward as ), and is Riemann integrable with integral exactly when along this filter. The – formulation above is the concrete unpacking of that limit and is what will be used throughout.
Intuition
Picture the graph of over . A tagged partition chops into subintervals and, on each one, erects a rectangle whose height is evaluated at the tag — a sample point that can sit anywhere inside that subinterval, including at an endpoint. The Riemann sum is the total signed area of these rectangles. As the mesh shrinks, each rectangle becomes a thinner and thinner sliver, and intuitively the total area should approach the "true" area under the curve, no matter which sample point was used inside each sliver. The subtlety the definition is built to handle is this freedom of tag choice. A careless definition might fix, say, left endpoints or midpoints and take a limit; that would be too weak, because a genuinely pathological function could behave differently on rationals versus irrationals and give different limiting values for different tagging rules. The correct notion of integrability demands that once the mesh is small enough, the sum is close to regardless of which tags were used — the bound on must hold uniformly over all -many tag choices simultaneously. This is what makes Riemann integrability a strong, robust, and useful hypothesis rather than an artifact of a particular rectangle-choosing rule.
Central results
Let be a bounded function. Suppose both satisfy the definition of the Riemann integral of on : that is, for every there is such that every tagged partition with satisfies , for . Then .
Technique: direct -argument (triangle inequality), exploiting nonemptiness of the relevant sets of partitions. Fix . By hypothesis applied to with tolerance , there is such that every tagged partition with satisfies
By hypothesis applied to with tolerance , there is such that every tagged partition with satisfies
Let . We must exhibit at least one tagged partition with mesh less than to which both bounds apply; existence of such a partition is not automatic from the definition alone and must be checked, since is a fixed nondegenerate interval. Since , choose with , and let be the uniform partition . Then . Choose any tags, say (any legal choice works). This tagged partition satisfies and , so both displayed inequalities apply to it simultaneously:
By the triangle inequality,
Since was arbitrary and holds for every , we conclude , i.e. .
∎If is Riemann integrable in the sense of the definition above, then is bounded on .
Technique: contrapositive, forcing an arbitrarily large Riemann sum by choice of a single tag. We prove the contrapositive: if is unbounded on , then no candidate value satisfies the – definition, i.e. the limit defining the integral cannot exist. Suppose is unbounded and, toward a contradiction, that satisfies the definition. Apply the definition with : there is such that every tagged partition with mesh less than has Riemann sum within of . Fix any single partition with (such a partition exists by the same uniform-partition construction as above). Since is unbounded on , must be unbounded on at least one subinterval (a finite union of sets on which is bounded would itself be a set on which is bounded, taking the max of the finitely many bounds). Fix tags for arbitrarily (e.g. ), and let , a fixed finite real number depending only on these choices. Since is unbounded on , we may choose with
which is possible because is a fixed positive number and can be made arbitrarily large in absolute value. For this tagged partition,
so , contradicting that every tagged partition with mesh has sum within of . This contradiction shows no such exists, so is not Riemann integrable.
∎Let be monotone (either nondecreasing or nonincreasing) on . Then is Riemann integrable on .
Technique: Cauchy-type criterion via oscillation control, using monotonicity to bound the total oscillation by a telescoping sum. Assume without loss of generality that is nondecreasing (if nonincreasing, apply the argument to and use that a Riemann sum for is the negative of the corresponding sum for , so integrability of one gives integrability of the other, with ). Since is monotone on , it is bounded: for all .
Step 1: a Cauchy criterion suffices. We first show it is enough to prove: for every there is such that for any two tagged partitions and with and ,
Granting , for each choose witnessing for , and pick any tagged partition with (possible by the uniform-partition construction used above). By , for (so that bounds both meshes appropriately — more precisely, for any with , which holds once by construction) we get . Hence is a Cauchy sequence of real numbers, so by completeness of it converges to some . A further application of (letting in the inequality above, for fixed , using continuity of ) shows that in fact every tagged partition with satisfies , which is exactly the – definition of (with the harmless replacement of by to get strict inequality, or by re-indexing ).
Step 2: proving for monotone . Let . Set (the avoids division by zero if , i.e. constant, which is trivially integrable). Let and be tagged partitions with . Let be the common refinement, a partition of containing all points of both, and let . Claim: for any choice of tags on , and symmetrically for . Indeed, each subinterval of is a union of consecutive subintervals of , say with , . On this block, monotonicity of gives, for any tags and the original tag ,
using that so . Since , monotonicity gives (the oscillation of over ). Hence the block contributes at most , since . Summing over all and telescoping,
The identical argument with in place of gives , using the same tags on in both comparisons (we are free to fix one common choice of on and compare both original sums to it). By the triangle inequality,
by choice of . This proves , and Step 1 completes the proof that is Riemann integrable.
∎If is continuous, then is Riemann integrable on . (Proof strategy, stated for context: continuity on the compact interval gives uniform continuity, which controls the oscillation of on subintervals directly in place of the monotonicity bound used above; the rest of the Cauchy-criterion argument is identical. A full proof belongs with <a class="wiki-link" href="/wiki/math-analysis-equivalence-riemann-darboux" data-track="wiki_article.body.wiki_link">Equivalence of Riemann and Darboux Integrals</a>, where oscillation-based estimates are developed systematically.)
Worked examples
Example 1: Integrating on directly from the definition, using an uneven partition. We verify, using the – definition, that a specific tagged Riemann sum for on with a non-uniform partition and non-endpoint tags is close to the true value (this value will ultimately be justified by the Fundamental Theorem of Calculus, but here we simply illustrate the mesh-refinement mechanics of the definition). Take the partition
with subinterval lengths , so . Choose tags at, say, the right-hand-leaning points
each legitimately inside its subinterval (, , , ). Compute:
Summing,
This is not yet close to because the mesh is coarse. Now refine: split each subinterval of into equal pieces (so , an actual refinement, mesh reduced tenfold) and re-tag using, e.g., left endpoints of each sub-subinterval. Rather than compute all terms by hand, we invoke the estimate from the theorem's proof technique (Step 2 above adapted to a bound valid for functions, since is monotone on ): the difference between Riemann sums for two partitions of mesh is at most . Taking , any two tagged partitions of mesh agree to within . Iterating this shrinking-mesh argument (as in Step 1 of the proof) shows the sums converge; carrying out the refinement numerically confirms – for mesh , consistent with the limit . The point of the exercise is procedural: shrinking from to moved the sum from toward the cluster point , exactly as the – definition demands, regardless of which interior tags were used at each stage.
Example 2: A monotone but discontinuous function, integrated using the machinery of the theorem. Let
on . This is nondecreasing (check: respecting the order) but discontinuous at , so it is not covered by the continuity corollary — it requires the monotone-integrability theorem itself. By that theorem, is Riemann integrable on . We identify the value of the integral and verify a specific Riemann sum is close to it. Geometrically, is on , jumps to at the single point (measure zero, contributing nothing to area), then is on . The expected integral is
Test with the uneven partition , mesh (still coarse) and asymmetric tags , (note: this tag lands exactly on the discontinuity, deliberately, to test robustness), :
Already at coarse mesh, the sum is close to — the deviation of comes entirely from the single subinterval straddling the jump, contributing instead of a "true" contribution that should be split as (nearly) from the part left of and (length right of 1) from the part right of . As the mesh shrinks, the length of whichever subinterval straddles shrinks too, so the tag's exact value there matters less and less: the worst possible error contributed by that single straddling subinterval is bounded by (its length)(oscillation of ) . This matches exactly the oscillation-telescoping estimate used in the proof of the monotone integrability theorem, now witnessed numerically, and shows why the single jump discontinuity at causes no trouble for integrability — it is invisible in the limit because it occupies zero length.
Drop the hypothesis of monotonicity/continuity entirely and consider the Dirichlet function on :
This is bounded (values in ), so boundedness alone does not save integrability. We show directly from the – definition that is not Riemann integrable on , i.e. no real number satisfies the definition. Suppose toward a contradiction that some satisfies the definition, and apply it with : there is such that every tagged partition with mesh has Riemann sum within of . Fix any partition with (again, such a partition of the fixed interval exists by the uniform-partition construction). Because every subinterval has , the density of in guarantees a rational , and the density of in guarantees an irrational (both standard density facts about , used here as known background). Form two tagged partitions on the same :
- , all-rational tags, giving
- , all-irrational tags, giving
Both and are tagged partitions with mesh , so both must satisfy the bound: and . The first gives ; the second gives . These are contradictory ( is false), so no such exists.
Diagnosis. The theorem's hypotheses (monotonicity, or continuity) are exactly what prevented this: they controlled the oscillation of on each small subinterval, forcing to be small whenever lie in a short common subinterval. The Dirichlet function has infinite oscillation — arbitrarily close to any point, it takes both values and — on every subinterval, no matter how short, so shrinking the mesh never controls the gap between different tag choices. This is precisely the mechanism that fails, and it is why the Riemann sum limit does not exist for , even though is bounded.
Scope, edge cases & common traps
| Situation | What holds | What can fail |
|---|---|---|
| continuous on | Riemann integrable (Corollary) | — |
| monotone on , possibly discontinuous | Riemann integrable (Theorem) | Integral may not be computable in closed form without further theorems |
| bounded with finitely many discontinuities | Integrable (provable via oscillation control, foreshadowing the Darboux criterion) | Requires an argument beyond the basic monotone/continuous cases given here |
| unbounded on | Never Riemann integrable | Common error: trying to assign via an "improper" limit while still calling it Riemann integrable |
| (Dirichlet function), bounded, everywhere discontinuous | Not Riemann integrable | Riemann sums with rational vs. irrational tags never agree, at any mesh |
| Tags fixed in advance (e.g. always right endpoint) | A weaker limit may exist even when the full Riemann integral does not | This is not the Riemann integral — it fails to test all tag choices |
The mathematician behind it
Origins · 1 minBernhard Riemann and how this was discovered
Georg Friedrich Bernhard Riemann was a German mathematician whose 1854 habilitation lecture on the foundations of geometry and whose contemporaneous work on trigonometric series reshaped analysis, geometry, and later physics. He formulated the integral bearing his name to settle exactly which functions can be represented by Fourier series, a question that forced him to isolate the precise limiting process of tagged partitions and vanishing mesh described in this article.
Why does the definition require every choice of tags, not just one?
Requiring only one fixed tagging rule (say, always the left endpoint) defines a weaker, rule-dependent limit, not the Riemann integral. The genuine Riemann integral demands that once the mesh is below some , every legal tag choice on every such partition gives a sum within of . This uniformity over tags is what makes the integral a property of and the interval alone, independent of any arbitrary sampling convention, and it is exactly the property that fails for the Dirichlet function, where rational and irrational tags give provably different sums at every mesh.
Is mesh going to zero the same kind of limit as a sequential limit n → ∞?
Not exactly. The collection of tagged partitions ordered by refinement, or equivalently indexed by mesh size , does not form a sequence indexed by in a canonical way; it is better modeled as a limit along a directed set or filter, since there are uncountably many partitions of any given mesh. The – formulation used in this article is a faithful, concrete unpacking of that filter limit, and it can be shown equivalent to the net/filter definition, but writing "as " for a sequence of partitions is only valid once you fix a specific sequence with mesh tending to , and even then, uniformity over all tag choices at each stage must still be checked.
Does Riemann integrability require f to be continuous?
No. Continuity is sufficient but not necessary. The theorem proved in this article shows monotone functions are integrable even with jump discontinuities, and more advanced criteria (developed alongside the Darboux approach) show that any bounded function with only finitely many, or even countably many, discontinuities is still Riemann integrable. What is required is that the discontinuities be "small" in a precise sense — informally, that they do not accumulate enough to prevent oscillation of from being controlled on shrinking subintervals, as concretely happens with the everywhere-discontinuous Dirichlet function.
How does this definition relate to the Darboux (upper and lower sum) integral?
The Darboux approach replaces the arbitrary tag in each subinterval with the supremum or infimum of there, producing upper sums and lower sums , and defines integrability as . This sidesteps quantifying over all tag choices, which makes many proofs more tractable. It is a theorem — covered in Equivalence of Riemann and Darboux Integrals — that a bounded function is Riemann integrable in the tagged-partition sense of this article if and only if it is Darboux integrable, and the two integrals then agree. The Darboux route often gives shorter existence proofs, at the cost of a definition slightly less directly tied to the "area of thin rectangles" intuition.
Can the Riemann integral be extended to unbounded intervals or unbounded functions?
Not directly by this definition, since the lemma above shows unboundedness of on already destroys integrability, and the definition presupposes a bounded interval . Such extensions are handled by improper Riemann integrals, defined as limits of proper Riemann integrals over larger and larger bounded subintervals (e.g. ), which is a separate limiting process layered on top of, not a modification of, the definition given here.
What role does completeness of the real numbers play in this theory?
Completeness of is essential and enters explicitly in the proof that monotone functions are integrable: after establishing the Cauchy-type criterion for Riemann sums, we extract a Cauchy sequence of real numbers and invoke completeness to guarantee it converges to some limit . Over the rationals, for instance, such Cauchy sequences of Riemann sums might have no limit within the number system, so the existence half of Riemann integrability genuinely depends on the least-upper-bound property, or equivalently Cauchy completeness, of .
Why does the mesh alone, and not the number of subintervals n, control the quality of approximation?
Two partitions can have the same large but wildly different mesh if the subintervals are very uneven — for instance, tiny subintervals and one enormous one. The definition is stated in terms of mesh precisely because it is the length of the worst subinterval that controls how much can vary within any one piece, which is what actually bounds the error between the Riemann sum and the true integral. A large with one leftover long subinterval offers no guarantee of accuracy, which is exactly why , not , is the correct limiting condition.