Riemann Sum (Numerical Integration)

Approximate ∫ₐᵇ f(x) dx using N rectangles (left, right, midpoint).

Inputs

Result

Loading calculator…

How to use this calculator

  • Enter polynomial + bounds + N + method.

About this calculator

Riemann sums approximate definite integrals via rectangles. As N → ∞, sum → exact integral. Midpoint method has O(1/N²) error (best of three); left/right have O(1/N). Doubling N quarters midpoint error but only halves left/right error. For polynomials, exact integration is easier; Riemann is for non-elementary functions. Simpson's rule (combine pairs) is even better — O(1/N⁴). Source: Wolfram MathWorld - Riemann Sum.

Frequently asked

Best method?+
Midpoint usually wins on smooth functions. Simpson's rule even better but more complex.
Why N matters?+
Smaller rectangles = closer to true area. N=100 typically gives 4-6 decimal accuracy for polynomials.
When does it fail?+
Discontinuous functions, very oscillatory integrals. Specialized methods (adaptive quadrature) help.
Riemann vs. Simpson?+
Simpson uses parabolic interpolation, far more accurate for same N. Industry standard for numerical integration.
For real coding?+
Use library: scipy.integrate.quad, MATLAB integral(), R integrate. Don't hand-roll.

Related calculators

More tools you might like

Hand-picked tools that pair well with this one — same audience, same intent.