Example 1. Use the
adaptive Simpson's rule to compute a numerical approximation to the
integral
.
Use the tolerances
. Compare
with the analytic or "true value" of the integral.
Solution 1.
1 (a). Plot the function over the interval [0, 1.25].
![[Graphics:../Images/AdaptiveQuadMod_gr_7.gif]](../Images/AdaptiveQuadMod_gr_7.gif)
![[Graphics:../Images/AdaptiveQuadMod_gr_8.gif]](../Images/AdaptiveQuadMod_gr_8.gif)
|
tol |
0.001` |
produces |
|
|
tol |
0.00001` |
produces |
|
|
tol |
1.`*^-7 |
produces |
|
|
true |
value |
is |
|
![[Graphics:../Images/AdaptiveQuadMod_gr_32.gif]](../Images/AdaptiveQuadMod_gr_32.gif)
![[Graphics:../Images/AdaptiveQuadMod_gr_33.gif]](../Images/AdaptiveQuadMod_gr_33.gif)
(c) John H. Mathews 2004