Example 2. Use
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 2.
Compare our answers with Mathematica's.
Unfortunately, this integrand does not have a known
anti-derivative. So we must resort to Mathematica's
built in NIntegrate procedure.
|
tol |
0.001` |
produces |
|
|
tol |
0.00001` |
produces |
|
|
tol |
1.`*^-7 |
produces |
|
|
true |
value |
is |
|
Look at the following graph with aspect ratio 1.
You can change the aspect ratio to be 20 but do NOT print it out!
In fact, you might not even want to look at this graph with aspect
ration 20, so don't be shocked if you do.
![[Graphics:../Images/AdaptQuadMod_gr_46.gif]](../Images/AdaptQuadMod_gr_46.gif)
![[Graphics:../Images/AdaptQuadMod_gr_47.gif]](../Images/AdaptQuadMod_gr_47.gif)
Remark. It is usually difficult to find the numerical value of such an integral, because the function is so "flat" in the interval [0, 0.8] and so steep on [1.2, 1.7].
(c) John H. Mathews 2003