6.3: Local Versus Global Error
( \newcommand{\kernel}{\mathrm{null}\,}\)
Consider the elementary formula (6.4) for the trapezoidal rule, written in the form
∫h0f(x)dx=h2(f(0)+f(h))−h312f′′(ξ)
where ξ is some value satisfying 0≤ξ≤h, and we have used Taylor’s theorem with the mean-value form of the remainder. We can also represent the remainder as
−h312f′′(ξ)=O(h3)
where O(h3) 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 O(h3) 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
∫baf(x)dx=h2(f0+2f1+⋯+2fn−1+fn)−h312n−1∑i=0f′′(ξi)
where ξi are values satisfying xi≤ξi≤xi+1. The remainder can be rewritten as
−h312n−1∑i=0f′′(ξi)=−nh312⟨f′′(ξi)⟩
where ⟨f′′(ξi)⟩ is the average value of all the f′′(ξi)′ s. Now,
n=b−ah
so that the error term becomes
−nh312⟨f′′(ξi)⟩=−(b−a)h212⟨f′′(ξi)⟩=O(h2)
Therefore, the global error is O(h2). 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 O(h5) and a global error of O(h4).
Figure 6.1: Adaptive Simpson quadrature: Level 1.