Integral Calculus
Adding up the rectangles…
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Integral Calculus
Adding up the rectangles…
Most integrals have no formula, so computers use rules. Trapezoids, midpoints and parabolas all converge — but at very different speeds.
Trapezoid: 1.570796
Midpoint: 2.221441
Simpson: 2.094395
Error against n (log scales): trapezoid, midpoint, Simpson
∫ sin x dx from 0 to π is exactly 2. A computer cannot take a limit, so it settles for a finite rule. Three classic ones, side by side: trapezoids, midpoint rectangles, and Simpson's parabolas.