Module for Simpson's Rule for Numerical Integration

Check out the new Numerical Analysis Projects page.

 

    The numerical integration technique known as "Simpson's Rule" is credited to the mathematician Thomas Simpson (1710-1761) of  Leicestershire, England. His also worked in the areas of numerical interpolation and probability theory.

Theorem  (Simpson's Rule)  Consider [Graphics:Images/SimpsonRuleMod_gr_1.gif] over [Graphics:Images/SimpsonRuleMod_gr_2.gif], where [Graphics:Images/SimpsonRuleMod_gr_3.gif], and [Graphics:Images/SimpsonRuleMod_gr_4.gif].  Simpson's rule is   

    
[Graphics:Images/SimpsonRuleMod_gr_5.gif][Graphics:Images/SimpsonRuleMod_gr_6.gif].   

This is an numerical approximation to the integral of
[Graphics:Images/SimpsonRuleMod_gr_7.gif] over [Graphics:Images/SimpsonRuleMod_gr_8.gif] and we write  

    [Graphics:Images/SimpsonRuleMod_gr_9.gif].  

Proof.

 

Composite Simpson Rule

    Our next method of finding the area under a curve [Graphics:Images/SimpsonRuleMod_gr_64.gif] is by approximating that curve with a series of parabolic segments that lie above the intervals  [Graphics:Images/SimpsonRuleMod_gr_65.gif].  When several parabolas are used, we call it the composite Simpson rule.  

Theorem (Composite Simpson's Rule)  Consider [Graphics:Images/SimpsonRuleMod_gr_66.gif] over [Graphics:Images/SimpsonRuleMod_gr_67.gif].  Suppose that the interval [Graphics:Images/SimpsonRuleMod_gr_68.gif] is subdivided into [Graphics:Images/SimpsonRuleMod_gr_69.gif] subintervals  [Graphics:Images/SimpsonRuleMod_gr_70.gif]  of equal width  [Graphics:Images/SimpsonRuleMod_gr_71.gif]  by using the equally spaced sample points  [Graphics:Images/SimpsonRuleMod_gr_72.gif]  for  [Graphics:Images/SimpsonRuleMod_gr_73.gif].   The composite Simpson's rule for [Graphics:Images/SimpsonRuleMod_gr_74.gif] subintervals  is  

    
[Graphics:Images/SimpsonRuleMod_gr_75.gif][Graphics:Images/SimpsonRuleMod_gr_76.gif][Graphics:Images/SimpsonRuleMod_gr_77.gif].  

This is an numerical approximation to the integral of
[Graphics:Images/SimpsonRuleMod_gr_78.gif] over [Graphics:Images/SimpsonRuleMod_gr_79.gif] and we write  

    [Graphics:Images/SimpsonRuleMod_gr_80.gif].  

Proof.

 

Animations (Simpson Rule  Simpson Rule).  Internet hyperlinks to animations.

 

Algorithm Composite Simpson Rule.  To approximate the integral  

    [Graphics:Images/SimpsonRuleMod_gr_122.gif][Graphics:Images/SimpsonRuleMod_gr_123.gif][Graphics:Images/SimpsonRuleMod_gr_124.gif],  


by sampling  [Graphics:Images/SimpsonRuleMod_gr_125.gif]  at the  [Graphics:Images/SimpsonRuleMod_gr_126.gif]  equally spaced sample points  [Graphics:Images/SimpsonRuleMod_gr_127.gif] for  [Graphics:Images/SimpsonRuleMod_gr_128.gif],  where  [Graphics:Images/SimpsonRuleMod_gr_129.gif].  Notice that  [Graphics:Images/SimpsonRuleMod_gr_130.gif]  and  [Graphics:Images/SimpsonRuleMod_gr_131.gif].  

 

Mathematica Subroutine (Simpson Rule). Traditional programming.

[Graphics:Images/SimpsonRuleMod_gr_132.gif]

Mathematica Subroutine (Simpson Rule). Object oriented programming.

[Graphics:Images/SimpsonRuleMod_gr_133.gif]

Example 1.  Numerically approximate the integral [Graphics:Images/SimpsonRuleMod_gr_134.gif] by using Simpson's rule with  m = 1, 2, 4, 8, and 16.

Solution 1.

 

Example 2.  Numerically approximate the integral [Graphics:Images/SimpsonRuleMod_gr_148.gif] by using Simpson's rule with  m = 20, 40, 80,  and 160.

Solution 2.

 

Example 3.  Find the analytic value of the integral  [Graphics:Images/SimpsonRuleMod_gr_162.gif]  (i.e. find the "true value").   

Solution 3.

 

Example 4.  Use the "true value" in example 3 and find the error for the Simpson rule approximations in example 2.  

Solution 4.

 

Remainder term for the Composite Simpson Rule

Corollary  (Simpson's Rule:  Remainder term)   Suppose that [Graphics:Images/SimpsonRuleMod_gr_177.gif] is subdivided into [Graphics:Images/SimpsonRuleMod_gr_178.gif] subintervals  [Graphics:Images/SimpsonRuleMod_gr_179.gif]  of width  [Graphics:Images/SimpsonRuleMod_gr_180.gif].  The composite Simpson's rule  

    
[Graphics:Images/SimpsonRuleMod_gr_181.gif][Graphics:Images/SimpsonRuleMod_gr_182.gif][Graphics:Images/SimpsonRuleMod_gr_183.gif].  

is an numerical approximation to the integral, and  

    
[Graphics:Images/SimpsonRuleMod_gr_184.gif].  

Furthermore, if [Graphics:Images/SimpsonRuleMod_gr_185.gif],  then there exists a value [Graphics:Images/SimpsonRuleMod_gr_186.gif] with  [Graphics:Images/SimpsonRuleMod_gr_187.gif]  so that the remainder term  [Graphics:Images/SimpsonRuleMod_gr_188.gif]  has the form

    [Graphics:Images/SimpsonRuleMod_gr_189.gif].  

This is expressed using the "big [Graphics:Images/SimpsonRuleMod_gr_190.gif]" notation  [Graphics:Images/SimpsonRuleMod_gr_191.gif].  

 

Old Lab Project (Simpson's Rule  Simpson's Rule).  Internet hyperlinks to an old lab project.  

 

Research Experience for Undergraduates

Simpson's Rule for Numerical Integration  Simpson's Rule for Numerical Integration  Internet hyperlinks to web sites and a bibliography of articles.  

  

Downloads (Simpson's Rule Simpson's Rule).  Download this Mathematica notebook.  

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003