= Composite midpoint rule error
For $f\in C^2[a,b]$, divide $[a,b]$ into cells of widths $h_i$ and midpoints $m_i$. The composite midpoint <quadrature rule> is $Q(f)=\sum_i h_i f(m_i)$. <Taylor's theorem> around each midpoint gives
$$
\left|\int_{x_{i-1}}^{x_i}f(x)\,dx-h_i f(m_i)\right|\leq\frac{h_i^3}{24}\|f''\|_\infty.
$$
The odd linear term integrates to zero; integrating $\tfrac12\|f''\|_\infty(x-m_i)^2$ gives $h_i^3/24$. Consequently, with $h=\max_i h_i$,
$$
|\textstyle\int_a^b f-Q(f)|\leq\frac{\|f''\|_\infty}{24}\sum_i h_i^3\leq\frac{b-a}{24}h^2\|f''\|_\infty.
$$
Thus each cell has a cubic <quadrature error>, while the composite error is second order in the largest cell width. For $f(x)=x^2$ the constant is attained, since the second-order <Taylor expansion> is exact. Endpoint singularities that make $f''$ unbounded require a separate estimate or a smoothing <change of variables>.
Back to article page