Riemann Sums
The definite integral is a limit of sums. Pick a function, choose an approximation method, and slide the number of rectangles upward. Watch the approximation converge to the true area and the error shrink toward zero.
How it works
A Riemann sum approximates the area under a curve by dividing the interval [a, b] into n subintervals and summing the areas of rectangles (or trapezoids) whose heights sample the function at specific points.
The left method evaluates f at each subinterval's left endpoint. The right method uses the right endpoint. The midpoint method samples the center of each subinterval, and the trapezoidal method averages the left and right values, forming trapezoids instead of rectangles.
As n increases, all four methods converge to the definite integral. Color-coding shows whether each rectangle overestimates or underestimates the true area in that subinterval. The midpoint and trapezoidal rules converge faster (O(1/n²)) than left and right (O(1/n)).