Riemann Sum Calculator
Compute left, right and midpoint Riemann sums for a function over an interval.
About Riemann Sum Calculator
Riemann sums approximate ∫f(x)dx by dividing [a,b] into n equal rectangles. The left sum uses left endpoints, right sum uses right endpoints, and midpoint sum uses the center of each subinterval. The midpoint rule is generally more accurate (O(h²)) than left or right sums (O(h)).
Formulas
Left Riemann sum
L = Σ f(xᵢ)·Δx for i = 0 to n-1
- Δx
- (b-a)/n
- xᵢ
- a + i·Δx
Midpoint rule
M = Σ f((xᵢ + xᵢ₊₁)/2)·Δx
- Δx
- (b-a)/n
Worked example
With the default values below, Riemann Sum Calculator returns Midpoint sum of 2.66000000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- f(x)
- x^2
- Lower bound (a)
- 0
- Upper bound (b)
- 2
- Rectangles (n)accepts 1–100,000
- 10
Results
- Midpoint sum
- 2.66000000
- Left sum
- 2.28000000
- Right sum
- 3.08000000
- Width Δx
- 0.20000000
Step by step
- 1Values used
- 2Left Riemann sum
- 3Midpoint rule
- 4Midpoint sum= 2.66000000
- 5Left sum= 2.28000000
- 6Right sum= 3.08000000
- 7Width Δx= 0.20000000
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Which Riemann sum is most accurate?
The midpoint sum is generally the most accurate, with error O(h²). Left and right sums have O(h) error but bound the integral from above/below for monotone functions.
How do Riemann sums relate to the integral?
The definite integral is defined as the limit of Riemann sums as n → ∞. Larger n gives better approximations.
