You are on page 1of 17

Source URL: http://numericalmethods.eng.usf.

edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 1 of 17
Simpsons 1/3 Rule of Integration
Autar Kaw

After reading this chapter, you should be able to
1. derive the formula for Simpsons 1/3 rule of integration,
2. use Simpsons 1/3 rule it to solve integrals,
3. develop the formula for multiple-segment Simpsons 1/3 rule of integration,
4. use multiple-segment Simpsons 1/3 rule of integration to solve integrals, and
5. derive the true error formula for multiple-segment Simpsons 1/3 rule.

What is integration?
Integration is the process of measuring the area under a function plotted on a graph.
Why would we want to integrate a function? Among the most common examples are
finding the velocity of a body from an acceleration function, and displacement of a body
from a velocity function. Throughout many engineering fields, there are (what
sometimes seems like) countless applications for integral calculus. You can read about
some of these applications in Chapters 07.00A-07.00G.
Sometimes, the evaluation of expressions involving these integrals can become
daunting, if not indeterminate. For this reason, a wide variety of numerical methods has
been developed to simplify the integral. Here, we will discuss Simpsons 1/3 rule of
integral approximation, which improves upon the accuracy of the trapezoidal rule.
Here, we will discuss the Simpsons 1/3 rule of approximating integrals of the form
( )

