Module

for

2D Integration using the Trapezoidal and Simpson Rules

     

Background

    The trapezoidal rule and Simpson's rule for ordinary integrals can be extended to multiple integrals.

 

Theorem  (Trapezoidal 2D Rule)  Consider [Graphics:Images/SimpsonsRule2DMod_gr_1.gif] over the rectangle [Graphics:Images/SimpsonsRule2DMod_gr_2.gif].  Given that the interval [Graphics:Images/SimpsonsRule2DMod_gr_3.gif] is subdivided into [Graphics:Images/SimpsonsRule2DMod_gr_4.gif] subintervals  [Graphics:Images/SimpsonsRule2DMod_gr_5.gif]  of equal width  [Graphics:Images/SimpsonsRule2DMod_gr_6.gif]  by using the equally spaced sample points  [Graphics:Images/SimpsonsRule2DMod_gr_7.gif]  for  [Graphics:Images/SimpsonsRule2DMod_gr_8.gif].   Also, assume that the interval [Graphics:Images/SimpsonsRule2DMod_gr_9.gif] is subdivided into [Graphics:Images/SimpsonsRule2DMod_gr_10.gif] subintervals  [Graphics:Images/SimpsonsRule2DMod_gr_11.gif]  of equal width  [Graphics:Images/SimpsonsRule2DMod_gr_12.gif]  by using the equally spaced sample points  [Graphics:Images/SimpsonsRule2DMod_gr_13.gif]  for  [Graphics:Images/SimpsonsRule2DMod_gr_14.gif].   
The
composite Trapezoidal rule  is  

        
[Graphics:Images/SimpsonsRule2DMod_gr_15.gif]
where

        
[Graphics:Images/SimpsonsRule2DMod_gr_16.gif]  

It can be shown that the error term is of the form  [Graphics:Images/SimpsonsRule2DMod_gr_17.gif], that is

        [Graphics:Images/SimpsonsRule2DMod_gr_18.gif].  

Remark.  The Trapezoidal rule had the pattern of weights  [Graphics:Images/SimpsonsRule2DMod_gr_19.gif]  and the Trapezoidal 2D rule extends this pattern to a grid in the rectangle R.  
    [Graphics:Images/SimpsonsRule2DMod_gr_20.gif]
Proof  2D Trapezoidal and Simpson Rules  2D Trapezoidal and Simpson Rules  

 

