Sie sind auf Seite 1von 93
Numerical Differentiation & Integration Composite Numerical Integration I
Numerical Differentiation & Integration
Composite Numerical Integration I

Numerical Analysis (9th Edition) R L Burden & J D Faires

Beamer Presentation Slides prepared by John Carroll Dublin City University

c 2011 Brooks/Cole, Cengage Learning

J D Faires Beamer Presentation Slides prepared by John Carroll Dublin City University c 2011 Brooks/Cole,

Example

Outline

Composite Simpson

1
1

A Motivating Example

Composite Trapezoidal

Example

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 2 / 35
R L Burden & J D Faires
2 / 35

Example

Outline

Composite Simpson

A Motivating ExampleExample Outline Composite Simpson Composite Trapezoidal The Composite Simpson’s Rule Example Numerical Analysis (Chapter

Composite Trapezoidal

The Composite Simpson’s RuleComposite Simpson A Motivating Example Composite Trapezoidal Example Numerical Analysis (Chapter 4) Composite Numerical

Example

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 2 / 35
R L Burden & J D Faires
2 / 35

Example

Outline

Composite Simpson

Composite Trapezoidal

Example

1
1

A Motivating Example

2
2

The Composite Simpson’s Rule

3
3

The Composite Trapezoidal & Midpoint Rules

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 2 / 35
R L Burden & J D Faires
2 / 35

Example

Outline

Composite Simpson

Composite Trapezoidal

Example

1
1

A Motivating Example

2
2

The Composite Simpson’s Rule

3
3

The Composite Trapezoidal & Midpoint Rules

4
4

Comparing the Composite Simpson & Trapezoidal Rules

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 2 / 35
R L Burden & J D Faires
2 / 35

Example

Outline

Composite Simpson

Composite Trapezoidal

Example

1
1

A Motivating Example

2
2

The Composite Simpson’s Rule

3
3

The Composite Trapezoidal & Midpoint Rules

4
4

Comparing the Composite Simpson & Trapezoidal Rules

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 3 / 35
R L Burden & J D Faires
3 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Application of Simpson’s Rule Use Simpson’s rule to approximate 4 e x dx 0 Numerical
Application of Simpson’s Rule
Use Simpson’s rule to approximate
4
e x dx
0
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
4 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Application of Simpson’s Rule Use Simpson’s rule to approximate 4 e x dx 0 and
Application of Simpson’s Rule
Use Simpson’s rule to approximate
4
e x dx
0
and compare this to the results obtained by adding the Simpson’s rule
approximations for
2
e x dx
and
4 e x dx
0
2
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
4 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Application of Simpson’s Rule Use Simpson’s rule to approximate 4 e x dx 0 and
Application of Simpson’s Rule
Use Simpson’s rule to approximate
4
e x dx
0
and compare this to the results obtained by adding the Simpson’s rule
approximations for
2
e x dx
and
4 e x dx
0
2
and adding those for
1
e x dx ,
2 e x dx ,
3 e x dx
and
4 e x dx
0
1
2
3
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
4 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (1/3)

Solution (1/3)  
 

Simpson’s rule on [0 , 4] uses h = 2

   
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 5 / 35
R L Burden & J D Faires
5 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (1/3) Simpson’s rule on [0 , 4] uses h = 2 and gives 4
Solution (1/3)
Simpson’s rule on [0 , 4] uses h = 2 and gives
4
e x dx ≈ 2
3 (e 0 + 4e 2 + e 4 ) = 56 .76958 .
0

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 5 / 35
R L Burden & J D Faires
5 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (1/3) Simpson’s rule on [0 , 4] uses h = 2 and gives 4
Solution (1/3)
Simpson’s rule on [0 , 4] uses h = 2 and gives
4
e x dx ≈ 2
3 (e 0 + 4e 2 + e 4 ) = 56 .76958 .
0
The exact answer in this case is e 4 − e 0 = 53 .59815, and the error
− 3 .17143 is far larger than we would normally accept.

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 5 / 35
R L Burden & J D Faires
5 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (2/3)

   

Applying Simpson’s rule on each of the intervals [0 , 2] and [2 , 4] uses h = 1

   
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 6 / 35
R L Burden & J D Faires
6 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (2/3)

   

Applying Simpson’s rule on each of the intervals [0 , 2] and [2 , 4] uses h = 1 and gives

   
 

4

0

e x dx

=

2 e x dx + 4 e x dx

0

2

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 6 / 35
R L Burden & J D Faires
6 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (2/3)

 

Applying Simpson’s rule on each of the intervals [0 , 2] and [2 , 4] uses h = 1 and gives

4

0

e x dx

=

 
 

2 e x dx + 4 e x dx

1

1

0

2

 

 

3

e 0 + 4e + e 2 + 3 e 2 + 4e 3 + e 4

+ 4 e + e 2 + 3 e 2 + 4 e 3 + e
+ 4 e + e 2 + 3 e 2 + 4 e 3 + e

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 6 / 35
R L Burden & J D Faires
6 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (2/3)

 

Applying Simpson’s rule on each of the intervals [0 , 2] and [2 , 4] uses h = 1 and gives

4

0

e x dx

=

2 e x dx + 4 e x dx

0

2

1

 
 

1

3 e 2 + 4e 3 + e 4

 

e 0 + 4e + e 2 +

 

3

1

e 0 + 4e + 2e 2 + 4e 3 + e 4

 

=

 

3

2 e 2 + 4 e 3 + e 4   =   3 Numerical Analysis
2 e 2 + 4 e 3 + e 4   =   3 Numerical Analysis

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 6 / 35
R L Burden & J D Faires
6 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (2/3)

 

Applying Simpson’s rule on each of the intervals [0 , 2] and [2 , 4] uses h = 1 and gives

4

0

e x dx

=

2 e x dx + 4 e x dx

0

2

1

 
 

1

3 e 2 + 4e 3 + e 4

 

e 0 + 4e + e 2 +

 

3

1

e 0 + 4e + 2e 2 + 4e 3 + e 4

 

=

 

3

 

=

53 .86385

 

The error has been reduced to 0 .26570.

 
The error has been reduced to − 0 . 26570.   Numerical Analysis (Chapter 4) Composite
The error has been reduced to − 0 . 26570.   Numerical Analysis (Chapter 4) Composite

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 6 / 35
R L Burden & J D Faires
6 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (3/3)

1

For the integrals on [0 , 1],[1 , 2],[3 , 4], and [3 , 4] we use Simpson’s rule four times with h =

2

Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
7 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (3/3)

 

For the integrals on [0 , 1],[1 , 2],[3 , 4], and [3 , 4] we use Simpson’s rule four times with h = 2 giving

1

4

0

e x dx = 1 e x dx + 2 e x dx + 3 e x dx + 4 e x dx

0

1

2

3

Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
7 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (3/3)

 

For the integrals on [0 , 1],[1 , 2],[3 , 4], and [3 , 4] we use Simpson’s rule four times with h = 2 giving

1

 

1

4

0

e x dx = 1 e x dx + 2 e x dx + 3 e x dx + 4 e x dx

0

1

2

3

1

e 0 + 4e 1 /2 + e +

6 e + 4e 3 /2 + e 2

 
 

6

+ 1 6

e 2 + 4e 5 /2 + e 3 +

1

6 e 3 + 4e 7 /2 + e 4

Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
7 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (3/3)

 

For the integrals on [0 , 1],[1 , 2],[3 , 4], and [3 , 4] we use Simpson’s rule four times with h = 2 giving

1

4

0

e x dx = 1 e x dx + 2 e x dx + 3 e x dx + 4 e x dx

0

1

2

3

1

e 0 + 4e 1 /2 + e +

6

1

6 e + 4e 3 /2 + e 2

+ 1 6

e 2 + 4e 5 /2 + e 3 +

 

1

e 3 + 4e 7 /2 + e 4

 

6

1

= 6 e 0 + 4e 1 /2 + 2e + 4e 3 /2 + 2e 2 + 4e 5 /2 + 2e 3 + 4e 7 /2 + e 4

Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
7 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Motivating Example

Solution (3/3)

 

For the integrals on [0 , 1],[1 , 2],[3 , 4], and [3 , 4] we use Simpson’s rule four times with h = 2 giving

1

4

0

e x dx = 1 e x dx + 2 e x dx + 3 e x dx + 4 e x dx

0

1

2

3

1

e 0 + 4e 1 /2 + e +

6

1

6 e + 4e 3 /2 + e 2

+ 1 6

e 2 + 4e 5 /2 + e 3 +

 

1

e 3 + 4e 7 /2 + e 4

 

6

1

= 6 e 0 + 4e 1 /2 + 2e + 4e 3 /2 + 2e 2 + 4e 5 /2 + 2e 3 + 4e 7 /2 + e 4

= 53 .61622 .

The error for this approximation has been reduced to 0 .01807.

Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
7 / 35

Example

Outline

Composite Simpson

Composite Trapezoidal

Example

1
1

A Motivating Example

2
2

The Composite Simpson’s Rule

3
3

The Composite Trapezoidal & Midpoint Rules

4
4

Comparing the Composite Simpson & Trapezoidal Rules

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 8 / 35
R L Burden & J D Faires
8 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

b To generalize this procedure for an arbitrary integral f (x) dx, a choose an
b
To generalize this procedure for an arbitrary integral
f (x) dx,
a
choose an even integer n. Subdivide the interval [a , b] into n
subintervals, and apply Simpson’s rule on each consecutive pair of
subintervals.
y
y 5 f(x)
a 5 x
b 5 x n
x
0 x 2
x 2j22
x 2j21
x 2j
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
9 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term

 
Construct the Formula & Error Term    
 
 

With h = (b a)/n and x j = a + jh, for each j = 0 , 1 ,

, n,

 
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 10 / 35
R L Burden & J D Faires
10 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term

Construct the Formula & Error Term
With h = (b − a)/n and x j = a + jh, for each
With h
= (b − a)/n and x j = a + jh, for each j = 0 , 1 ,
, n, we have
n
/2
b
x
2j
f (x) dx =
f (x) dx
a
j=1
x 2j − 2
n
/2
5
h
h
=
[f(x 2j − 2 ) + 4f(x 2j − 1 ) + f(x 2j )] − 90 f (4) (ξ j )
3
j=1
for some ξ j with x 2j − 2 < ξ j < x 2j , provided that f ∈ C 4 [a , b].

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 10 / 35
R L Burden & J D Faires
10 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

n /2 b 5 h h f (x) dx = [f(x 2j − 2 )
n /2
b
5
h
h
f (x) dx =
[f(x 2j − 2 ) + 4f(x 2j − 1 ) + f(x 2j )] − 90 f (4) (ξ j )
3
a
j=1
Construct the Formula & Error Term (Cont’d)
Using the fact that for each j = 1 , 2 ,
, (n /2) − 1 we have f (x 2j )
appearing in the term corresponding to the interval [x 2j − 2 , x 2j ]
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
11 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

n /2 b 5 h h f (x) dx = [f(x 2j − 2 )
n /2
b
5
h
h
f (x) dx =
[f(x 2j − 2 ) + 4f(x 2j − 1 ) + f(x 2j )] − 90 f (4) (ξ j )
3
a
j=1
Construct the Formula & Error Term (Cont’d)
Using the fact that for each j = 1 , 2 ,
, (n /2) − 1 we have f (x 2j )
appearing in the term corresponding to the interval [x 2j − 2 , x 2j ] and also
in the term corresponding to the interval [x 2j , x 2j+2 ],
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
11 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

a

b

f (x) dx =

n

/2

j=1

h

3

5

[f(x 2j 2 ) + 4f(x 2j 1 ) + f(x 2j )] 90 f (4) (ξ j )

h

Construct the Formula & Error Term (Cont’d)

 

Using the fact that for

each j = 1 , 2 ,

, (n /2) 1 we have f (x 2j )

appearing in the term corresponding to the interval [x 2j 2 , x 2j ] and also

in the term corresponding to the interval [x 2j , x 2j+2 ], we can reduce this sum to

a

b

(n

/2)1

n

/2

f(x 2j 1 ) + f(x n )

 

f (x) dx

=

h

3

f(x 0 ) + 2

j=1

f(x 2j ) + 4

j=1

 

h 5

90

n

/2

f (4) (ξ j )

 
 

j=1

 
f ( 4 ) ( ξ j )     j = 1   Numerical Analysis

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires

11 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d) The error associated with this approximation is n
Construct the Formula & Error Term (Cont’d)
The error associated with this approximation is
n /2
E(f) = − h 5
f (4) (ξ j )
90
j=1
where x 2j − 2 < ξ j < x 2j , for each j = 1 , 2 ,
, n /2. If f ∈ C 4 [a , b], the
Extreme Value Theorem
See Theorem implies that f (4) assumes its
maximum and minimum in [a , b].

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 12 / 35
R L Burden & J D Faires
12 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d) Since min b] f (4) (x) ≤ f
Construct the Formula & Error Term (Cont’d)
Since
min b] f (4) (x) ≤ f (4) (ξ j ) ≤ max
f (4) (x)
x ∈[a ,
x ∈[a ,
b]
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
13 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d)

 

