You are on page 1of 32

5/29/2012 http://numericalmethods.eng.usf.

edu 1
Simpsons 1/3
rd
Rule of
Integration

Major: All Engineering Majors

Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.edu
Transforming Numerical Methods Education for STEM
Undergraduates


Simpsons 1/3
rd
Rule of
Integration



http://numericalmethods.eng.usf.edu



http://numericalmethods.eng.usf.edu 3
What is Integration?
Integration
}
=
b
a
dx ) x ( f I
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.edu 4
Simpsons 1/3
rd
Rule


http://numericalmethods.eng.usf.edu 5
Basis of Simpsons 1/3
rd
Rule
Trapezoidal rule was based on approximating the integrand by a first
order polynomial, and then integrating the polynomial in the interval of
integration. Simpsons 1/3rd rule is an extension of Trapezoidal rule
where the integrand is approximated by a second order polynomial.
Hence
} }
~ =
b
a
b
a
dx ) x ( f dx ) x ( f I
2
Where is a second order polynomial.
) x ( f
2
2
2 1 0 2
x a x a a ) x ( f + + =

http://numericalmethods.eng.usf.edu 6
Basis of Simpsons 1/3
rd
Rule
Choose
)), a ( f , a ( ,
b a
f ,
b a
|
.
|

\
|
|
.
|

\
|
+ +
2 2
)) b ( f , b (
and
as the three points of the function to evaluate a
0
, a
1
and a
2
.
2
2 1 0 2
a a a a a ) a ( f ) a ( f + + = =
2
2 1 0 2
2 2 2 2
|
.
|

\
|
+
+
|
.
|

\
|
+
+ =
|
.
|

\
|
+
=
|
.
|

\
|
+ b a
a
b a
a a
b a
f
b a
f
2
2 1 0 2
b a b a a ) b ( f ) b ( f + + = =

http://numericalmethods.eng.usf.edu 7
Basis of Simpsons 1/3
rd
Rule
Solving the previous equations for a
0
, a
1
and a
2
give
2 2
2 2
0
2
2
4
b ab a
) a ( f b ) a ( abf
b a
abf ) b ( abf ) b ( f a
a
+
+ +
|
.
|

\
|
+
+
=
2 2
1
2
2
4 3 3
2
4
b ab a
) b ( bf
b a
bf ) a ( bf ) b ( af
b a
af ) a ( af
a
+
+
|
.
|

\
|
+
+ +
|
.
|

\
|
+

=
2 2
2
2
2
2 2
b ab a
) b ( f
b a
f ) a ( f
a
+
|
.
|

\
|
+
|
.
|

\
|
+

=

http://numericalmethods.eng.usf.edu 8
Basis of Simpsons 1/3
rd
Rule
Then
}
~
b
a
dx ) x ( f I
2
( )
}
+ + =
b
a
dx x a x a a
2
2 1 0
b
a
x
a
x
a x a
(

+ + =
3 2
3
2
2
1 0
3 2
3 3
2
2 2
1 0
a b
a
a b
a ) a b ( a

+

+ =

http://numericalmethods.eng.usf.edu 9
Basis of Simpsons 1/3
rd
Rule
Substituting values of a
0
, a
1
, a
2
give
(

+
|
.
|

\
|
+
+

=
}
) b ( f
b a
f ) a ( f
a b
dx ) x ( f
b
a
2
4
6
2
Since for Simpsons 1/3rd Rule, the interval [a, b] is broken
into 2 segments, the segment width
2
a b
h

=

http://numericalmethods.eng.usf.edu 10
Basis of Simpsons 1/3
rd
Rule
(

+
|
.
|

\
|
+
+ =
}
) b ( f
b a
f ) a ( f
h
dx ) x ( f
b
a
2
4
3
2
Hence
Because the above form has 1/3 in its formula, it is called Simpsons 1/3rd Rule.


http://numericalmethods.eng.usf.edu 11
Example 1
a) Use Simpsons 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
8
8 9
2100 140000
140000
2000 dt t .
t
ln x
b) Find the true error,
t
E
c) Find the absolute relative true error, t
e

http://numericalmethods.eng.usf.edu 12
Solution
a)
}
=
30
8
) ( dt t f x
(

+
|
.
|

\
|
+
+
|
.
|

\
|

= ) b ( f
b a
f ) a ( f
a b
x
2
4
6
| | ) ( f ) ( f ) ( f 30 19 4 8
6
8 30
+ +
|
.
|

\
|

=
| | 6740 901 7455 484 4 2667 177
6
22
. ) . ( . + +
|
.
|

\
|
=
m .72 11065 =

http://numericalmethods.eng.usf.edu 13
Solution (cont)
b) The exact value of the above integral is
}
|
.
|

