Lab for Numerical Multiple Integrals

Module for Simpson's Rule for 2D

   Check out the new Numerical Analysis Projects page.

Algorithm. Composite Simpson Rule for 2D.

To numerically approximate the integral [Graphics:s2.txtgr1.gif].

First, apply Simpson's rule using m subintervals of [Graphics:s2.txtgr2.gif] to f[x,y]
and define the function F[x]. Then, apply Simpson's rule using n subintervals of [Graphics:s2.txtgr3.gif] to F[x].
Remark. To make F[x] "look like a function of x" we fix the number of vertical subdivisions "m" as a global variable.
Use the following two Mathematica subroutines.

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr4.gif]
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr6.gif]

First load Mathematica's graphics package "FilledPlot".

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr7.gif]
 
 
 

Report to be handed in.

Computer Exercises
 

 

Exercise 1. Use the composite Simpson's rule for multiple integrals to
numerically approximate the iterated integral [Graphics:s2.txtgr8.gif].

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr9.gif]
Use n = 8 and m = 8 in your computations.
The integrand is:

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr10.gif]
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr11.gif]

The curves bounding the region are lines:

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr12.gif]
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr13.gif]

The region of integration can be seen in the following graphical plot.

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr14.gif]

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr15.gif]

Before we carry out the quadrature, we must fix "m" the number of vertical subdivisions to be used along each of the vertical segments [Graphics:s2.txtgr16.gif] between the curves y = c[x] and y = d[x].

The variable "m" is global and is used in the numerical quadrature subroutine to define the function
[Graphics:s2.txtgr17.gif].

Now, fix m and perform numerical multiple integration.

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr18.gif]
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr19.gif]

How good was numerical quadrature ?
Usually the special functions involved in the analytic solution of
[Graphics:s2.txtgr20.gif]
are not usually covered in the standard calculus sequence.
For your information,. the solution using Mathematica is found as follows:

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr21.gif]
 
 

Exercise 2. Use the composite Simpson's rule for multiple integrals to
numerically approximate the iterated integral [Graphics:s2.txtgr22.gif].
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr23.gif]

Use n = 20 and m = 5 in your computations.
The integrand is:

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr24.gif]
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr25.gif]

The curves bounding the region are:

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr26.gif]
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr27.gif]

The region of integration can be seen in the following graphical plot.

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr28.gif]

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr29.gif]

Before we carry out the quadrature, we must fix "m" the number of vertical subdivisions to be used along each of the vertical segments [Graphics:s2.txtgr30.gif] between the curves y = c[x] and y = d[x].

The variable "m" is global and is used in the numerical quadrature subroutine to define the function
[Graphics:s2.txtgr31.gif].

Now, fix m and perform numerical multiple integration.

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr32.gif]
[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr33.gif]

How good was numerical quadrature ?
Usually the special functions involved in the analytic solution of
[Graphics:s2.txtgr34.gif]
are not usually covered in the standard calculus sequence.
For your information,. the solution using Mathematica is found as follows:

[Graphics:s2.txtgr5.gif][Graphics:s2.txtgr35.gif]
 

 

 

(c) John H. Mathews, 1998