Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

6.4: Adaptive Integration

( \newcommand{\kernel}{\mathrm{null}\,}\)

The useful MATLAB function quad.m performs numerical integration using adaptive Simpson quadrature. The idea is to let the computation itself decide on the grid size required to achieve a certain level of accuracy. Moreover, the grid size need not be the same over the entire region of integration.

We begin the adaptive integration at what is called Level 1. The uniformly spaced points at which the function f(x) is to be evaluated are shown in Fig. 6.1. The distance between the points a and b is taken to be 2h, so that

h=ba2

Integration using Simpson’s rule (6.5) with grid size h yields

I=h3(f(a)+4f(c)+f(b))h590f(ξ)

where ξ is some value satisfying aξb.

Integration using Simpson’s rule twice with grid size h/2 yields

I=h6(f(a)+4f(d)+2f(c)+4f(e)+f(b))(h/2)590f(ξl)(h/2)590f(ξr)

with ξl and ξr some values satisfying aξlc and cξrb.

We now define

S1=h3(f(a)+4f(c)+f(b))S2=h6(f(a)+4f(d)+2f(c)+4f(e)+f(b)),E1=h590f(ξ),E2=h52590(f(ξl)+f(ξr)).

Now we ask whether S2 is accurate enough, or must we further refine the calculation and go to Level 2? To answer this question, we make the simplifying approximation that all of the fourth-order derivatives of f(x) in the error terms are equal; that is,

f(ξ)=f(ξl)=f(ξr)=C.

Then

E1=h590CE2=h52490C=116E1

Then since

S1+E1=S2+E2

and

E1=16E2

we have for our estimate for the error term E2,

E2=115(S2S1)

Therefore, given some specific value of the tolerance tol, if

|115(S2S1)|< tol 

then we can accept S2 as I. If the tolerance is not achieved for I, then we proceed to Level 2.

The computation at Level 2 further divides the integration interval from a to b into the two integration intervals a to c and c to b, and proceeds with the above procedure independently on both halves. Integration can be stopped on either half provided the tolerance is less than tol/2 (since the sum of both errors must be less than tol). Otherwise, either half can proceed to Level 3, and so on.

As a side note, the two values of I given above (for integration with step size h and h/2 ) can be combined to give a more accurate value for I given by

I=16S2S115+O(h7)

where the error terms of O(h5) approximately cancel. This free lunch, so to speak, is called Richardson’s extrapolation.


This page titled 6.4: Adaptive Integration is shared under a CC BY 3.0 license and was authored, remixed, and/or curated by Jeffrey R. Chasnov via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?