Unit content
Trapezoidal and Simpson quadrature rules
The trapezoidal rule replaces a function on $[a,b]$ by the straight line through its endpoint values:
$$\int_a^b f(x),dx\approx\frac{b-a}{2}\bigl(f(a)+f(b)\bigr).$$
Applied over many equal subintervals of width $h$, its leading global error decreases proportionally to $h^2$ for sufficiently smooth functions.
Simpson's rule replaces the function over two neighboring subintervals by a quadratic interpolant:
$$\int_a^b f(x),dx\approx\frac{b-a}{6}\left[f(a)+4f!\left(\frac{a+b}{2}\right)+f(b)\right].$$
For composite Simpson quadrature, the leading global error decreases proportionally to $h^4$ under suitable smoothness assumptions.
The higher formal order of Simpson's rule does not make it universally superior; cost, smoothness, sampling constraints and the desired accuracy determine which quadrature rule is appropriate.