Mathematical Methods · numerical integration · demo

The trapezoidal rule

Each panel is a trapezoid with top edge along the chord between consecutive sample points. More panels, tighter fit.

y = f(x) Trapezoids

Scroll zoom · drag pan · Shift+drag an axis to dilate it

Interval & panels

0
1
4

Drag a and b to change the integration interval; trapezoids recompute live.

Estimate vs reference

Trapezoidal, n
Reference value

Formula