Example 4.  Use Romberg integration to compute a numerical approximation to the integral  [Graphics:Images/RombergMod_gr_177.gif].  
Use the tolerances [Graphics:Images/RombergMod_gr_178.gif].  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]

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

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

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

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


[Graphics:../Images/RombergMod_gr_183.gif]
[Graphics:../Images/RombergMod_gr_184.gif]
[Graphics:../Images/RombergMod_gr_185.gif]
[Graphics:../Images/RombergMod_gr_186.gif]
[Graphics:../Images/RombergMod_gr_187.gif]
[Graphics:../Images/RombergMod_gr_188.gif]

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

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


[Graphics:../Images/RombergMod_gr_191.gif]
[Graphics:../Images/RombergMod_gr_192.gif]

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

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


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

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

 

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.

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


[Graphics:../Images/RombergMod_gr_198.gif]
[Graphics:../Images/RombergMod_gr_199.gif]
[Graphics:../Images/RombergMod_gr_200.gif]
[Graphics:../Images/RombergMod_gr_201.gif]
[Graphics:../Images/RombergMod_gr_202.gif]
[Graphics:../Images/RombergMod_gr_203.gif]
[Graphics:../Images/RombergMod_gr_204.gif]

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

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


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

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

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


[Graphics:../Images/RombergMod_gr_208.gif]
[Graphics:../Images/RombergMod_gr_209.gif]
[Graphics:../Images/RombergMod_gr_210.gif]
[Graphics:../Images/RombergMod_gr_211.gif]
[Graphics:../Images/RombergMod_gr_212.gif]
[Graphics:../Images/RombergMod_gr_213.gif]
[Graphics:../Images/RombergMod_gr_214.gif]
[Graphics:../Images/RombergMod_gr_215.gif]

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

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


[Graphics:../Images/RombergMod_gr_217.gif]
[Graphics:../Images/RombergMod_gr_218.gif]


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

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

[Graphics:../Images/RombergMod_gr_221.gif]
[Graphics:../Images/RombergMod_gr_222.gif]
[Graphics:../Images/RombergMod_gr_223.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004