Example 4. Use
Romberg integration to compute a numerical approximation to the
integral
.
Use the tolerances
. Compare
with the analytic or "true value" of the integral.
Solution 4.
4 (a). Plot the function over the interval [0, 2].
![[Graphics:../Images/RombergMod_gr_179.gif]](../Images/RombergMod_gr_179.gif)
![[Graphics:../Images/RombergMod_gr_180.gif]](../Images/RombergMod_gr_180.gif)
4 (b). Construct the Romberg table using tol = 0.001
4 (c). The last entry in the
table is
. Let's
find it.
4 (d). Look at 10 digits
in
.
4 (e). Are all 10 digits
correct ? Why ?
NO. The subroutine was called with the
accuracy
.
4 (f). Determine how to call the Romberg integration subroutine so that it will achieve 10 digits of accuracy.
We suspect the following answer might have 10 digits of accuracy.
Since the last row was row 7, the sequential trapezoidal rule used the following number of function calls.
4 (g). Use Mathematica to find the analytic solution to the integral, i.e. the "true value" of the integral.
4 (h). How close did our last numerical approximation using Romberg integration come to the "true value" of the integral.
![[Graphics:../Images/RombergMod_gr_220.gif]](../Images/RombergMod_gr_220.gif)
(c) John H. Mathews 2004