NapkinCalc

Calculus 2A — Integrals

The Riemann sum — area by brute force

ELI5: to find the area under a curve, slice it into thin rectangles and add them up. More, thinner slices → a better answer. Area under f(x) = x² from 0 to 1, with 100 then 1000 rectangles, closes in on exactly 1/3.

R100:=Sum("(i/100)20.01","i",1,100)R_{100} := Sum("(i/100)^2 * 0.01", "i", 1, 100) = 0.33830.3383 100 rectangles: 0.33835 — a touch high
R1000:=Sum("(i/1000)20.001","i",1,1000)R_{1000} := Sum("(i/1000)^2 * 0.001", "i", 1, 1000) = 0.33380.3338 1000 rectangles: closing in
✓ pass abs(R100013)<0.001\mathrm{abs}\left(R_{1000} - \frac{1}{3}\right) < 0.001 converging on exactly 1/3
x^2
00.20.40.60.8100.20.40.60.81

the region being measured — area under x² from 0 to 1

Real-world hook: that "add up thin slices" move is how you get distance from a speedometer trace, total rainfall from an intensity graph, or the volume of an odd-shaped tank.