Since

 

min b] f (4) (x) f (4) (ξ j ) max

x [a ,

x [a ,

b]

f (4) (x)

we have

 

n

/2

 

n

2

min b]

x [a ,

f (4) (x)

j=1

f (4) (ξ j )

n

2

max

x [a ,

b]

f (4) (x)

n 2 max x ∈ [ a , b ] f ( 4 ) ( x
n 2 max x ∈ [ a , b ] f ( 4 ) ( x

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 13 / 35
R L Burden & J D Faires
13 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d)

 

Since

 

min b] f (4) (x) f (4) (ξ j ) max

x [a ,

x [a ,

b]

f (4) (x)

we have

 

n

/2

 

n

min b] f (4) (x)

x [a ,

f (4) (ξ j )

n

max

f (4) (x)

and

2

j=1

2

x [a ,

b]

 

min b] f (4) (x) 2

n

x [a ,

n

/2

j=1

f

(4) (ξ j ) max

x [a ,

b]

f (4) (x)

) ≤ max x ∈ [ a , b ] f ( 4 ) ( x
) ≤ max x ∈ [ a , b ] f ( 4 ) ( x

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 13 / 35
R L Burden & J D Faires
13 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d) By the Intermediate Value Theorem See Theorem Numerical
Construct the Formula & Error Term (Cont’d)
By the Intermediate Value Theorem
See Theorem
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
14 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d)

 

