Riemann Sum (Numerical Integration)

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

Inputs

Result

Riemann sum
21.332800
Exact: 21.333333 · error: 5.333e-4.
  • f(x)0x³ + 1x² + 0x + 0
  • [a, b][0, 4]
  • N100
  • Δx0.040000
  • Methodmid
  • Riemann sum21.33280000
  • Exact21.33333333
  • Error5.3333e-4

Step-by-step

  1. Δx = (b−a)/N = 0.0400.
  2. Sum f(xᵢ) × Δx for i=0..N−1.
  3. Result: 21.332800.

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

Midpoint usually wins on smooth functions. Simpson's rule even better but more complex.

Related calculators