Example 3.  Consider the integration of the function  [Graphics:Images/NewtonCotesMod_gr_139.gif]  over  [Graphics:Images/NewtonCotesMod_gr_140.gif].  Use exactly five function evaluations and compare the results from the composite trapezoidal rule, composite Simpson rule, and Boole’s rule.  Use the uniform step size  [Graphics:Images/NewtonCotesMod_gr_141.gif].   

[Graphics:Images/NewtonCotesMod_gr_142.gif][Graphics:Images/NewtonCotesMod_gr_143.gif]
        Composite Trapezoidal Rule                                            Composite Simpson’s Rule

[Graphics:Images/NewtonCotesMod_gr_144.gif]
        Boole’s Rule

Solution 3.

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


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

Using the Composite Trapezoidal Rule:

    
[Graphics:../Images/NewtonCotesMod_gr_147.gif][Graphics:../Images/NewtonCotesMod_gr_148.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_149.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_150.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_151.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_152.gif]  
    
    Mathematica's Computation is:

[Graphics:../Images/NewtonCotesMod_gr_153.gif]
[Graphics:../Images/NewtonCotesMod_gr_154.gif]


Using the Composite Simpson’s Rule:

    
[Graphics:../Images/NewtonCotesMod_gr_155.gif][Graphics:../Images/NewtonCotesMod_gr_156.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_157.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_158.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_159.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_160.gif]  
    
    Mathematica's Computation is:

[Graphics:../Images/NewtonCotesMod_gr_161.gif]
[Graphics:../Images/NewtonCotesMod_gr_162.gif]


Using Boole’s Rule:

    
[Graphics:../Images/NewtonCotesMod_gr_163.gif][Graphics:../Images/NewtonCotesMod_gr_164.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_165.gif]   
            [Graphics:../Images/NewtonCotesMod_gr_166.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_167.gif]  
            [Graphics:../Images/NewtonCotesMod_gr_168.gif]  
    
    Mathematica's Computation is:

[Graphics:../Images/NewtonCotesMod_gr_169.gif]
[Graphics:../Images/NewtonCotesMod_gr_170.gif]


The true value of the definite integral is

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



[Graphics:../Images/NewtonCotesMod_gr_172.gif]
[Graphics:../Images/NewtonCotesMod_gr_173.gif]

[Graphics:../Images/NewtonCotesMod_gr_174.gif]
[Graphics:../Images/NewtonCotesMod_gr_175.gif]

[Graphics:../Images/NewtonCotesMod_gr_176.gif]
[Graphics:../Images/NewtonCotesMod_gr_177.gif]
[Graphics:../Images/NewtonCotesMod_gr_178.gif]
[Graphics:../Images/NewtonCotesMod_gr_179.gif]

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


We see that the approximation  1.30938  from Simpson’s rule is much better than the value  1.28358  obtained from the trapezoidal rule.  Again, the approximation  1.30859  from Boole’s rule is closest.  Graphs for the areas under the trapezoids and parabolas are shown in the figures for this example.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004