Quadrature error (source code)

= Quadrature error

A quadrature error is the difference between an <integral> and its finite weighted approximation. Its bound depends on both the sampled <function> and how the weights are formed. Suppose $|f(x)-f(y)|\leq C|x-y|^\alpha$ on $[a,b]$, with $0<\alpha\leq1$. For a <partition of an interval> of <mesh of a partition> $\Delta$ and left endpoints $x_{i-1}$,
$$
\left|\int_a^b f(x)\,dx-\sum_i f(x_{i-1})(x_i-x_{i-1})\right|\leq C(b-a)\Delta^\alpha.
$$
Indeed, integrate the <Hölder continuity> bound on each cell and add. For an <integrable> weight $w$, the same proof gives $C\|w\|_1\Delta^\alpha$ if each discrete weight is the exact cell <integral> $\int_{x_{i-1}}^{x_i}w(x)\,dx$. Sampling $w$ too introduces another error.

A different endpoint estimate concerns a normalized window $w=\mathbf1_{[u,v]}/h$, where $h=v-u>0$. Approximate this <indicator function> by its left-endpoint value on each cell. Only cells meeting $u$ or $v$ can disagree on a set of positive length; their total length is at most $2\Delta$. Therefore its <L1 norm> error is at most $2\Delta/h$. This is the source of a $\Delta/h$ bound; it is not the <Hölder continuity> estimate for a smooth integrand.