By the Intermediate Value Theorem such that

 

See Theorem

there is a µ (a , b)

 

(4) (µ ) = 2

n

n

/2

f

f (4) (ξ j )

 
 

j=1

 
Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
14 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d)

 

By the Intermediate Value Theorem such that

 

See Theorem

 

there is a µ (a , b)

n

/2

f

(4) (µ ) = 2

f

(4) (ξ j )

 
 

n

j=1

 

Thus

E(f) = h 5

90

n

/2

h

5

f

(4) (ξ j ) = 180 nf (4) (µ )

 

j=1

Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
14 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Construct the Formula & Error Term (Cont’d)

 

By the Intermediate Value Theorem such that

 

See Theorem

 

there is a µ (a , b)

n

/2

 

f

(4) (µ ) = 2

f

(4) (ξ j )

 
 

n

j=1

 

Thus

n

/2

h

5

E(f) = h 5

90

f

(4) (ξ j ) = 180 nf (4) (µ )

 

j=1

or, since h = (b a)/n,

 

E(f) = (b a) h 4 f (4) (µ )

180

 
Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden & J D Faires
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
14 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

These observations produce the following result.

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 15 / 35
R L Burden & J D Faires
15 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

These observations produce the following result.

Theorem: Composite Simpson’s Rule

Theorem: Composite Simpson’s Rule  
 

