You have used the trapezoid and Simpson's rules with their error bounds in Trapezoid and Simpson's Rules. Here we read those bounds as statements about order: how fast does the error shrink as the panels get thinner, and for which functions is a rule exact?
Key idea
Why it works
Worked example: Measuring the orders
- Trapezoid: $8.94 \times 10^{-3}$, $2.24 \times 10^{-3}$, $5.59 \times 10^{-4}$: each doubling divides by $4.0$.
- Simpson: $3.70 \times 10^{-5}$, $2.33 \times 10^{-6}$, $1.46 \times 10^{-7}$: each doubling divides by $16$.
- $\log_2 4 = 2$ and $\log_2 16 = 4$: the orders, read straight from the data.
Answer: orders $2$ and $4$
Worked example: Simpson is exact for cubics
- $h = 1$: $S = \frac{1}{3}[f(0) + 4f(1) + f(2)] = \frac{1}{3}[0 + 4 + 8] = 4$.
- Exact: $\frac{2^{4}}{4} = 4$. No error at all, with a parabola fitted to a cubic.
Answer: $4$
Worked example: Error for a quadratic, exactly
- $T_2 = \frac{1}{2}\left[\frac{0 + 1}{2} + 0.25\right] = 0.375$; the integral is $\frac{1}{3}$.
- Error $0.375 - \frac{1}{3} = \frac{1}{24}$, exactly $\frac{(b - a)h^{2}}{12}f'' = \frac{1 \cdot 0.25}{12} \cdot 2$, because $f''$ is constant.
Answer: $\frac{1}{24}$
For the same number of function values, Simpson's rule is almost always the better choice for smooth integrands. The trapezoid rule has one surprising strength: for smooth periodic functions integrated over a full period, its error falls faster than any power of $h$.
Common mistake