Chapter 21
Chapter 21
Chapter 21
1
Ea f (x )(b a) 3 Approximate error
12
where x lies somewhere in the interval from a to b.
Note f ' ' (x ) is the average value of the second
b
derivative in the interval [a,b]
a f ' ' ( x)dx
f ' ' (x )
(b a )
by Lale Yurttas, Texas Chapter 21 6
A&M University
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example:
Use trapezoidal rule (1 segment) to numerically integrate
from a = 0 to b = 0.8. Recall that the exact value of this integration is 1.640533.
Find the exact and approximate errors.
1.467733
relative _ error 100 % 89.5%
1.640533
7
Chapter 21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
•To find the approximate error: 4050 X-10,000X40x
=400
+
0.8
2 3
( 400 4050 x 10,800 x 8000 x )dx
f ' ' ( x) 0
60
(0.8 0)
1 1
Ea f ' ' (x )(b a)3 (60)(0.8 0)3 2.56
12 Yurttas, Texas
by Lale 12 8
A&M University Chapter 21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
[ 0r](08-9)3 =-400X 110.0093 orme
-
-
+ neso
ba
Where h
n
The error for the multiple application trapezoidal rule is obtained by summing the
individual errors for each segment.
(b a)3 n (b a)3
Ea 3
12n i 1
f (xi )
12n 2
f ''
Where f '' is the average of f’’ over the entire interval [a,b]
0.8
2 3
( 400 4050 x 10,800 x 8000 x )dx
f ' ' ( x) 0
60
(0.8 0)
(b a )3 0.83
Ea 2
f '' 2
(60) 0.64
12n 12(2 )
Chapter 21 13
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simpson’s Rules
• More accurate estimate of an integral is
obtained if a high-order polynomial is used to
connect the points. The formulas that result
from taking the integrals under such
polynomials are called Simpson’s rules.
a x0 b x2
x2
( x x1 )( x x2 ) ( x x0 )( x x2 ) ( x x0 )( x x1 )
I f ( x0 ) f ( x1 ) f ( x2 )dx
x0
( x0 x1 )( x0 x2 ) ( x1 x0 )( x1 x2 ) ( x2 x0 )( x2 x1 )
h ba
I f ( x0 ) 4 f ( x1 ) f ( x2 ) h
3 2
The approximate error in the Simpson 1/3 rule is: The label “1/ 3” stems
from the fact that
(b a )5 ( 4 ) (b a )5 ( 4 )
y(/)//
h is divided by 3
Ea f (x ) f
2880 2880
f (4)
is the average of the fourth derivative of f in the
interval [a,b] 16
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example:
Use the single application of Simpson’s 1/3 rule to numerically integrate
from a=0 to b=0.8. Recall that the exact value of this integration is 1.640533.
Find the exact and approximate errors.
Solution: b a 0. 8 0
f(0)=0.2 h 0 .4
f(0.4)=2.456 2 2
f(0.8)=0.232 h
I [ f ( xo ) 4 f ( x1 ) f ( x2 )]
3
0 .4
[0.2 4(2.456 ) 0.232 ] 1.367467
3
Et 1.640533 1.367467 0.273066
0.273066
relative _ error 100 % 16.6%
1.640533
17
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
•To find the approximate error:
f ' ' ( x) 400 4050 x 10,800 x 2 8000 x 3
f ' ' ' ( x) 4050 21,600 x 24,000 x 2
f ( 4 ) ( x) 21,600 48,000 x
•The average value of f (4) (x) in the interval [0,0.8] is:
0.8
Chapter 21 18
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple Application Simpson’s 1/3 Rule
•The accuracy of Simpson’s rule can be improved by further dividing the interval into
smaller segment (n segments).
HAHA
x2 x4 x6 xn
h h
[ f ( xo ) 4 f ( x1 ) f ( x2 )] [ f ( x2 ) 4 f ( x3 ) f ( x4 )]
3 3
h h Graphical representation
[ f ( x4 ) 4 f ( x5 ) f ( x6 )] .... [ f ( xn 2 ) 4 f ( xn 1 ) f ( xn )] of the multiple application
3 3
h of Simpson’s 1/3 rule.
[ f ( xo ) 4 f ( x1 ) 2 f ( x2 ) 4 f ( x3 ) 2 f ( x4 ) 4 f ( x5 ) 2 f ( x6 ) Note that the method can
3
be employed only if the
..... 2 f ( xn 2 ) 4 f ( xn 1 ) f ( xn )]
number of segments is
n 1 n2
h even.
I [ f ( xo ) 4 f ( xi ) 2 f ( x j ) f ( xn )]
3 i 1, 3, 5 j 2, 4, 6 (Even-segment–Odd-point)
ba
h
n
The error estimate is obtained by summing all (b a )5
Ea f ( 4)
the individual errors for the segments. 180 n 4
19
Chapter 21 Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example:
Use the multiple application of Simpson’s 1/3 rule (N=4) to numerically integrate
from a=0 to b=0.8. Recall that the exact value of this integration is 1.640533.
Find the exact and approximate errors.
b a 0 .8 0
n 1 n2
h
I [ f ( xo ) 4 f ( xi ) 2 f ( x j ) f ( xn )]
h 7 - 0. 2 3 i 1, 3, 5 j 2, 4, 6
n WE v
4 depends typar h b a
④
a
on
-Y n
h
I { f ( xo ) 4[ f ( x1 ) f ( x3 )] 2 f ( x2 ) f ( x4 )}
3
0.2
[0.2 4(1.288 3.464) 2( 2.456) 0.232] 1.623467
3
Et 1.640533 1.623467 0.017067
0.017067
relative _ error 100% 1.04%
1.640533 20
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
•To find the approximate error:
f ' ' ( x) 400 4050 x 10,800 x 2 8000 x 3
f ' ' ' ( x) 4050 21,600 x 24,000 x 2
f ( 4 ) ( x) 21,600 48,000 x
•The average value of f (4) (x) in the interval [0,0.8] is:
0.8
Chapter 21 21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simpson’s 3/8 Rule
Results when a third-order interpolating polynomial is used.
b b
I f ( x)dx f 3 ( x)dx
a a
a x0 b x3
&
( x x1 )( x x2 )( x x3 ) ( x x0 )( x x2 )( x x3 )
f ( x ) f ( x )
x ( x x )( x x )( x x ) ( x1 x0 )( x1 x2 )( x1 x3 )
0 1
I dx
3
0 1 0 2 0 3
x ( x x0 )( x x1 )( x x3 ) ( x x0 )( x x1 )( x x2 )
f ( x ) f ( x )
0
( x x )( x x )( x x ) 2
( x3 x0 )( x3 x1 )( x3 x2 )
3
2 0 2 1 2 3
3h ba
-> I f ( x0 ) 3 f ( x1 ) 3 f ( x2 ) f ( x3 ) h
8 3
(b a )5 ( 4 ) (b a )5 ( 4 )
Ea f (x ) f
6480 6480
f (4) is the average of the fourth derivative of f in the interval [a,b] 22
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Simpson 1/3 rule Simpson 3/8 rule
by Lale Yurttas, Texas Chapter 21 23
A&M University
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example:
Use the single application of Simpson’s 3/8 rule to numerically integrate
from a=0 to b=0.8. Recall that the exact value of this integration is 1.640533.
Find the exact and approximate errors.
0.8
Simpson 3/8 rule is slightly more accurate than Simpson 1/3 rule
Chapter 21 25
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Multiple Application Simpson’s 3/8 Rule
Odd-segment–Even-point
(b a)5 ( 4)
Ea 4
f (x ) n must be multiple of 3
80n
Chapter 21 26
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.