Calculus

Riemann Sums

Approximate the area under a curve with n rectangles (or trapezoids) and watch the estimate converge to the true integral.

Approximation
Exact integral
Error
leftrightmidtrap

What to observe

  1. Drag the slider up. Every method converges, but watch the Errorreadout: doubling the rectangles roughly halves the error for Left, yet quarters it for Midpoint and Trapezoid.
  2. That is exactly the log–log plot: Left and Right fall with slope−1 (error ∝ 1/n), Midpoint and Trapezoid with slope −2(error ∝ 1/n²). Order of accuracy, made visible.
  3. Switch to x³ − x. Rectangles below the axis count as negative area, and over the symmetric interval the positive and negative parts cancel to a signed integral of 0.

Shortcuts: space run/pause · s step · r reset · f fullscreen