Example
7. Let
over
. Use
the adaptive Simpson's rule to approximate the value of the
integral.
Solution 7.
Call the adaptive subroutine with the command Adapt[0,2,0.001].
Tracing the steps of adaptive quadrature will reveal that the following sequence of nodes is used.
{{0.,1.,2.},
{0.,0.5,1.,1.5,2.},
{0.,0.25,0.5,0.75,1.,1.5,2.},
{0.,0.25,0.5,0.75,1.,1.25,1.5,1.75,2.},
{0.,0.25,0.5,0.625,0.75,0.875,1.,1.25,1.5,1.75,2.},
{0.,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1.,1.25,1.5,1.75,2.},
{0.,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.0625,0.125,0.1875,0.25,0.375,0.5,0.625,0.75,0.875,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.0625,0.125,0.1875,0.25,0.3125,0.375,0.4375,0.5,0.625,0.75,0.875,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.0625,0.125,0.1875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.875,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.0625,0.125,0.1875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.03125,0.0625,0.09375,0.125,0.1875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.03125,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.015625,0.03125,0.046875,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.0078125,0.015625,0.0234375,0.03125,0.046875,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.00390625,0.0078125,0.0117188,0.015625,0.0234375,0.03125,0.046875,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.00195313,0.00390625,0.00585938,0.0078125,0.0117188,0.015625,0.0234375,0.03125,0.046875,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.000976563,0.00195313,0.00292969,0.00390625,0.00585938,0.0078125,0.0117188,0.015625,0.0234375,0.03125,0.046875,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.000488281,0.000976563,0.00146484,0.00195313,0.00292969,0.00390625,0.00585938,0.0078125,0.0117188,0.015625,0.0234375,0.03125,0.046875,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.},
{0.,0.000244141,0.000488281,0.000732422,0.000976563,0.00146484,0.00195313,0.00292969,0.00390625,0.00585938,0.0078125,0.0117188,0.015625,0.0234375,0.03125,0.046875,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.3125,0.375,0.4375,0.5,0.5625,0.625,0.6875,0.75,0.8125,0.875,0.9375,1.,1.125,1.25,1.375,1.5,1.75,2.}}
The corresponding computed numerical approximations for the integral are summarized in the following table.
![[Graphics:../Images/AdaptiveQuadMod_gr_184.gif]](../Images/AdaptiveQuadMod_gr_184.gif)
|
m sample points |
Adapt[0,2,0.001] |
|
3 |
|
|
5 |
|
|
7 |
|
|
9 |
|
|
11 |
|
|
13 |
|
|
15 |
|
|
17 |
|
|
19 |
|
|
21 |
|
|
23 |
|
|
25 |
|
|
27 |
|
|
29 |
|
|
31 |
|
|
33 |
|
|
35 |
|
|
37 |
|
|
39 |
|
|
41 |
|
![[Graphics:../Images/AdaptiveQuadMod_gr_205.gif]](../Images/AdaptiveQuadMod_gr_205.gif)
![[Graphics:../Images/AdaptiveQuadMod_gr_206.gif]](../Images/AdaptiveQuadMod_gr_206.gif)
Animation 1. ( Adaptive Simpson's Rule Adaptive Simpson's Rule ). Internet hyperlink.
(c) John H. Mathews 2004