Adaptive Quadrature
Objective: to approximate
to within .
The trick here is the usual one, of balancing errors, and trying for a better approximation by applying several methods and then taking an appropriate combination of them.
For example, we might try a Simpson's rule on a single panel over [a,b] using a step-size of h = b-a, and then try Simpson's composite with h/2:
where , and the error of the elemental Simpson's rule is
We now consider the error of the h/2 method, but used as a composite rule so that it will span [a,b]:
where and
Now, provided doesn't vary wildly, we can hope that , so that the error of the h/2 composite method will be about a sixteenth of the error of the elemental rule:
Since the methods are both approximations to the same quantity, we can try to combine them to make a better approximation:
On the other hand, we can also to check to see if the difference is significant enough to justify using the smaller step size; if not, we can stick with the larger step size - maybe even make it larger! That is, we can adapt to realities ``on the ground'' (or on the interval, at any rate!).
So
If we cavalierly assume that the approximation is exact, then substituting for I we find that
or
Hence
We can easily measure the quantity on the RHS: if
then we conclude that
If this condition is satisfied, then is sufficiently close: otherwise, we divide and conquer: split the error in half ( ), and give one half to each of the two panels of the h/2 method; iterate until satisfied.