Let f C 4 [a , b], n be even, h = (b a)/n, and x j = a + jh, for each

   

j

= 0 , 1 ,

, n.

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 15 / 35
R L Burden & J D Faires
15 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

These observations produce the following result.

Theorem: Composite Simpson’s Rule Let f ∈ C 4 [a , b], n be even,
Theorem: Composite Simpson’s Rule
Let f ∈ C 4 [a , b], n be even, h = (b − a)/n, and x j = a + jh, for each
j
= 0 , 1 ,
, n. There exists a µ ∈ (a , b) for which the Composite
Simpson’s rule for n subintervals can be written with its error term as
(n
/2)− 1
n
/2
b
h
f (x) dx
=
 f(a) + 2
f(x 2j ) + 4
f(x 2j − 1 ) + f(b) 
3
a
j=1
j=1
− b − a
h 4 f (4) (µ )
180

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 15 / 35
R L Burden & J D Faires
15 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Comments on the Formula & Error Term

 
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 16 / 35
R L Burden & J D Faires
16 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Comments on the Formula & Error Term

   
 
  Notice that the error term for the Composite Simpson’s rule is O ( h 4

Notice that the error term for the Composite Simpson’s rule is O(h 4 ), whereas it was O(h 5 ) for the standard Simpson’s rule.

 
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 16 / 35
R L Burden & J D Faires
16 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Comments on the Formula & Error Term

   
 

Notice that the error term for the Composite Simpson’s rule is O ( h 4 ) , whereas it was O ( h 5 ) for O(h 4 ), whereas it was O(h 5 ) for the standard Simpson’s rule.

 

However, these rates are not comparable because, for the standard Simpson’s rule, we have h fixed at h = ( b − a ) / 2, but for Composite h fixed at h = (b a)/2, but for Composite Simpson’s rule we have h = (b a)/n, for n an even integer.

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 16 / 35
R L Burden & J D Faires
16 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Comments on the Formula & Error Term

   
 

Notice that the error term for the Composite Simpson’s rule is O ( h 4 ) , whereas it was O ( h 5 ) for O(h 4 ), whereas it was O(h 5 ) for the standard Simpson’s rule.

 

However, these rates are not comparable because, for the standard Simpson’s rule, we have h fixed at h = ( b − a ) / 2, but for Composite h fixed at h = (b a)/2, but for Composite Simpson’s rule we have h = (b a)/n, for n an even integer.

This permits us to considerably reduce the value of h . h.

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 16 / 35
R L Burden & J D Faires
16 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Simpson’s Rule

Comments on the Formula & Error Term

   
 

Notice that the error term for the Composite Simpson’s rule is O ( h 4 ) , whereas it was O ( h 5 ) for O(h 4 ), whereas it was O(h 5 ) for the standard Simpson’s rule.

 

However, these rates are not comparable because, for the standard Simpson’s rule, we have h fixed at h = ( b − a ) / 2, but for Composite h fixed at h = (b a)/2, but for Composite Simpson’s rule we have h = (b a)/n, for n an even integer.

This permits us to considerably reduce the value of h . h.

The following algorithm uses the Composite Simpson’s rule on n subintervals. It is the most frequently-used general-purpose quadrature algorithm. n subintervals. It is the most frequently-used general-purpose quadrature algorithm.

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 16 / 35
R L Burden & J D Faires
16 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 17 / 35
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT endpoints a , b; even positive integer n Numerical Analysis (Chapter 4) Composite Numerical
INPUT
endpoints a , b; even positive integer n
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT OUTPUT endpoints a , b; even positive integer n approximation XI to I Numerical
INPUT
OUTPUT
endpoints a , b; even positive integer n
approximation XI to I
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT endpoints a , b; even positive integer n OUTPUT approximation XI to I Step
INPUT endpoints a , b; even positive integer n
OUTPUT approximation XI to I
Step 1 Set h = (b − a)/n
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT endpoints a , b; even positive integer n OUTPUT Step 1 approximation XI to
INPUT endpoints a , b; even positive integer n
OUTPUT
Step 1
approximation XI to I
Set h = (b − a)/n
Step 2 Set XI0 = f (a) + f (b)
XI1 = 0;
(Summation of f (x 2i − 1 )
XI2 = 0. (Summation of f (x 2i ))
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT OUTPUT Step 1 Step 2 endpoints a , b; even positive integer n approximation
INPUT
OUTPUT
Step 1
Step 2
endpoints a , b; even positive integer n
approximation XI to I
Set h = (b − a)/n
Set XI0 = f (a) + f (b)
XI1 = 0;
(Summation of f (x 2i − 1 )
XI2 = 0. (Summation of f (x 2i ))
Step 3
For i = 1 ,
, n − 1 do Steps 4 and 5:
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT OUTPUT Step 1 Step 2 endpoints a , b; even positive integer n approximation
INPUT
OUTPUT
Step 1
Step 2
endpoints a , b; even positive integer n
approximation XI to I
Set h = (b − a)/n
Set XI0 = f (a) + f (b)
XI1 = 0; (Summation of f (x 2i − 1 )
XI2 = 0. (Summation of f (x 2i ))
Step 3
For i = 1 ,
, n − 1 do Steps 4 and 5:
Step 4: Set X = a + ih
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT OUTPUT Step 1 Step 2 endpoints a , b; even positive integer n approximation
INPUT
OUTPUT
Step 1
Step 2
endpoints a , b; even positive integer n
approximation XI to I
Set h = (b − a)/n
Set XI0 = f (a) + f (b)
XI1 = 0; (Summation of f (x 2i − 1 )
XI2 = 0. (Summation of f (x 2i ))
Step 3
For i = 1 ,
, n − 1 do Steps 4 and 5:
Step 4: Set X = a + ih
Step 5: If i is even then set XI2 = XI2 + f (X )
else set XI1 = XI1 + f (X )
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT OUTPUT Step 1 Step 2 endpoints a , b; even positive integer n approximation
INPUT
OUTPUT
Step 1
Step 2
endpoints a , b; even positive integer n
approximation XI to I
Set h = (b − a)/n
Set XI0 = f (a) + f (b)
XI1 = 0; (Summation of f (x 2i − 1 )
XI2 = 0. (Summation of f (x 2i ))
Step 3
For i = 1 ,
, n − 1 do Steps 4 and 5:
Step 6
Step 4: Set X = a + ih
Step 5: If i is even then set XI2 = XI2 + f (X )
else set XI1 = XI1 + f (X )
Set XI = h(XI0 + 2 · XI2 + 4 · XI1)/3
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Simpson’s Rule Algorithm

To approximate the integral I =

a

b f (x) dx:

INPUT OUTPUT Step 1 Step 2 endpoints a , b; even positive integer n approximation
INPUT
OUTPUT
Step 1
Step 2
endpoints a , b; even positive integer n
approximation XI to I
Set h = (b − a)/n
Set XI0 = f (a) + f (b)
XI1 = 0; (Summation of f (x 2i − 1 )
XI2 = 0. (Summation of f (x 2i ))
Step 3
For i = 1 ,
, n − 1 do Steps 4 and 5:
Step 6
Step 4: Set X = a + ih
Step 5: If i is even then set XI2 = XI2 + f (X )
else set XI1 = XI1 + f (X )
Set XI = h(XI0 + 2 · XI2 + 4 · XI1)/3
Step 7
OUTPUT (XI)
STOP
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
17 / 35

Example

Outline

Composite Simpson

Composite Trapezoidal

Example

1
1

A Motivating Example

2
2

The Composite Simpson’s Rule

3
3

The Composite Trapezoidal & Midpoint Rules

4
4

Comparing the Composite Simpson & Trapezoidal Rules

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 18 / 35
R L Burden & J D Faires
18 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Trapezoidal & Midpoint Rules

 

Preamble

  Preamble  
 
 
  The subdivision approach can be applied to any of the Newton-Cotes formulas.  

The subdivision approach can be applied to any of the Newton-Cotes formulas.

 
   
 
   
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 19 / 35
R L Burden & J D Faires
19 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Trapezoidal & Midpoint Rules

Preamble

Preamble  
 
 

The subdivision approach can be applied to any of the Newton-Cotes formulas.   

 

The extensions of the Trapezoidal and Midpoint rules will be presented without proof.    The subdivision approach can be applied to any of the Newton-Cotes formulas.    

 
   
   
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 19 / 35
R L Burden & J D Faires
19 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Trapezoidal & Midpoint Rules

Preamble

Preamble  
 
 

The subdivision approach can be applied to any of the Newton-Cotes formulas.   

 

The extensions of the Trapezoidal and Midpoint rules will be presented without proof.be applied to any of the Newton-Cotes formulas.   The Trapezoidal rule requires only one interval

The Trapezoidal rule requires only one interval for each application, so the integer n can be either odd or even . n can be either odd or even.

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 19 / 35
R L Burden & J D Faires
19 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Integration: Trapezoidal & Midpoint Rules

 

Preamble

  Preamble  
 
 

The subdivision approach can be applied to any of the Newton-Cotes formulas.     

   

The extensions of the Trapezoidal and Midpoint rules will be presented without proof.to any of the Newton-Cotes formulas.     The Trapezoidal rule requires only one interval for

The Trapezoidal rule requires only one interval for each application, so the integer n can be either odd or even . n can be either odd or even.

For the Midpoint rule, however, the integer n must be even .

For the Midpoint rule, however, the integer n must be even.

   
   

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 19 / 35
R L Burden & J D Faires
19 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Numerical Integration: Composite Trapezoidal Rule

y

y 5 f(x) a 5 x b 5 x n 0 x 1 x j21
y 5 f(x)
a 5 x
b 5 x n
0
x 1
x j21
x j
x n21

x

y 5 f(x) a 5 x b 5 x n 0 x 1 x j21 x
y 5 f(x) a 5 x b 5 x n 0 x 1 x j21 x
Note: The Trapezoidal rule requires only one interval for each application, so the integer n
Note: The Trapezoidal rule requires only one interval for each
application, so the integer n can be either odd or even.
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
20 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Numerical Integration: Composite Trapezoidal Rule

Theorem: Composite Trapezoidal Rule

 
Theorem: Composite Trapezoidal Rule    
 
 

Let f C 2 [a , b], h = (b a)/n, and x j = a + jh, for each j = 0 , 1 ,

, n.

 
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 21 / 35
R L Burden & J D Faires
21 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Numerical Integration: Composite Trapezoidal Rule

Theorem: Composite Trapezoidal Rule Let f ∈ C 2 [a , b], h = (b
Theorem: Composite Trapezoidal Rule
Let f ∈ C 2 [a , b], h = (b − a)/n, and x j = a + jh, for each j = 0 , 1 ,
, n.
There exists a µ ∈ (a , b) for which the Composite Trapezoidal Rule for
n subintervals can be written with its error term as
n
− 1
b
 − b − a
f (x) dx = h
 f(a) + 2
f(x j ) + f(b) 
h 2 f ′′ (µ )
2
12
a
j=1

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 21 / 35
R L Burden & J D Faires
21 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Numerical Integration: Composite Midpoint Rule

Midpoint Rule (1-point open Newton-Cotes formula) x 3 1 f (x) dx = 2hf (x
Midpoint Rule (1-point open Newton-Cotes formula)
x
3
1
f (x) dx = 2hf (x 0 ) + h 3 f ′′ (ξ ),
where
x − 1 < ξ < x 1
x
− 1
Theorem: Composite Midpoint Rule Numerical Analysis (Chapter 4) Composite Numerical Integration I R L Burden
Theorem: Composite Midpoint Rule
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
22 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Numerical Integration: Composite Midpoint Rule

Midpoint Rule (1-point open Newton-Cotes formula) x 3 1 f (x) dx = 2hf (x
Midpoint Rule (1-point open Newton-Cotes formula)
x
3
1
f (x) dx = 2hf (x 0 ) + h 3 f ′′ (ξ ),
where
x − 1 < ξ < x 1
x
− 1
Theorem: Composite Midpoint Rule Let f ∈ C 2 [a , b], n be even,
Theorem: Composite Midpoint Rule
Let f ∈ C 2 [a , b], n be even, h = (b − a)/(n + 2), and x j = a + (j + 1)h
for each j = − 1 , 0 ,
, n + 1.
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
22 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Numerical Integration: Composite Midpoint Rule

Midpoint Rule (1-point open Newton-Cotes formula) x 3 1 f (x) dx = 2hf (x
Midpoint Rule (1-point open Newton-Cotes formula)
x
3
1
f (x) dx = 2hf (x 0 ) + h 3 f ′′ (ξ ),
where
x − 1 < ξ < x 1
x
− 1
Theorem: Composite Midpoint Rule Let f ∈ C 2 [a , b], n be even,
Theorem: Composite Midpoint Rule
Let f ∈ C 2 [a , b], n be even, h = (b − a)/(n + 2),
for each j = − 1 , 0 ,
, n + 1. There exists a µ ∈
and x j = a + (j + 1)h
(a , b) for which the
Composite Midpoint rule for n + 2 subintervals can be written with its
error term as
n
/2
b
f (x) dx = 2h
f(x 2j ) + b − a h 2 f ′′ (µ )
6
a
j=0
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
22 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Numerical Integration: Composite Midpoint Rule

y

y 5 f ( x )
y 5 f ( x )
y 5 f ( x )

y 5 f (x)

x

a 5 x 2 1 x 0 x 1 x 2 j 2 1 x

a

5 x 21

a 5 x 2 1 x 0 x 1 x 2 j 2 1 x 2

x 0

x 1

a 5 x 2 1 x 0 x 1 x 2 j 2 1 x 2
a 5 x 2 1 x 0 x 1 x 2 j 2 1 x 2
a 5 x 2 1 x 0 x 1 x 2 j 2 1 x 2

x 2j21

x 2j

x 2j11

a 5 x 2 1 x 0 x 1 x 2 j 2 1 x 2

x n21

x n

b 5 x n11

x 2 j 1 1 x n 2 1 x n b 5 x n 1
x 2 j 1 1 x n 2 1 x n b 5 x n 1
Note: The Midpoint Rule requires two intervals for each application, so the integer n must
Note: The Midpoint Rule requires two intervals for each application, so
the integer n must be even.
Numerical Analysis (Chapter 4)
Composite Numerical Integration I
R L Burden & J D Faires
23 / 35

Example

Outline

Composite Simpson

Composite Trapezoidal

Example

1
1

A Motivating Example

2
2

The Composite Simpson’s Rule

3
3

The Composite Trapezoidal & Midpoint Rules

4
4

Comparing the Composite Simpson & Trapezoidal Rules

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 24 / 35
R L Burden & J D Faires
24 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

Example: Trapezoidal .v. Simpson’s Rules

Example: Trapezoidal .v. Simpson’s Rules  
 

Determine values of h that will ensure an approximation error of less

   

than 0 .00002 when approximating

0

π

 

sin x dx and employing:

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 25 / 35
R L Burden & J D Faires
25 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

Example: Trapezoidal .v. Simpson’s Rules

Example: Trapezoidal .v. Simpson’s Rules  
 

Determine values of h that will ensure an approximation error of less

   

than 0 .00002 when approximating

0

π

sin x dx and employing:

 

(a)

Composite Trapezoidal rule and

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 25 / 35
R L Burden & J D Faires
25 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

Example: Trapezoidal .v. Simpson’s Rules

Example: Trapezoidal .v. Simpson’s Rules  
 

Determine values of h that will ensure an approximation error of less

   

than 0 .00002 when approximating

0

π

sin x dx and employing:

 

(a)

Composite Trapezoidal rule and

(b)

Composite Simpson’s rule.

 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 25 / 35
R L Burden & J D Faires
25 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

Solution (1/5)

   

The error form for the Composite Trapezoidal rule for f (x) = sin x on [0 , π ] is

   
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 26 / 35
R L Burden & J D Faires
26 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

Solution (1/5) The error form for the Composite Trapezoidal rule for f (x) = sin
Solution (1/5)
The error form for the Composite Trapezoidal rule for f (x) = sin x on
[0 , π ] is
π h 2
2
π h 2
π h
f ′′ (µ )
(− sin µ )
=
| sin µ |.
=
12
12
12

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 26 / 35
R L Burden & J D Faires
26 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

Solution (1/5) The error form for the Composite Trapezoidal rule for f (x) = sin
Solution (1/5)
The error form for the Composite Trapezoidal rule for f (x) = sin x on
[0 , π ] is
π h 2
2
π h 2
π h
f ′′ (µ )
(− sin µ )
=
| sin µ |.
=
12
12
12
To ensure sufficient accuracy with this technique, we need to have
2
π h 2
|
sin µ | ≤ π h
< 0 .00002 .
12
12

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 26 / 35
R L Burden & J D Faires
26 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

π h 2

12

|

2

sin µ | ≤ π h

12

< 0 .00002

Solution (2/5)

Solution (2/5)
 
 
 

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 27 / 35
R L Burden & J D Faires
27 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

2 π h 2 | sin µ | ≤ π h < 0 .00002 12
2
π h 2
|
sin µ | ≤ π h
< 0 .00002
12
12
Solution (2/5)
Since h = π/n implies that n = π/h, we need
π 3
<
0 .00002
12n 2

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 27 / 35
R L Burden & J D Faires
27 / 35

Example

Composite Simpson

Composite Trapezoidal

Example

Composite Numerical Integration: Example

2 π h 2 | sin µ | ≤ π h < 0 .00002 12
2
π h 2
|
sin µ | ≤ π h
< 0 .00002
12
12
Solution (2/5)
Since h = π/n implies that n = π/h, we need
3
π
<
0 .00002
12n 2
3
π
⇒ n
>
≈ 359 .44
12(0 .00002) 1 /2
and the Composite Trapezoidal rule requires n ≥ 360.

Numerical Analysis (Chapter 4)

Composite Numerical Integration I

R L Burden & J D Faires 27 / 35