Working out an area when you cannot do the integral by hand — which is the normal case, not the exception.

Reading order

  1. Riemann Sums — [Beginner] — how a continuous integral becomes a finite sum you can actually loop over: step width, sample points, and the left, right, midpoint and trapezoidal rules
  2. Quadrature Rules — [Intermediate] — Newton–Cotes and Simpson’s rules, Gaussian quadrature, adaptive methods and Monte Carlo

The methods, at a glance

RuleWhere it samplesError shrinks like
Left / right rectangleone end of each strip
Midpointthe centre of each strip
Trapezoidalaverage of both ends
Simpson’s 1/3a parabola through three points
Simpson’s 3/8a cubic through four points
Gauss–Legendrepoints chosen to be optimalexact for degree

Lesson 1 covers the first three rows and explains why the choice of sample point is the whole story. Lesson 2 covers the rest.

↑ Back to Numerical Methods