0% found this document useful (0 votes)
58 views32 pages

Main

This document discusses numerical methods for approximating double integrals of the form ∫∫R f(x,y) dA. It presents a quadrature formula that applies composite Simpson's rule to approximate both the inner and outer integrals. The formula yields an approximation of a double integral over a rectangular region in terms of the function values at the sample points. An error term for the composite Simpson's rule quadrature formula is also provided.

Uploaded by

Muhammad Farooq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views32 pages

Main

This document discusses numerical methods for approximating double integrals of the form ∫∫R f(x,y) dA. It presents a quadrature formula that applies composite Simpson's rule to approximate both the inner and outer integrals. The formula yields an approximation of a double integral over a rectangular region in terms of the function values at the sample points. An error term for the composite Simpson's rule quadrature formula is also provided.

Uploaded by

Muhammad Farooq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Double Integrals

MATH 375 Numerical Analysis

J. Robert Buchanan

Department of Mathematics

Spring 2019
Objectives
Now that we have discussed several methods for approximating
definite integrals of the form
Z b
f (x) dx
a

we turn our attention to double integrals of the form


ZZ
f (x, y ) dA.
R

In this lesson we will discuss quadrature methods which can be


applied to the case when
I R = {(x, y ) | a ≤ x ≤ b, c ≤ y ≤ d}, and
I R = {(x, y ) | a ≤ x ≤ b, c(x) ≤ y ≤ d(x)}.
Objectives
Now that we have discussed several methods for approximating
definite integrals of the form
Z b
f (x) dx
a

we turn our attention to double integrals of the form


ZZ
f (x, y ) dA.
R

In this lesson we will discuss quadrature methods which can be


applied to the case when
I R = {(x, y ) | a ≤ x ≤ b, c ≤ y ≤ d}, and
I R = {(x, y ) | a ≤ x ≤ b, c(x) ≤ y ≤ d(x)}.

Generalizations to polar coordinates and to triple integrals can


also be made.
Integrating Over a Rectangular Region (1 of 2)

Suppose R = {(x, y ) | a ≤ x ≤ b, c ≤ y ≤ d}, then


ZZ Z Z b d Z "Z b d
#
f (x, y ) dA = f (x, y ) dy dx = f (x, y ) dy dx.
R a c a c
Integrating Over a Rectangular Region (1 of 2)

Suppose R = {(x, y ) | a ≤ x ≤ b, c ≤ y ≤ d}, then


ZZ Z Z b d Z "Z b d
#
f (x, y ) dA = f (x, y ) dy dx = f (x, y ) dy dx.
R a c a c

Let m be an even integer and apply the Composite Simpson’s


rule to the “inner” integral.
Integrating Over a Rectangular Region (2 of 2)

Z d
f (x, y ) dy
c
 
m/2−1 m/2
k X X
= f (x, y0 ) + 2 f (x, y2j ) + 4 f (x, y2j−1 ) + f (x, ym )
3
j=1 j=1

(d − c) 4 ∂4f
− k (x, µ)
180 ∂y 4

where
d −c
k =
m
yj = c+jk for j = 0, 1, . . . , m
µ ∈ [c, d]
Outer Integration (1 of 2)

Now integrate with respect to x.


Z b Z d
f (x, y ) dy dx
a c
 
Z b m/2−1 m/2
k X X
= f (x, y0 ) + 2 f (x, y2j ) + 4 f (x, y2j−1 ) + f (x, ym ) d
a 3 j=1 j=1
Z b 4
(d − c) 4 ∂ f
− k (x, µ) dx
a 180 ∂y 4
Outer Integration (2 of 2)

Z b Z d
f (x, y ) dy dx
a c

m/2−1 Z b
k b
Z X
= f (x, y0 ) dx + 2 f (x, y2j ) dx
3 a aj=1

m/2 Z b Z b
X
+4 f (x, y2j−1 ) dx + f (x, ym ) dx 
j=1 a a

b
(d − c) 4 ∂4f
Z
− k (x, µ) dx
180 a ∂y 4
Outer Integration (2 of 2)

Z b Z d
f (x, y ) dy dx
a c

m/2−1 Z b
k b
Z X
= f (x, y0 ) dx + 2 f (x, y2j ) dx
3 a aj=1

m/2 Z b Z b
X
+4 f (x, y2j−1 ) dx + f (x, ym ) dx 
j=1 a a

b
(d − c) 4 ∂4f
Z
− k (x, µ) dx
180 a ∂y 4

Fix a value of j and apply the Composite Simpson’s rule to the


Z b
integral f (x, yj ) dx.
a
Integration with Fixed j
If n is an even integer and

b−a
h =
n
xi = a+ih for i = 0, 1, . . . , n
ξj ∈ [a, b]

then
Z b
f (x, yj ) dx
a
 