=
b
a
dx x f I
where
) (x f is called the integrand,
= a lower limit of integration
= b upper limit of integration


Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 2 of 17
Simpsons 1/3 Rule
The trapezoidal rule was based on approximating the integrand by a first order
polynomial, and then integrating the polynomial over interval of integration. Simpsons
1/3 rule is an extension of Trapezoidal rule where the integrand is approximated by a
second order polynomial.


Figure 1 Integration of a function


Method 1:
Hence

=
b
a
b
a
dx x f dx x f I ) ( ) (
2

where ) (
2
x f is a second order polynomial given by
2
2 1 0 2
) ( x a x a a x f + + =
.
Choose
)), ( , ( a f a ,
2
,
2
|
|

\
|
|

\
| + + b a
f
b a
and )) ( , ( b f b

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 3 of 17
as the three points of the function to evaluate ,
0
a
1
a and
2
a .
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 + + = =

Solving the above three equations for unknowns, ,
0
a
1
a and
2
a 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
+
|
|

\
|
+ |

\
| +

=

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

+

+ =

Substituting values of ,
0
a
1
a and
2
a give

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 4 of 17
(

+ |

\
| +
+

) (
2
4 ) (
6
) (
2
b f
b a
f a f
a b
dx x f
b
a

Since for Simpson 1/3 rule, the interval | | b a, is broken into 2 segments, the segment
width
2
a b
h

=

Hence the Simpsons 1/3 rule is given by
(

+
|

\
| +
+

) (
2
4 ) (
3
) ( b f
b a
f a f
h
dx x f
b
a

Since the above form has 1/3 in its formula, it is called Simpsons 1/3 rule.

Method 2:
Simpsons 1/3 rule can also be derived by approximating ) (x f by a second order
polynomial using Newtons divided difference polynomial as
|

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

where
) (
0
a f b =

a
b a
a f
b a
f
b

+
|

\
| +
=
2
) (
2
1

a b
a
b a
a f
b a
f
b a
b
b a
f b f
b


+
|

\
| +

\
| +

=
2
) (
2
2
2
) (
2


Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 5 of 17
Integrating Newtons divided difference polynomial gives us




b
a
b
a
dx x f dx x f ) ( ) (
2


(

\
| +
+ + =
b
a
dx
b a
x a x b a x b b
2
) ( ) (
2 1 0


b
a
x b a a x b a x
b ax
x
b x b
(

|
|

\
| +
+
+
+
|
|

\
|
+ =
2
) (
4
) 3 (
3 2
2 3
2
2
1 0


|
|

\
| +
+
+

+
|
|

\
|

+ =
2
) )( (
4
) )( 3 (
3

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


Substituting values of ,
0
b ,
1
b and
2
b into this equation yields the same result as before
(

+
|

\
| +
+

) (
2
4 ) (
6
) ( b f
b a
f a f
a b
dx x f
b
a



(

+
|

\
| +
+ = ) (
2
4 ) (
3
b f
b a
f a f
h

Method 3:
One could even use the Lagrange polynomial to derive Simpsons formula. Notice any
method of three-point quadratic interpolation can be used to accomplish this task. In
this case, the interpolating function becomes

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 6 of 17

) (
2
) (
2
) (
2
2 2
) )( (
) (
) (
2
) (
2
) (
2
b f
b a
b a b
b a
x a x
b a
f
b
b a
a
b a
b x a x
a f
b a
b a
a
b x
b a
x
x f
|

\
| +

|

\
| +

+ |

\
| +
|

\
|

+
|

\
|

+

+

\
| +

\
| +

=

Integrating this function gets

b
a
b
a
b f
b a
b a b
x b a a x b a x
b a
f
b
b a
a
b a
abx
x b a x
a f
b a
b a
a
x b a b x b a x
dx x f
(
(
(
(
(
(
(
(
(
(

\
| +

+
+
+

+
|

\
| +
|

\
|

+
|

\
|

+
+
+

\
| +

+
+
+

) (
2
) (
2
) (
4
) 3 (
3
2
2 2
2
) (
3
) (
) (
2
2
) (
4
) 3 (
3
) (
2 3
2 3 2 3
2


) (
2
) (
2
) )( (
4
) )( 3 (
3
2
2 2
) (
2
) )( (
3
) (
) (
2
2
) )( (
4
) )( 3 (
3
2 2 3 3
2 2 3 3
2 2 3 3
b f
b a
b a b
a b b a a a b b a a b
b a
f
b
b a
a
b a
a b ab
a b b a a b
a f
b a
b a
a
a b b a b a b b a a b
|

\
| +

+
+
+

+
|

\
| +
|

\
|

+
|

\
|

+
+
+

+
|

\
| +

+
+
+

=

Believe it or not, simplifying and factoring this large expression yields you the same
result as before

(

+
|

\
| +
+

) (
2
4 ) (
6
) ( b f
b a
f a f
a b
dx x f
b
a



Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 7 of 17

(

+
|

\
| +
+ = ) (
2
4 ) (
3
b f
b a
f a f
h
.

Method 4:
Simpsons 1/3 rule can also be derived by the method of coefficients. Assume
) (
2
) ( ) (
3 2 1
b f c
b a
f c a f c dx x f
b
a
+
|

\
| +
+


Let the right-hand side be an exact expression for the integrals , 1

b
a
dx ,

b
a
xdx and

b
a
dx x
2
.
This implies that the right hand side will be exact expressions for integrals of any linear
combination of the three integrals for a general second order polynomial. Now
3 2 1
1 c c c a b dx
b
a
+ + = =


b c
b a
c a c
a b
xdx
b
a
3 2 1
2 2
2 2
+
+
+ =


2
3
2
2
2
1
3 3
2
2 3
b c
b a
c a c
a b
dx x
b
a
+ |

\
| +
+ =


Solving the above three equations for ,
0
c
1
c and
2
c give
6
1
a b
c

=

3
) ( 2
2
a b
c

=

6
3
a b
c

=

This gives

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 8 of 17
) (
6 2 3
) ( 2
) (
6
) ( b f
a b b a
f
a b
a f
a b
dx x f
b
a

+
|

\
| +
+

+
|

\
| +
+

= ) (
2
4 ) (
6
b f
b a
f a f
a b


(

+
|

\
| +
+ = ) (
2
4 ) (
3
b f
b a
f a f
h


The integral from the first method

+ +
b
a
b
a
dx x a x a a dx x f ) ( ) (
2
2 1 0

can be viewed as the area under the second order polynomial, while the equation from
Method 4
) (
6 2 3
) ( 2
) (
6
) ( b f
a b b a
f
a b
a f
a b
dx x f
b
a

+
|

\
| +
+


can be viewed as the sum of the areas of three rectangles.

Example 1
The distance covered by a rocket in meters from 8 = t s to 30 = t s is given by
|
|

\
|

(

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

a) Use Simpsons 1/3 rule to find the approximate value of x .
b) Find the true error,
t
E .
c) Find the absolute relative true error,
t
.
Solution
a)
(

+ |

\
| +
+

) (
2
4 ) (
6
b f
b a
f a f
a b
x

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 9 of 17

8 = a


30 = b


19
2
=
+ b a

t
t
t f 8 . 9
2100 140000
140000
ln 2000 ) (
(

=

s m f / 27 . 177 ) 8 ( 8 . 9
) 8 ( 2100 140000
140000
ln 2000 ) 8 ( =
(

=


s m f / 67 . 901 ) 30 ( 8 . 9
) 30 ( 2100 140000
140000
ln 2000 ) 30 ( =
(

=


s m f / 75 . 484 ) 19 ( 8 . 9
) 19 ( 2100 140000
140000
ln 2000 ) 19 ( =
|
|

\
|

=



(

+
|

\
| +
+

) (
2
4 ) (
6
b f
b a
f a f
a b
x

| | ) 30 ( ) 19 ( 4 ) 8 (
6
8 30
f f f + + |

\
|
=

| | 67 . 901 75 . 484 4 27 . 177
6
22
+ + =
=11065.72 m
b) The exact value of the above integral is

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 10 of 17
|
|

\
|

(

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

=11061.34 m
So the true error is
Value e Approximat Value True E
t
=

=11061.34-11065.72

m 38 . 4 =

c) Absolute Relative true error,
100
Value True
Error True
=
t

100
34 . 11061
38 . 4

=

% 0396 . 0 =


Multiple-segment Simpsons 1/3 Rule
Just like in multiple-segment trapezoidal rule, one can subdivide the interval | | b a, into n
segments and apply Simpsons 1/3 rule repeatedly over every two segments. Note that
n needs to be even. Divide interval | | b a, into n equal segments, so that the segment
width is given by

n
a b
h

= .
Now

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

where

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 11 of 17
a x =
0

b x
n
=


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

Apply Simpsons 1/3rd Rule over each interval,

...
6
) ( ) ( 4 ) (
) (
6
) ( ) ( 4 ) (
) ( ) (
4 3 2
2 4
2 1 0
0 2
+
(

+ +
+
(

+ +

x f x f x f
x x
x f x f x f
x x dx x f
b
a


(

+ +
+
(

+ +
+



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

Since

h x x
i i
2
2
=



n i ..., , 4 , 2 =

then
...
6
) ( ) ( 4 ) (
2
6
) ( ) ( 4 ) (
2 ) (
4 3 2 2 1 0
+
(

+ +
+
(

+ +

x f x f x f
h
x f x f x f
h dx x f
b
a


(

+ +
+
(

+ +
+

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


{ } { } | | ) ( ) ( ... ) ( ) ( 2 ) ( ... ) ( ) ( 4 ) (
3
2 4 2 1 3 1 0 n n n
x f x f x f x f x f x f x f x f
h
+ + + + + + + + + =



Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 12 of 17

(
(
(

+ + + =


=
=

=
=
) ( ) ( 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
b
a
x f x f x f x f
n
a b
dx x f


Example 2
Use 4-segment Simpsons 1/3 rule to approximate the distance covered by a rocket in
meters from 8 = t s to 30 = t s as given by
|
|

\
|

(

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

a) Use four segment Simpsons 1/3rd Rule to find the probability.
b) Find the true error,
t
E for part (a).
c) Find the absolute relative true error,
t
for part (a).
Solution:
a) Using n segment Simpsons 1/3 rule,
(
(
(

+ + +



=
=

=
=
) ( ) ( 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

4 = n

8 = a

30 = b

n
a b
h

=


4
8 30
=


Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 13 of 17

5 . 5 =

t
t
t f 8 . 9
2100 140000
140000
ln 2000 ) (
(

=


So
) 8 ( ) (
0
f t f =

s m f / 27 . 177 ) 8 ( 8 . 9
) 8 ( 2100 140000
140000
ln 2000 ) 8 ( =
(

=



) 5 . 13 ( ) 5 . 5 8 ( ) (
1
f f t f = + =



s m f / 25 . 320 ) 5 . 13 ( 8 . 9
) 5 . 13 ( 2100 140000
140000
ln 2000 ) 5 . 13 ( =
(

=



) 19 ( ) 5 . 5 5 . 13 ( ) (
2
f f t f = + =



s m f / 75 . 484 ) 19 ( 8 . 9
) 19 ( 2100 140000
140000
ln 2000 ) 19 ( =
|
|

\
|

=



) 5 . 24 ( ) 5 . 5 19 ( ) (
3
f f t f = + =



s m f / 05 . 676 ) 5 . 24 ( 8 . 9
) 5 . 24 ( 2100 140000
140000
ln 2000 ) 5 . 24 ( =
(

=



Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 14 of 17

) 30 ( ) ( ) (
4
f t f t f
n
= =



s m f / 67 . 901 ) 30 ( 8 . 9
) 30 ( 2100 140000
140000
ln 2000 ) 30 ( =
(

=



(
(
(

+ + +

=


=
=

=
=
) ( ) ( 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 + + + + =


| | ) 30 ( ) 19 ( 2 ) 5 . 24 ( 4 ) 5 . 13 ( 4 ) 8 (
6
11
f f f f f + + + + =


| | 67 . 901 ) 75 . 484 ( 2 ) 05 . 676 ( 4 ) 25 . 320 ( 4 27 . 177
6
11
+ + + + =


m 64 . 11061 =

b) The exact value of the above integral is
|
|

\
|

(

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

=11061.34 m
So the true error is

Value e Approximat Value True E
t
=


64 . 11061 34 . 11061 =
t
E


Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 15 of 17

m 30 . 0 =

c) Absolute Relative true error,
100
Value True
Error True
=
t

100
34 . 11061
3 . 0

=
= 0.0027%

Table 1 Values of Simpsons 1/3 rule for Example 2 with multiple-segments
n

Approximate
Value
t
E

t

2
4
6
8
10
11065.72
11061.64
11061.40
11061.35
11061.34
-4.38
-0.30
-0.06
-0.02
-0.01
0.0396%
0.0027%
0.0005%
0.0002%
0.0001%

Error in Multiple-segment Simpsons 1/3 rule
The true error in a single application of Simpsons 1/3rd Rule is given
1
by
b a f
a b
E
t
< <

= ), (
2880
) (
) 4 (
5

In multiple-segment Simpsons 1/3 rule, the error is the sum of the errors in each
application of Simpsons 1/3 rule. The error in the n segments Simpsons 1/3rd Rule is
given by

1
The f
(4)
in the true error expression stands for the fourth derivative of the function f(x).

Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 16 of 17
2 1 0 1
) 4 (
5
0 2
1
), (
2880
) (
x x f
x x
E < <

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

=

) (
90
2
) 4 (
5
f
h
=

:
i i i i
i i
i
x x f
x x
E
2 ) 1 ( 2
) 4 (
5
) 1 ( 2 2
), (
2880
) (
< <




) (
90
) 4 (
5
i
f
h
=

:
2
1
2
4
1
2
) 4 (
5
4 2
1
2
,
2880
) (

< <
|
|

\
|

=
n n n n
n n
n
x x f
x x
E


|
|

\
|
=
1
2
) 4 (
5
90
n
f
h



n n n n
n n
n
x x f
x x
E < <
|
|

\
|

2
2
2
) 4 (
5
2
2
,
2880
) (

Hence, the total error in the multiple-segment Simpsons 1/3 rule is

|
|

\
|
=
2
) 4 (
5
90
n
f
h

=
=
2
1
n
i
i t
E E


Source URL: http://numericalmethods.eng.usf.edu/
Saylor URL: http://www.saylor.org/courses/me205/

Attributed to: University of South Florida: Holistic Numerical Methods Institute Saylor.org
Page 17 of 17

=
=
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
) (


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 (
) (

You might also like