simpson’s 1/3 rd rule of - math for...
TRANSCRIPT
1/10/2010 http://numericalmethods.eng.usf.edu 1
Simpson’s 1/3rd Rule of Integration
Major: All Engineering Majors
Authors: Autar Kaw, Charlie Barker
http://numericalmethods.eng.usf.eduTransforming Numerical Methods Education for STEM
Undergraduates
Simpson’s 1/3rd Rule of Integration
http://numericalmethods.eng.usf.edu
http://numericalmethods.eng.usf.edu3
What is Integration?Integration
∫=b
adx)x(fI
The process of measuring the area under a curve.
Where:
f(x) is the integrand
a= lower limit of integration
b= upper limit of integration
f(x)
a b
y
x
∫b
a
dx)x(f
http://numericalmethods.eng.usf.edu4
Simpson’s 1/3rd Rule
http://numericalmethods.eng.usf.edu5
Basis of Simpson’s 1/3rd RuleTrapezoidal rule was based on approximating the integrand by a firstorder polynomial, and then integrating the polynomial in the interval ofintegration. Simpson’s 1/3rd rule is an extension of Trapezoidal rulewhere the integrand is approximated by a second order polynomial.
Hence
∫∫ ≈=b
a
b
adx)x(fdx)x(fI 2
Where is a second order polynomial. )x(f2
22102 xaxaa)x(f ++=
http://numericalmethods.eng.usf.edu6
Basis of Simpson’s 1/3rd Rule
Choose
)),a(f,a( ,baf,ba
++
22))b(f,b(and
as the three points of the function to evaluate a0, a1 and a2.
22102 aaaaa)a(f)a(f ++==
2
2102 2222
+
+
+
+=
+
=
+ baabaaabafbaf
22102 babaa)b(f)b(f ++==
http://numericalmethods.eng.usf.edu7
Basis of Simpson’s 1/3rd Rule
Solving the previous equations for a0, a1 and a2 give
22
22
0 22
4
baba
)a(fb)a(abfbaabf)b(abf)b(faa
+−
++
+
−+=
221 22
4332
4
baba
)b(bfbabf)a(bf)b(afbaaf)a(afa
+−
+
+
−++
+
−−=
222 22
22
baba
)b(fbaf)a(fa
+−
+
+
−=
http://numericalmethods.eng.usf.edu8
Basis of Simpson’s 1/3rd Rule
Then
∫≈b
adx)x(fI 2
( )∫ ++=b
adxxaxaa 2
210
b
a
xaxaxa
++=
32
3
2
2
10
32
33
2
22
10abaaba)ab(a −
+−
+−=
http://numericalmethods.eng.usf.edu9
Basis of Simpson’s 1/3rd Rule
Substituting values of a0, a1, a 2 give
+
+
+−
=∫ )b(fbaf)a(fabdx)x(fb
a 24
62
Since for Simpson’s 1/3rd Rule, the interval [a, b] is broken
into 2 segments, the segment width
2abh −
=
http://numericalmethods.eng.usf.edu10
Basis of Simpson’s 1/3rd Rule
+
+
+=∫ )b(fbaf)a(fhdx)x(fb
a 24
32
Hence
Because the above form has 1/3 in its formula, it is called Simpson’s 1/3rd Rule.
http://numericalmethods.eng.usf.edu11
Example 1
a) Use Simpson’s 1/3rd Rule to find the approximate value of x
The distance covered by a rocket from t=8 to t=30 is given by
∫
−
−=
30
889
21001400001400002000 dtt.
tlnx
b) Find the true error, tE
c) Find the absolute relative true error, t∈
http://numericalmethods.eng.usf.edu12
Solutiona)
∫=30
8
)( dttfx
+
+
+
−
= )b(fbaf)a(fabx2
46
[ ])(f)(f)(f 3019486
830++
−
=
[ ]6740901745548442667177622 .).(. ++
=
m.7211065=
http://numericalmethods.eng.usf.edu13
Solution (cont)
b) The exact value of the above integral is
∫
−
−=
30
889
21001400001400002000 dtt.
tlnx
m.3411061=
True Error
72110653411061 ..Et −=
m.384−=
http://numericalmethods.eng.usf.edu14
Solution (cont)a)c) Absolute relative true error,
%.
..t 100
341106172110653411061
×−
=∈
%.03960=
http://numericalmethods.eng.usf.edu15
Multiple Segment Simpson’s 1/3rd Rule
http://numericalmethods.eng.usf.edu16
Multiple Segment Simpson’s 1/3rd
Rule
Just like in multiple segment Trapezoidal Rule, one can subdivide the interval
[a, b] into n segments and apply Simpson’s 1/3rd Rule repeatedly over
every two segments. Note that n needs to be even. Divide interval
[a, b] into equal segments, hence the segment width
nabh −
= ∫∫ =nx
x
b
adx)x(fdx)x(f
0
where
ax =0 bxn =
http://numericalmethods.eng.usf.edu17
Multiple Segment Simpson’s 1/3rd
Rule
Apply Simpson’s 1/3rd Rule over each interval,
...)x(f)x(f)x(f)xx(dx)x(fb
a+
++
−=∫ 64 210
02
...)x(f)x(f)x(f)xx( +
++
−+6
4 43224
f(x)
. . .
x0 x2 xn-2 xn
x
.....dx)x(fdx)x(fdx)x(fx
x
x
x
b
a++= ∫∫∫
4
2
2
0
∫∫−
−
−
++n
n
n
n
x
x
x
xdx)x(fdx)x(f....
2
2
4
http://numericalmethods.eng.usf.edu18
Multiple Segment Simpson’s 1/3rd
Rule
...)x(f)x(f)x(f)xx(... nnnnn +
++
−+ −−−−− 6
4 23442
++
−+ −−− 6
4 122
)x(f)x(f)x(f)xx( nnnnn
Since
hxx ii 22 =− − n...,,,i 42=
http://numericalmethods.eng.usf.edu19
Multiple Segment Simpson’s 1/3rd
Rule
Then
...)x(f)x(f)x(fhdx)x(fb
a+
++
=∫ 642 210
...)x(f)x(f)x(fh +
++
+6
42 432
...)x(f)x(f)x(fh nnn +
++
+ −−−
642 234
++
+ −−
642 12 )x(f)x(f)x(fh nnn
http://numericalmethods.eng.usf.edu20
Multiple Segment Simpson’s 1/3rd
Rule
∫b
adx)x(f { }[ ]...)x(f...)x(f)x(f)x(fh
n +++++= −1310 43
{ } )}]()(...)()(2... 242 nn xfxfxfxf +++++ −
+++= ∑∑
−
==
−
==
)()(2)(4)(3
2
2
1
10 n
n
evenii
i
n
oddii
i xfxfxfxfh
+++
−= ∑∑
−
==
−
==
)()(2)(4)(3
2
2
1
10 n
n
evenii
i
n
oddii
i xfxfxfxfnab
a) Use four segment Simpson’s 1/3rd Rule to find the approximate value of x.
b) Find the true error, for part (a).c) Find the absolute relative true error, for part (a).
http://numericalmethods.eng.usf.edu21
Example 2Use 4-segment Simpson’s 1/3rd Rule to approximate the distance
tE
covered by a rocket from t= 8 to t=30 as given by
∫
−
−=
30
88.9
2100140000140000ln2000 dtt
tx
a∈
http://numericalmethods.eng.usf.edu22
SolutionUsing n segment Simpson’s 1/3rd Rule,
4830 −
=h 5.5=
So )8()( 0 ftf =
)5.58()( 1 += ftf )5.13(f=
a)
)5.55.13()( 2 += ftf )19(f=
)5.519()( 3 += ftf )5.24(f=
)( 4tf )30(f=
http://numericalmethods.eng.usf.edu23
Solution (cont.)
+++
−= ∑∑
−
==
−
==
)()(2)(4)(3
2
2
1
10 n
n
evenii
i
n
oddii
i tftftftfnabx
+++
−= ∑∑
==
==
2
2
3
1)30()(2)(4)8(
)4(3830
evenii
i
oddii
i ftftff
[ ])30()(2)(4)(4)8(1222
231 ftftftff ++++=
http://numericalmethods.eng.usf.edu24
Solution (cont.)
[ ])30()19(2)5.24(4)5.13(4)8(6
11 fffff ++++=
[ ]6740.901)7455.484(2)0501.676(4)2469.320(42667.1776
11++++=
m64.11061=
cont.
http://numericalmethods.eng.usf.edu25
Solution (cont.)
In this case, the true error is
64.1106134.11061 −=tE
b)
m30.0−=
The absolute relative true error
%10034.11061
64.1106134.11061×
−=∈t
c)
%0027.0=
http://numericalmethods.eng.usf.edu26
Solution (cont.)
Table 1: Values of Simpson’s 1/3rd Rule for Example 2 with multiple segments
n Approximate Value Et |Єt |
246810
11065.7211061.6411061.4011061.3511061.34
4.380.300.060.010.00
0.0396%0.0027%0.0005%0.0001%0.0000%
http://numericalmethods.eng.usf.edu27
Error in the Multiple Segment Simpson’s 1/3rd Rule
The true error in a single application of Simpson’s 1/3rd Rule is given as
bafabEt <ζ<ζ−
−= ),(2880
)( )4(5
In Multiple Segment Simpson’s 1/3rd Rule, the error is the sum of the errors
in each application of Simpson’s 1/3rd Rule. The error in n segment Simpson’s
1/3rd Rule is given by
)(f)xx(E )(1
45
021 2880
ζ−
−= ),(fh )(1
45
90ζ−=
)(f)xx(E )(2
45
242 2880
ζ−
−= ),(fh )(2
45
90ζ−=
210 xx <ζ<
422 xx <ζ<
http://numericalmethods.eng.usf.edu28
Error in the Multiple Segment Simpson’s 1/3rd Rule
)(f)xx(
E i)()i(i
i ζ−
−= − 45
122
2880 ),(fhi
)( ζ−= 45
90
ζ
−−=
−
−−
− 12
45
421
2 2880 n)(nn
n f)xx(E ,fhn
)(
ζ−=
−12
45
90
nnn xx, <ζ<−2
2
ζ−=
2
)4(5
90 nfh
.
.
.
ii)i( xx 212 <ζ<−
212
4 −−
− <ζ< nnn xx
ζ
−−= −
2
45
2
2 2880 nnn
n f)xx(E
http://numericalmethods.eng.usf.edu29
Error in the Multiple Segment Simpson’s 1/3rd Rule
Hence, the total error in Multiple Segment Simpson’s 1/3rd Rule is
∑=
=2
1
n
iit EE ∑
=ζ−=
2
1
)4(5
)(90
n
iifh ∑
=ζ
−−=
2
1
)4(5
5
)(90
)(n
iif
nab
n
f
nab
n
ii∑
=ζ−
−=
2
1
)4(
4
5 )(
90)(
http://numericalmethods.eng.usf.edu30
Error in the Multiple Segment Simpson’s 1/3rd Rule
The term n
fn
ii∑
=ζ
2
1
)4( )(is an approximate average value of
bxaxf <<),()4(
Hence )4(
4
5
90)( f
nabEt
−−=
where
n
ff
n
ii∑
=ζ
=
2
1
)4(
)4()(
Additional ResourcesFor all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit
http://numericalmethods.eng.usf.edu/topics/simpsons_13rd_rule.html