\
|

(

=
30
8
8 9
2100 140000
140000
2000 dt t .
t
ln x
m .34 11061 =
True Error
72 11065 34 11061 . . E
t
=
m .38 4 =

http://numericalmethods.eng.usf.edu 14
Solution (cont)
a)c) Absolute relative true error,
%
.
. .
t
100
34 11061
72 11065 34 11061

= e
% .0396 0 =

http://numericalmethods.eng.usf.edu 15
Multiple Segment Simpsons
1/3rd Rule


http://numericalmethods.eng.usf.edu 16
Multiple Segment Simpsons 1/3
rd

Rule
Just like in multiple segment Trapezoidal Rule, one can subdivide the interval
[a, b] into n segments and apply Simpsons 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
n
a b
h

= } }
=
n
x
x
b
a
dx ) x ( f dx ) x ( f
0
where
a x =
0
b x
n
=

http://numericalmethods.eng.usf.edu 17
Multiple Segment Simpsons 1/3
rd

Rule
Apply Simpsons 1/3rd Rule over each interval,
...
) x ( f ) x ( f ) x ( f
) x x ( dx ) x ( f
b
a
+
(

+ +
=
}
6
4
2 1 0
0 2
...
) x ( f ) x ( f ) x ( f
) x x ( +
(

+ +
+
6
4
4 3 2
2 4
f(x)
. . .
x
0
x
2
x
n-2
x
n

x
..... dx ) x ( f dx ) x ( f dx ) x ( f
x
x
x
x
b
a
+ + =
} } }
4
2
2
0
} }

