Math
The integral, built by hand
Fill the region under a curve with panels and watch the count climb: the choice of where each panel takes its height decides everything, and the trapezoid that follows the curve is exactly twice as bad as the midpoint rectangle that does not. Then the sign, because the integral of a sine over one period is zero while the area between it and the axis is four. And the accumulated function, whose slope is the curve you started from - except where the curve jumps, and there it has a corner instead.

What happens
Cut the interval into strips, put a height on each, add - that is an integral before any rule for antiderivatives, and this panel builds it strip by strip. Left and right heights err in proportion to the strip width; midpoint and trapezoid err as its square, in opposite directions, so the truth is bracketed between them; two parts midpoint to one part trapezoid is Simpson's rule, exact on any cubic. Below, the running total draws the antiderivative, and its slope is the function - the fundamental theorem seen rather than proved. Change the rule and the strip count and read the error against the exact area.
Equations used in the module
Equations Riemann sum: n panels of width h, a height on each, add left/right: error ~ h; midpoint ~ h² with +h²(b−a)f''/24; trapezoid ~ h² with −h²(b−a)f''/12 Simpson = (2·midpoint + trapezoid)/3: error ~ h⁴, exact on cubics F(x) = ∫ f from a to x, F' = f


