Riemann Sum Calculator
Approximate a definite integral using left, right, midpoint, and trapezoidal Riemann sums for f(x) = ax² + bx + c on [a, b] with n subdivisions.
A Riemann sum approximates a definite integral by dividing the area under a curve into rectangles (or trapezoids) and summing their areas. The more subdivisions n you use, the closer the approximation gets to the true integral.
For a function f on the interval [a, b] divided into n equal subintervals of width dx = (b-a)/n:
Left sum: sum of f(x_i) * dx, where x_i is the left edge of each rectangle. Right sum: sum of f(x_{i+1}) * dx, where x_i is the right edge. Midpoint sum: sum of f((x_i + x_{i+1})/2) * dx – generally the most accurate of the three. Trapezoidal rule: sum of (f(x_i) + f(x_{i+1}))/2 * dx – uses trapezoids instead of rectangles, exact for linear functions.
For a quadratic f(x) = ax^2 + bx + c, the exact integral over [a, b] is: [ax^3/3 + bx^2/2 + c*x] from lower to upper limit.
The error in the left and right sums is proportional to 1/n. The midpoint and trapezoidal rules have errors proportional to 1/n^2 – halving the step size reduces error four-fold. For the parabola case, Simpson’s rule (which combines midpoint and trapezoidal) is exact.
The chart shows the function curve over the interval with the left-sum rectangles overlaid, giving a visual sense of the approximation error.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.