Example 3.  Use the adaptive Simpson's rule to compute a numerical approximation to the integral  [Graphics:Images/AdaptiveQuadMod_gr_64.gif].  
Use the tolerances [Graphics:Images/AdaptiveQuadMod_gr_65.gif].  Compare with the analytic or "true value" of the integral.

Solution 3.

[Graphics:../Images/AdaptiveQuadMod_gr_66.gif]
[Graphics:../Images/AdaptiveQuadMod_gr_67.gif]
[Graphics:../Images/AdaptiveQuadMod_gr_68.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_69.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_70.gif]


[Graphics:../Images/AdaptiveQuadMod_gr_71.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_72.gif]


[Graphics:../Images/AdaptiveQuadMod_gr_73.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_74.gif]


[Graphics:../Images/AdaptiveQuadMod_gr_75.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_76.gif]

Compare our answers with Mathematica's.

[Graphics:../Images/AdaptiveQuadMod_gr_77.gif]
[Graphics:../Images/AdaptiveQuadMod_gr_78.gif]

Unfortunately, this integrand does not have a known anti-derivative.  So we must resort to Mathematica's built in NIntegrate procedure.  

[Graphics:../Images/AdaptiveQuadMod_gr_79.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_80.gif]



[Graphics:../Images/AdaptiveQuadMod_gr_81.gif]

tol

0.001`

produces

[Graphics:../Images/AdaptiveQuadMod_gr_82.gif]

tol

0.00001`

produces

[Graphics:../Images/AdaptiveQuadMod_gr_83.gif]

tol

1.`*^-7

produces

[Graphics:../Images/AdaptiveQuadMod_gr_84.gif]

true

value

is

[Graphics:../Images/AdaptiveQuadMod_gr_85.gif]

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/AdaptiveQuadMod_gr_86.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_87.gif]

[Graphics:../Images/AdaptiveQuadMod_gr_88.gif]
[Graphics:../Images/AdaptiveQuadMod_gr_89.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 2004