Example 4. Use the
adaptive Simpson's rule to compute a numerical approximation to the
integral
that
we investigated in example 2.
The long solution is obtained if you add a print statement to
investigate the in between computations.
This subroutine is pedagogical and is intended to help us understand
what's happening in a recursive program.
You would probably not want to always print out the in between steps,
so you might want to re-execute the first version for some of your
work.
Solution 4.
Now investigate the "recursive path" the subroutine takes.
Now plot the intervals
where
Simpson Rule was applied in the form
![[Graphics:../Images/AdaptiveQuadMod_gr_128.gif]](../Images/AdaptiveQuadMod_gr_128.gif)
(c) John H. Mathews 2004