Riemann Sum Explorer
area approximation over partitions with method comparison
why doctors and ecologists both use integrals 🖖
Riemann sums are how continuous biology becomes computable. In pharmacology, area-under-the-curve (AUC) estimates total drug exposure from discrete blood samples. In ecology, integrating growth-rate curves estimates total biomass or oxygen production over time. Same math, different systems: partition time, sum local contributions, refine partitions to reduce error.
slicing area into shapes you can measure 🖖
Finding the exact area under a curve is hard, but adding up rectangles is easy. Each method here just guesses a strip's height differently: the left or right edge, the middle, or a slanted top (trapezoid). The takeaway: none is exact, but the more strips you use, the closer every method creeps to the true integral. Watch how the error shrinks as you refine the partition.
Simpson's rule is a hidden blend 🖖
Here's a surprise: the midpoint rule usually beats the trapezoid rule, and their errors point in opposite directions — midpoint over-shoots where the curve is concave down, trapezoid under-shoots. Blend them as (2M + T)/3 and the leading error term cancels, giving Simpson's rule. So the most famous integration formula is just a weighted average of two sums already on this screen.
Example problems
- coarse left - Coarse left sum creates visible approximation bias.
- refine n - Increasing n improves area approximation quality.
- trapezoid smooth - Trapezoid rule fits smooth sin curve better than coarse rectangles.
- concavity bias - Concavity controls systematic over/under estimation bias.
- reverse interval - reverse interval
- right bias - right bias