+ +
n
n
n
n
x
x
x
x
dx ) x ( f dx ) x ( f ....
2
2
4

http://numericalmethods.eng.usf.edu 18
Multiple Segment Simpsons 1/3
rd

Rule
...
) x ( f ) x ( f ) x ( f
) x x ( ...
n n n
n n
+
(

+ +
+


6
4
2 3 4
4 2
(

+ +
+

6
4
1 2
2
) x ( f ) x ( f ) x ( f
) x x (
n n n
n n
Since
h x x
i i
2
2
=

n ..., , , i 4 2 =

http://numericalmethods.eng.usf.edu 19
Multiple Segment Simpsons 1/3
rd

Rule
Then
...
) x ( f ) x ( f ) x ( f
h dx ) x ( f
b
a
+
(

+ +
=
}
6
4
2
2 1 0
...
) x ( f ) x ( f ) x ( f
h +
(

+ +
+
6
4
2
4 3 2
...
) x ( f ) x ( f ) x ( f
h
n n n
+
(

+ +
+

6
4
2
2 3 4
(

+ +
+

6
4
2
1 2
) x ( f ) x ( f ) x ( f
h
n n n

http://numericalmethods.eng.usf.edu 20
Multiple Segment Simpsons 1/3
rd

Rule
}
b
a
dx ) x ( f
{ } | | ... ) x ( f ... ) x ( f ) x ( f ) x ( f
h
n
+ + + + + =
1 3 1 0
4
3
{ } )}] ( ) ( ... ) ( ) ( 2 ...
2 4 2 n n
x f x f x f x f + + + + +

(
(

+ + + =


=
=

=
=
) ( ) ( 2 ) ( 4 ) (
3
2
2
1
1
0 n
n
even i
i
i
n
odd i
i
i
x f x f x f x f
h
(
(

+ + +

=


=
=

=
=
) ( ) ( 2 ) ( 4 ) (
3
2
2
1
1
0 n
n
even i
i
i
n
odd i
i
i
x f x f x f x f
n
a b
a) Use four segment Simpsons 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.edu 21
Example 2
Use 4-segment Simpsons 1/3rd Rule to approximate the distance
t
E
covered by a rocket from t= 8 to t=30 as given by
}
|
.
|

\
|

(

=
30
8
8 . 9
2100 140000
140000
ln 2000 dt t
t
x
a
e

http://numericalmethods.eng.usf.edu 22
Solution
Using n segment Simpsons 1/3rd Rule,
4
8 30
= h 5 . 5 =
So
) 8 ( ) (
0
f t f =
) 5 . 5 8 ( ) (
1
+ = f t f
) 5 . 13 ( f =
a)
) 5 . 5 5 . 13 ( ) (
2
+ = f t f
) 19 ( f =
) 5 . 5 19 ( ) (
3
+ = f t f
) 5 . 24 ( f =
) (
4
t f
) 30 ( f =

http://numericalmethods.eng.usf.edu 23
Solution (cont.)
(
(

+ + +

=


=
=

=
=
) ( ) ( 2 ) ( 4 ) (
3
2
2
1
1
0 n
n
even i
i
i
n
odd i
i
i
t f t f t f t f
n
a b
x
(
(

+ + +

=

=
=
=
=
2
2
3
1
) 30 ( ) ( 2 ) ( 4 ) 8 (
) 4 ( 3
8 30
even i
i
i
odd i
i
i
f t f t f f
| | ) 30 ( ) ( 2 ) ( 4 ) ( 4 ) 8 (
12
22
2 3 1
f t f t f t f f + + + + =

http://numericalmethods.eng.usf.edu 24
Solution (cont.)
| | ) 30 ( ) 19 ( 2 ) 5 . 24 ( 4 ) 5 . 13 ( 4 ) 8 (
6
11
f f f f f + + + + =
| | 6740 . 901 ) 7455 . 484 ( 2 ) 0501 . 676 ( 4 ) 2469 . 320 ( 4 2667 . 177
6
11
+ + + + =
m 64 . 11061 =
cont.

http://numericalmethods.eng.usf.edu 25
Solution (cont.)
In this case, the true error is
64 . 11061 34 . 11061 =
t
E
b)
m 30 . 0 =
The absolute relative true error
% 100
34 . 11061
64 . 11061 34 . 11061

= e
t
c)
% 0027 . 0 =

http://numericalmethods.eng.usf.edu 26
Solution (cont.)
Table 1: Values of Simpsons 1/3rd Rule for Example 2 with multiple segments
n Approximate Value E
t
|
t
|
2
4
6
8
10
11065.72
11061.64
11061.40
11061.35
11061.34
4.38
0.30
0.06
0.01
0.00
0.0396%
0.0027%
0.0005%
0.0001%
0.0000%

http://numericalmethods.eng.usf.edu 27
Error in the Multiple Segment
Simpsons 1/3
rd
Rule
The true error in a single application of Simpsons 1/3rd Rule is given as
b a f
a b
E
t
< , < ,

= ), (
2880
) (
) 4 (
5
In Multiple Segment Simpsons 1/3rd Rule, the error is the sum of the errors
in each application of Simpsons 1/3rd Rule. The error in n segment Simpsons
1/3rd Rule is given by
) ( f
) x x (
E
) (
1
4
5
0 2
1
2880
,

= ), ( f
h
) (
1
4
5
90
, =
) ( f
) x x (
E
) (
2
4
5
2 4
2
2880
,

= ), ( f
h
) (
2
4
5
90
, =
2 1 0
x x < , <
4 2 2
x x < , <

http://numericalmethods.eng.usf.edu 28
Error in the Multiple Segment
Simpsons 1/3
rd
Rule
) ( f
) x x (
E
i
) ( ) i ( i
i
,

=
4
5
1 2 2
2880
), ( f
h
i
) (
, =
4
5
90
|
|
.
|

\
|
,

=


1
2
4
5
4 2
1
2
2880
n
) (
n n
n
f
) x x (
E
, f
h
n
) (
|
|
.
|

\
|
, =
1
2
4
5
90
n n n
x x , < , <

2
2
|
|
.
|

\
|
, =
2
) 4 (
5
90
n
f
h
.
.
.
i i ) i (
x x
2 1 2
< , <

2
1
2
4

< , <
n n n
x x
|
|
.
|

\
|
,

=

2
4
5
2
2
2880
n
n n
n
f
) x x (
E

http://numericalmethods.eng.usf.edu 29
Error in the Multiple Segment
Simpsons 1/3
rd
Rule
Hence, the total error in Multiple Segment Simpsons 1/3rd Rule is

=
=
2
1
n
i
i t
E E

=
, =
2
1
) 4 (
5
) (
90
n
i
i
f
h

=
,

=
2
1
) 4 (
5
5
) (
90
) (
n
i
i
f
n
a b
n
f
n
a b
n
i
i

=
,

=
2
1
) 4 (
4
5
) (
90
) (

http://numericalmethods.eng.usf.edu 30
Error in the Multiple Segment
Simpsons 1/3
rd
Rule
The term
n
f
n
i
i

=
,
2
1
) 4 (
) (
is an approximate average value of
b x a x f < < ), (
) 4 (
Hence
) 4 (
4
5
90
) (
f
n
a b
E
t

=
where
n
f
f
n
i
i

=
,
=
2
1
) 4 (
) 4 (
) (
Additional Resources
For 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


THE END



http://numericalmethods.eng.usf.edu

You might also like