The Riemann sum is the foundation of numerical integration and a key step toward understanding the definite integral. Whether you are a student meeting calculus for the first time or someone refreshing old concepts, seeing the formula laid out clearly — and knowing where it comes from — makes all the difference. This page breaks down the Riemann sum formula, shows how it is derived, and explores its practical uses and limitations. For a broader introduction, see What is a Riemann Sum? Definition & Examples (2026).
The Riemann Sum Formula
The general Riemann sum formula approximates the definite integral of a function f(x) from a to b by summing areas of rectangles (or other shapes) over n subintervals:
∫_a^b f(x) dx ≈ Σ_{i=1}^{n} f(x_i^*) · Δx
where:
- Δx = (b − a) / n is the width of each subinterval.
- n is the number of subintervals (the more, the better the approximation).
- x_i^* is a sample point inside the i-th subinterval. This point determines the height of the rectangle.
- f(x_i^*) is the function value at that sample point — the rectangle’s height.
- The Σ (summation) adds up the areas of all n rectangles.
The choice of x_i^* leads to different methods:
- Left Riemann sum: uses the left endpoint of each subinterval.
- Right Riemann sum: uses the right endpoint.
- Midpoint Riemann sum: uses the midpoint of each subinterval.
- Trapezoidal rule: uses a trapezoid whose top side is the line connecting the endpoints (average of left and right heights).
- Simpson’s rule: uses parabolic arcs instead of straight lines (more accurate for smooth functions).
Each method has its own formula, but all share the same basic structure. You can explore step-by-step calculations with our How to Calculate a Riemann Sum: Step-by-Step Guide (2026).
Derivation and Intuition
The idea behind the formula is simple: approximate a curved area by adding up many thin rectangles whose areas are easy to compute.
Step 1 – Partition the interval. Split [a, b] into n equal pieces of width Δx = (b−a)/n. The division points are x₀ = a, x₁ = a + Δx, …, x_n = b.
Step 2 – Choose a sample point. For each subinterval [x_{i−1}, x_i], pick a point x_i^* (e.g., left, right, or middle). The height of the rectangle is f(x_i^*).
Step 3 – Sum the rectangle areas. Each rectangle has area f(x_i^*) · Δx. Summing over all n rectangles gives the total approximate area:
Approximation = Σ_{i=1}^{n} f(x_i^*) · Δx
Why does this work? As n grows large, Δx becomes very small. The rectangles become so thin that their tops follow the curve closely. The sum of their areas approaches the true area under the curve — the definite integral. In the limit as n → ∞, the Riemann sum equals the exact integral (provided the function is well-behaved).
Units: If f(x) is a rate (e.g., velocity in m/s) and x is time (s), then f(x_i^) · Δx has units (m/s)·(s) = meters, which makes total distance. The Riemann sum thus converts a rate over time into a total quantity, which is why integrals are so powerful.
Practical Implications
The Riemann sum is not just a theoretical tool — it has real-world uses in physics, engineering, economics, and statistics.
- Numerical integration: Many functions have no simple antiderivative (e.g., e^{−x²}). Riemann sums (and more refined methods like Simpson’s rule) let us compute approximate values.
- Error control: The approximation error decreases as n increases. For a smooth function, the error in the left or right Riemann sum is roughly proportional to 1/n. The midpoint and trapezoidal rules have error proportional to 1/n², so they converge faster. Simpson’s rule error is proportional to 1/n⁴.
- Choosing the method: For a monotonic (always increasing or decreasing) function, the left and right sums bracket the true area (one overestimates, the other underestimates). The midpoint often gives a better balance. For oscillatory functions, higher-order rules are safer.
Understanding the meaning of different approximations is crucial. The page Riemann Sum Results: What Do Different Values Mean? explains how to interpret computed results.
Edge Cases and Limitations
While the Riemann sum formula is robust, it has limits:
- Discontinuous functions: If f(x) has a jump discontinuity inside the interval, the Riemann sum may produce a value but the integral (in the usual sense) may not exist unless the discontinuity is removable. The calculator assumes functions are continuous on the interval.
- Infinite intervals: Riemann sums as described only work on finite intervals. For improper integrals (like from 1 to ∞), you need to take a limit as the upper bound goes to infinity. Our calculator currently handles only finite [a, b].
- Oscillatory and highly curved functions: Functions that wiggle a lot require many subintervals for a good approximation. Increasing n helps but may become computationally expensive.
- Negative function values: When f(x) is negative, the “area” can be negative. The Riemann sum correctly adds signed areas (positive above the x-axis, negative below). The total can be zero if positive and negative parts cancel.
For a quick reference on common questions, see the Riemann Sums FAQ: Common Questions Answered (2026).
Historical Note
The concept is named after German mathematician Bernhard Riemann (1826–1866). In his 1854 habilitation thesis, Riemann gave a rigorous definition of the integral using sums of the form we use today. His work unified earlier intuitive ideas from Archimedes, Cavalieri, and others into a precise mathematical theory. The “Riemann sum” we compute in calculus classes is a direct legacy of this work.
Riemann’s definition allowed mathematicians to identify exactly which functions are integrable and opened the door to more advanced integration theories, like the Lebesgue integral. Even so, the simple Riemann sum remains the most intuitive and widely taught method for understanding what an integral really means.
For concrete applications of these ideas in physics, read Riemann Sums in Physics: Applications & Examples (2026).
Try the free Riemann Sum Calculator ⬆
Get your Riemann sum: a method for approximating the definite integral of a function using rectangular or trapezoidal subdivisions. result instantly — no signup, no clutter.
Open the Riemann Sum Calculator