Category: Calculus Level: 301
∫04 (x2/4 + 1) dx ≈ ∑ f(xi) Δ x
Split the area under a curve into thin rectangles, add their areas, and let the rectangles get thinner. The sums close in on the exact area, which is the definite integral.
Find the area under y = x²/4 + 1 between x = 0 and x = 4. No formula from geometry fits this curved shape.
area = ?
Cut [0, 4] into 4 strips of width Δx = 1. Make each strip a rectangle whose height is the curve at the strip midpoint.
area ≈ 1·(f(0.5) + f(1.5) + f(2.5) + f(3.5)) = 9.250
With 8 strips of width 0.5 the rectangles hug the curve more closely. The gaps and overlaps shrink.
With 32 strips the sum is almost exactly the area. In the limit as Δx → 0 the sum becomes the definite integral.
∫04 (x2/4 + 1) dx = 28/3 ≈ 9.3333
cd svg-generator python3 -m svgmath render riemann-sum --out /tmp/riemann-sum
Source: svgmath/diagrams/riemann_sum.py