Theorem (Simpson's 2D Rule)   Consider [Graphics:Images/SimpsonsRule2DMod_gr_21.gif] over the rectangle [Graphics:Images/SimpsonsRule2DMod_gr_22.gif].  Given that the interval [Graphics:Images/SimpsonsRule2DMod_gr_23.gif] is subdivided into [Graphics:Images/SimpsonsRule2DMod_gr_24.gif] subintervals  [Graphics:Images/SimpsonsRule2DMod_gr_25.gif]  of equal width  [Graphics:Images/SimpsonsRule2DMod_gr_26.gif]  by using the equally spaced sample points  [Graphics:Images/SimpsonsRule2DMod_gr_27.gif]  for  [Graphics:Images/SimpsonsRule2DMod_gr_28.gif].   Also, assume that the interval [Graphics:Images/SimpsonsRule2DMod_gr_29.gif] is subdivided into [Graphics:Images/SimpsonsRule2DMod_gr_30.gif] subintervals  [Graphics:Images/SimpsonsRule2DMod_gr_31.gif]  of equal width  [Graphics:Images/SimpsonsRule2DMod_gr_32.gif]  by using the equally spaced sample points  [Graphics:Images/SimpsonsRule2DMod_gr_33.gif]  for  [Graphics:Images/SimpsonsRule2DMod_gr_34.gif].   
The
composite Simpson's rule  is  

        
[Graphics:Images/SimpsonsRule2DMod_gr_35.gif]
where
        
[Graphics:Images/SimpsonsRule2DMod_gr_36.gif]  
    
It can be shown that the error term is of the form  [Graphics:Images/SimpsonsRule2DMod_gr_37.gif], that is

        [Graphics:Images/SimpsonsRule2DMod_gr_38.gif].  

Remark.  Simpson's rule had the pattern of weights  [Graphics:Images/SimpsonsRule2DMod_gr_39.gif]  and Simpson's 2D rule extends this pattern to a grid in the rectangle R.  
    [Graphics:Images/SimpsonsRule2DMod_gr_40.gif]
Proof  2D Trapezoidal and Simpson Rules  2D Trapezoidal and Simpson Rules  

 

Computer Programs  2D Trapezoidal and Simpson Rules  2D Trapezoidal and Simpson Rules  

Mathematica Subroutine (Trapezoidal 2D Rule). Object oriented programming.

[Graphics:Images/SimpsonsRule2DMod_gr_41.gif]

Mathematica Subroutine (Simpson 2D Rule). Object oriented programming.

[Graphics:Images/SimpsonsRule2DMod_gr_42.gif]

Example 1.  Use the composite Simpson's rule for multiple integrals to numerically approximate the iterated integral  [Graphics:Images/SimpsonsRule2DMod_gr_43.gif].  
Remark. This is the volume of the solid bounded by the surface  [Graphics:Images/SimpsonsRule2DMod_gr_44.gif],  that lies above the square  [Graphics:Images/SimpsonsRule2DMod_gr_45.gif]  in the xy-plane.
Solution 1.

 

Example 2.  Find the analytic solution to the iterated integral  [Graphics:Images/SimpsonsRule2DMod_gr_67.gif].  
Solution 2.

 

Example 3.  How good are the Trapezoidal rule approximations to  [Graphics:Images/SimpsonsRule2DMod_gr_87.gif]  that were calculated in Example 1?
Solution 3.

 

Example 4.  Use the composite Simpson's rule for multiple integrals to numerically approximate the iterated integral  [Graphics:Images/SimpsonsRule2DMod_gr_108.gif].  
Remark. This is the volume of the solid bounded by the surface  [Graphics:Images/SimpsonsRule2DMod_gr_109.gif],  that lies above the square  [Graphics:Images/SimpsonsRule2DMod_gr_110.gif]  in the xy-plane.
Solution 4.

 

Example 5.  How good are the Simpson's rule approximations to  [Graphics:Images/SimpsonsRule2DMod_gr_132.gif]  that were calculated in Example 4?
Solution 5.

 

Example 6.  Compare the 2D Trapezoidal and 2D Simpson rule approximations to   [Graphics:Images/SimpsonsRule2DMod_gr_153.gif]  that were calculated in Examples 1 and 4?
Solution 6.

 

More Background

    Suppose we wish to numerically approximate the integral  [Graphics:Images/SimpsonsRule2DMod_gr_188.gif],  where  the limits of integration on the inside integral are functions of x.  This can be accomplished as follows.

First, apply Simpson's rule using  m  subintervals of  [Graphics:Images/SimpsonsRule2DMod_gr_189.gif]  to  f[x,y]  and define the result as the function  F[x].

Second, apply Simpson's rule using  n  subintervals of  [Graphics:Images/SimpsonsRule2DMod_gr_190.gif]  to  F[x].

Remark. To make  F[x]  "look like a function of  x"  we shall fix the number of vertical subdivisions "m"  in a global variable.  Use the following two Mathematica subroutines.

[Graphics:Images/SimpsonsRule2DMod_gr_191.gif]

[Graphics:Images/SimpsonsRule2DMod_gr_192.gif]

Example 7.  Use the composite Simpson's rule for multiple integrals to numerically approximate the iterated integral  [Graphics:Images/SimpsonsRule2DMod_gr_193.gif].
Solution 7.

 

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

 

Research Experience for Undergraduates

Trapezoidal Rule for Numerical Integration  Trapezoidal Rule for Numerical Integration  Internet hyperlinks to web sites and a bibliography of articles.  

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

 

Download this Mathematica Notebook  2D Integration using the Trapezoidal and Simpson Rules

 

Return to Numerical Methods - Numerical Analysis

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004