6.3: Local Versus Global Error
Consider the elementary formula (6.4) for the trapezoidal rule, written in the form
\[\int_{0}^{h} f(x) d x=\frac{h}{2}(f(0)+f(h))-\frac{h^{3}}{12} f^{\prime \prime}(\xi) \nonumber \]
where \(\xi\) is some value satisfying \(0 \leq \xi \leq h\) , and we have used Taylor’s theorem with the mean-value form of the remainder. We can also represent the remainder as
\[-\frac{h^{3}}{12} f^{\prime \prime}(\xi)=\mathrm{O}\left(h^{3}\right) \nonumber \]
where \(\mathrm{O}\left(h^{3}\right)\) signifies that when \(h\) is small, halving of the grid spacing \(h\) decreases the error in the elementary trapezoidal rule by a factor of eight. We call the terms represented by \(\mathrm{O}\left(h^{3}\right)\) the Local Error.
More important is the Global Error which is obtained from the composite formula (6.7) for the trapezoidal rule. Putting in the remainder terms, we have
\[\int_{a}^{b} f(x) d x=\frac{h}{2}\left(f_{0}+2 f_{1}+\cdots+2 f_{n-1}+f_{n}\right)-\frac{h^{3}}{12} \sum_{i=0}^{n-1} f^{\prime \prime}\left(\xi_{i}\right) \nonumber \]
where \(\xi_{i}\) are values satisfying \(x_{i} \leq \xi_{i} \leq x_{i+1}\) . The remainder can be rewritten as
\[-\frac{h^{3}}{12} \sum_{i=0}^{n-1} f^{\prime \prime}\left(\xi_{i}\right)=-\frac{n h^{3}}{12}\left\langle f^{\prime \prime}\left(\xi_{i}\right)\right\rangle \nonumber \]
where \(\left\langle f^{\prime \prime}\left(\xi_{i}\right)\right\rangle\) is the average value of all the \(f^{\prime \prime}\left(\xi_{i}\right)^{\prime}\) s. Now,
\[n=\frac{b-a}{h} \nonumber \]
so that the error term becomes
\[\begin{aligned} -\frac{n h^{3}}{12}\left\langle f^{\prime \prime}\left(\xi_{i}\right)\right\rangle &=-\frac{(b-a) h^{2}}{12}\left\langle f^{\prime \prime}\left(\xi_{i}\right)\right\rangle \\ &=\mathrm{O}\left(h^{2}\right) \end{aligned} \nonumber \]
Therefore, the global error is \(\mathrm{O}\left(h^{2}\right)\) . That is, a halving of the grid spacing only decreases the global error by a factor of four.
Similarly, Simpson’s rule has a local error of \(\mathrm{O}\left(h^{5}\right)\) and a global error of \(\mathrm{O}\left(h^{4}\right)\) .
Figure 6.1: Adaptive Simpson quadrature: Level \(1 .\)