n/2−1 n/2
h X X
= f (x0 , yj ) + 2 f (x2i , yj ) + 4 f (x2i−1 , yj ) + f (xn , yj )
3
i=1 i=1

(b − a) 4 ∂4f
− h (ξj , yj )
180 ∂x 4
Quadrature Formula

Z b Z d
f (x, y ) dy dx
a c
 
n/2−1 n/2
hk  X X
≈ f (x0 , y0 ) + 2 f (x2i , y0 ) + 4 f (x2i−1 , y0 ) + f (xn , y0 )
9
i=1 i=1

m/2−1 m/2−1 n/2−1 m/2−1 n/2
X X X X X
+ 2 f (x0 , y2j ) + 2 f (x2i , y2j ) + 4 f (x2i
j=1 j=1 i=1 j=1 i=1

m/2 m/2 n/2−1 m/2 n/2
X X X XX
+ 4 f (x0 , y2j−1 ) + 2 f (x2i , y2j−1 ) + 4 f (x2i−1
j=1 j=1 i=1 j=1 i=1
 
n/2−1 n/2
X X
+ f (x0 , ym ) + 2 f (x2i , ym ) + 4 f (x2i−1 , ym ) + f (xn , ym )
i=1 i=1
Error

The error term for the double integral Composite Simpson’s rule
quadrature formula takes the form of

(d − c)(b − a) 4 ∂ 4 f 4
 
4∂ f ˆ
E(f ) = − h (ξ, µ) + k (ξ, µ̂)
180 ∂x 4 ∂y 4
Example (1 of 2)
Let m = 4 and n = 6 and use the Composite Simpson’s rule to
approximate the double integral:
Z π/4 Z 0
π h √ i
(2y sin x+cos2 x) dy dx = 6 + π(4 2 − 5) ≈ 0.35184
0 −π/3 72

1.0

0.5
0
z
0.0
Π
-0.5 -
12
-1.0
Π
0 - y
6
Π
24 Π
Π
12 Π -
4
x 8 Π
6

Π
24 Π -
3
4
Example (2 of 2)
Z π/4 Z 0
(2y sin x + cos2 x) dy dx ≈ 0.351846
0 −π/3

Absolute error:
π h √ i
6 + π(4 2 − 5) − 0.351846 ≈ 6.36354 × 10−6

72

Error bound:

|E(f )|
(d − c)(b − a) 4 ∂ 4 f 4
 
4∂ f ˆ

≤ max − h (ξ, µ) + k ( ξ, µ̂)
(ξ,µ),(ξ̂,µ̂)∈R
180 ∂x 4 ∂y 4
(π/3)(π/4)  π 4
= max 8(cos2 x − sin2 x) + 2y sin x

180 24 (ξ,µ),(ξ̂,µ̂)∈R
π6
= 8 ≈ 1.07322 × 10−5
716636160
Double Integrals with Gaussian Quadrature

We may also use Gaussian quadrature formulas to


approximate double integrals.
Consider the double integral:
Z b Z d
f (x, y ) dy dx
a c
Z bZ 1  
(d − c)u + c + d d − c
= f x, du dx
a −1 2 2
Z 1Z 1  
(b − a)v + a + b (d − c)u + c + d
= f ,
−1 −1 2 2

(b − a)(d − c)
du dv
4
Gaussian Quadrature Formula

For the sake of convenience we will use the same precision, n,


for each stage of the integration.
Z b Z d
f (x, y ) dy dx
a c
(b − a)(d − c)
≈ ·
4
n X n
(b − a)rn,i + a + b (d − c)rn,j + c + d
X  
cn,i cn,j f ,
2 2
i=1 j=1
Example

Using the double integral form of Gaussian quadrature with


n = 4 we may approximate
Z π/4 Z 0
(2y sin x + cos2 x) dy dx ≈ 0.35184
0 −π/3

Absolute error:
π h √ i
6 + π(4 2 − 5) − 0.35184 ≈ 5.94305 × 10−9

72

Integrating Over Non-rectangular Regions
Consider the double integral
ZZ Z b Z d(x)
f (x, y ) dA = f (x, y ) dy dx.
R a c(x)

Suppose we use the Composite Simpson’s rule to approximate


the “inner” integral.
Integrating Over Non-rectangular Regions
Consider the double integral
ZZ Z b Z d(x)
f (x, y ) dA = f (x, y ) dy dx.
R a c(x)

Suppose we use the Composite Simpson’s rule to approximate


the “inner” integral.
Z d(x)
f (x, y ) dy
c(x)

m/2−1
k (x)  X
≈ f (x, c(x)) + 2 f (x, c(x) + 2jk (x))
3
j=1

m/2
X
+4 f (x, c(x) + (2j − 1)k (x)) + f (x, d(x))
j=1

d(x) − c(x)
where m is an even integer and k (x) = .
m
Simplification (1 of 2)

To make the notation of the next step simpler we will make the
following change to the notation.

m/2−1
k (x)  X
F (x) = f (x, c(x)) + 2 f (x, c(x) + 2jk (x))
3
j=1

m/2
X
+4 f (x, c(x) + (2j − 1)k (x)) + f (x, d(x))
j=1
Simplification (2 of 2)

This implies
Z d(x)
f (x, y ) dy
c(x)

m/2−1
k (x)  X
≈ f (x, c(x)) + 2 f (x, c(x) + 2jk (x))
3
j=1

m/2
X
+4 f (x, c(x) + (2j − 1)k (x)) + f (x, d(x))
j=1
= F (x)
Simplification (2 of 2)

This implies
Z d(x)
f (x, y ) dy
c(x)

m/2−1
k (x)  X
≈ f (x, c(x)) + 2 f (x, c(x) + 2jk (x))
3
j=1

m/2
X
+4 f (x, c(x) + (2j − 1)k (x)) + f (x, d(x))
j=1
= F (x)

Now we may approximate the outer integral.


Outer Integral
Now we choose n to be an even integer and apply the
b−a
Composite Simpson’s rule with h = .
n
Z b Z d(x)
f (x, y ) dy dx
a c(x)

Z b m/2−1
k (x)  X
≈ f (x, c(x)) + 2 f (x, c(x) + 2jk (x))
a 3
j=1

m/2
X
+4 f (x, c(x) + (2j − 1)k (x)) + f (x, d(x)) dx
j=1
Z b
= F (x) dx
a
 
n/2−1 n/2
h X X
≈ F (a) + 2 F (a + 2ih) + 4 F (a + (2i − 1)h) + F (b)
3
i=1 i=1
Example (1 of 2)

Consider the double integral,


Z 1 Z 2x
(x 2 + y 3 ) dy dx = 1
0 x

1. Using the composite Simpson’s rule with n = m find the


smallest values of n and m required to estimate the double
integral to within 10−4 of its actual value.
2. Estimate the double integral.
Example (2 of 2)

Since we have no formula for the error term in this case we will
use the composite Simpson’s rule with n = m = 2, 4, . . . until
successive approximations differ by less than 10−4 .
n=m Estimate
2 1.03125
4 1.00195
6 1.00039
8 1.00012
10 1.00005
Gaussian Quadrature for General Regions (1 of 2)

Consider the double integral:


Z b Z d(x)
f (x, y ) dy dx
a c(x)

We can apply Gaussian quadrature to the “inner” integral.


Gaussian Quadrature for General Regions (1 of 2)

Consider the double integral:


Z b Z d(x)
f (x, y ) dy dx
a c(x)

We can apply Gaussian quadrature to the “inner” integral.


Z d(x)
f (x, y ) dy
c(x)
1  
(d(x) − c(x))u + c(x) + d(x) d(x) − c(x)
Z
= f x, du
−1 2 2
n
(d(x) − c(x))rn,j + c(x) + d(x)
 
d(x) − c(x) X
≈ cn,j f x,
2 2
j=1
Gaussian Quadrature for General Regions (2 of 2)

Therefore
Z b Z d(x)
f (x, y ) dy dx
a c(x)
 
Z b n
(d(x) − c(x))rn,j + c(x) + d(x)
 
 d(x) − c(x)
X
≈ cn,j f x, 
a 2 2
j=1

Now we apply Guassian quadrature to the remaining integral.


Algorithm

INPUT a, b; positive integers m, n.


STEP 1 Set h1 = (b − a)/2; h2 = (b + a)/2; J = 0.
STEP 2 For i = 1, 2, . . . , m do STEPS 3–5.
STEP 3 Set JX = 0; x = h1 rm,j + h2 ; d = d(x); c = c(x);
k1 = (d1 − c1 )/2; k2 = (d1 + c1 )/2.
STEP 4 For j = 1, 2, . . . , n set y = k1 rn,j + k2 ; Q = f (x, y );
JX = JX + cn,j Q.
STEP 5 Set J = J + cm,i k1 JX .
STEP 6 Set J = h1 J; OUTPUT J.
Example (1 of 2)
Use Gaussian quadrature with n = 4 to approximate the double
integral
Z e Z x2
ln(x y ) dy dx.
1 x

2
z
1 6

0
1.0 4 y
1.5

2.0 2
x

2.5
Example (2 of 2)

Z e Z x2
ln(x y ) dy dx ≈ 6.36185
1 x

Absolute error:
Z Z 2
e x
ln(x y ) dy dx − 6.36185 ≈ 5.95798 × 10−6


1 x
Homework

I Read Section 4.8.


I Exercises: 1ab, 5ab

You might also like