Example 5.  Use Romberg integration to compute a numerical approximation to the integral [Graphics:Images/RombergMod_gr_224.gif].  
Use the tolerances [Graphics:Images/RombergMod_gr_225.gif].  Compare with the analytic or "true value" of the integral.

Solution 5.

5 (a). Plot the function over the interval  [0, 3].

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

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

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

5 (b). Construct the Romberg table using   tol = 0.001

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


[Graphics:../Images/RombergMod_gr_230.gif]
[Graphics:../Images/RombergMod_gr_231.gif]
[Graphics:../Images/RombergMod_gr_232.gif]
[Graphics:../Images/RombergMod_gr_233.gif]
[Graphics:../Images/RombergMod_gr_234.gif]
[Graphics:../Images/RombergMod_gr_235.gif]
[Graphics:../Images/RombergMod_gr_236.gif]
[Graphics:../Images/RombergMod_gr_237.gif]

5 (c). The last entry in the table is  [Graphics:../Images/RombergMod_gr_238.gif].  Let's find it.

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


[Graphics:../Images/RombergMod_gr_240.gif]
[Graphics:../Images/RombergMod_gr_241.gif]

5 (d). Look at 10 digits in  [Graphics:../Images/RombergMod_gr_242.gif].

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


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

5 (e). Are all 10 digits correct ?   Why ?  
NO.  The subroutine was called with the accuracy  [Graphics:../Images/RombergMod_gr_245.gif].  

 

5 (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.

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


[Graphics:../Images/RombergMod_gr_247.gif]
[Graphics:../Images/RombergMod_gr_248.gif]
[Graphics:../Images/RombergMod_gr_249.gif]
[Graphics:../Images/RombergMod_gr_250.gif]
[Graphics:../Images/RombergMod_gr_251.gif]
[Graphics:../Images/RombergMod_gr_252.gif]
[Graphics:../Images/RombergMod_gr_253.gif]
[Graphics:../Images/RombergMod_gr_254.gif]
[Graphics:../Images/RombergMod_gr_255.gif]
[Graphics:../Images/RombergMod_gr_256.gif]
[Graphics:../Images/RombergMod_gr_257.gif]

Since the last row was row 7, the sequential trapezoidal rule used the following number of function calls.

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


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

5 (g). Use Mathematica to find the analytic solution to the integral, i.e. the "true value" of the integral.

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


[Graphics:../Images/RombergMod_gr_261.gif]
[Graphics:../Images/RombergMod_gr_262.gif]
[Graphics:../Images/RombergMod_gr_263.gif]
[Graphics:../Images/RombergMod_gr_264.gif]
[Graphics:../Images/RombergMod_gr_265.gif]
[Graphics:../Images/RombergMod_gr_266.gif]
[Graphics:../Images/RombergMod_gr_267.gif]
[Graphics:../Images/RombergMod_gr_268.gif]

5 (h). How close did our last numerical approximation using Romberg integration come to the "true value" of the integral.

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


[Graphics:../Images/RombergMod_gr_270.gif]
[Graphics:../Images/RombergMod_gr_271.gif]


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

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

[Graphics:../Images/RombergMod_gr_274.gif]
[Graphics:../Images/RombergMod_gr_275.gif]
[Graphics:../Images/RombergMod_gr_276.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004