Riemann Sum Calculator
Approximate the definite integral of a function by summing the areas of rectangles across an interval.
Function f(x)
Sample point
Approximate area under the curve
- 1
Subinterval width (Δx)
(2 − 0) ÷ 8 = 0.25 - 2
Riemann sum
8 rectangles × f(xᵢ*) × 0.25 = 2.6563Each rectangle has width Δx and height f(xᵢ*) evaluated at the chosen sample point.
How does this calculator work?
A Riemann sum estimates the area under f(x) on [a, b] by adding rectangles of width Δx = (b − a)/n. Pick left, right, or midpoint sample points; the sum Σ f(xi*)·Δx approximates the integral. More subintervals give a closer approximation, and the midpoint rule is usually the most accurate.
Formula
How this is calculated
A Riemann sum approximates the area under a curve f(x) between x = a and x = b by dividing the interval into n equal subintervals, each of width Δx = (b − a) / n. On each subinterval a sample point xi* is chosen and the rectangle of height f(xi*) and width Δx is added up: the sum Σ f(xi*)·Δx estimates the definite integral.
The sample point type controls where each rectangle touches the curve. Left endpoints use xi* = a + i·Δx, right endpoints use xi* = a + (i+1)·Δx, and midpoints use xi* = a + (i + 0.5)·Δx, with i running from 0 to n−1. Midpoint sums are usually the most accurate of the three for a given n; left and right sums systematically over- or under-estimate on monotonic functions.
Inputs are the function (chosen from a list), the bounds a and b, the number of subintervals n (a positive integer), and the sample type. As n increases the sum converges to the true integral. Note that if a > b the width Δx is negative, which flips the sign of the result, and choosing a function undefined on part of the interval (such as 1/x across 0 or √x for negative x) returns no result.
Frequently asked questions
For a fixed number of subintervals the midpoint rule is generally the most accurate, since over- and under-estimates on each subinterval tend to cancel. Left and right sums are less accurate but simpler to reason about.
As the number of subintervals n increases, the rectangle widths shrink and the Riemann sum converges to the exact value of the definite integral ∫ from a to b of f(x) dx.
The calculator returns nothing if n is less than 1, if a equals b, or if the chosen function is undefined anywhere it is sampled (for example 1/x at x = 0 or √x for negative x).
Also known as
TG we-Calculate Editorial Team. (2026). Riemann Sum Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/riemann-sum-calculator
TG we-Calculate Editorial Team. "Riemann Sum Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/riemann-sum-calculator.
TG we-Calculate Editorial Team, "Riemann Sum Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/riemann-sum-calculator
@misc{wecalculate_riemann_sum_calculator, title = {Riemann Sum Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/riemann-sum-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
