0% found this document useful (0 votes)
67 views

5.2.1 Simpson's Rule

Simpson's 1/3rd rule is an extension of the trapezoidal rule for numerical integration. It approximates the integrand as a quadratic polynomial over each interval, instead of a linear polynomial. This improves the accuracy compared to the trapezoidal rule. The document derives Simpson's rule, showing that it approximates an integral as the sum of the endpoints and weighted average of the midpoint, divided by 3. It can also be extended to multiple intervals by applying Simpson's rule repeatedly over each pair of intervals. An example applies Simpson's 1/3rd rule to calculate a definite integral and estimates the error compared to the true value.

Uploaded by

Kiran Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

5.2.1 Simpson's Rule

Simpson's 1/3rd rule is an extension of the trapezoidal rule for numerical integration. It approximates the integrand as a quadratic polynomial over each interval, instead of a linear polynomial. This improves the accuracy compared to the trapezoidal rule. The document derives Simpson's rule, showing that it approximates an integral as the sum of the endpoints and weighted average of the midpoint, divided by 3. It can also be extended to multiple intervals by applying Simpson's rule repeatedly over each pair of intervals. An example applies Simpson's 1/3rd rule to calculate a definite integral and estimates the error compared to the true value.

Uploaded by

Kiran Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 9

5.

Simpsons 1/3rd Rule

5.2.1 Simpsons Rule:


A wide variety of numerical methods have been developed to simplify the
integral. Here, we will discuss Simpsons 1/3rd Rule of integral approximation,
which improves upon the accuracy of the Trapezoidal 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
non-approximated by a second order polynomial.
5.2.2 Deriving Simpson's Rule
Hence
b

f ( x) dx

( x) dx

where f 2 ( x ) is a second order polynomial.


f 2 ( x) a 0 a1 x a 2 x 2

ab ab
, f

2
2

Choose (a, f ( a )),

, and (b, f (b)) as the three points of the

function to evaluate a 0 , a1 and a 2 .


f (a) f 2 (a) a0 a1 a a 2 a 2
ab
ab
ab
ab
f
f2
a 0 a1
a2

2
2
2
2

f (b) f 2 (b) a 0 a1b a 2 b 2

Solving the above three equations for unknowns, a 0 , a1 and a 2 give

Chapter 5

ab
2
abf (a) b f (a )
2
a0
2
a 2ab b 2
ab
ab
af (a ) 4af
3af (b) 3bf (a ) 4bf
bf (b)
2
2

a1
a 2 2ab b 2

ab
2 f (a) 2 f
f (b)
2

a2
2
2
a 2ab b
a 2 f (b) abf (b) 4abf

Then
b

( x) dx

a 0 a1 x a 2 x 2 dx
a

x2
x3
a 0 x a1
a2

2
3 a

b2 a2
b3 a 3
a 0 (b a ) a1
a2
2
3

Substituting values of a 0 , a1 and a 2 give


b

( x) dx

ba
ab
f (a) 4 f
f (b)

6
2

Since for Simpsons 1/3rd Rule, the interval a, b is broken into 2 segments, the
segment width
h

ba
2

Hence the Simpsons 1/3rd rule is given by


b

f ( x )dx 3

a b
f (b)
2

f (a ) 4 f

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

Simpsons Rule

Example 1:
Human vision has the remarkable ability to infer 3D shapes from 2D images. The
intriguing question is: can we replicate some of these abilities on a computer?
Yes, it can be done and to do this, integration of vector fields is required. The
following integral needs to integrated.
100

f ( x )dx
0

where
f(x) 0 , 0 x 30
9.1688 10 6 x 3 2.7961 10 3 x 2 2.8487 10 1 x 9.6778, 30 x 172
0, 172 x 200

a) Use Simpsons 1/3rd Rule to find the integration.


b) Find the true error, E t

Find the absolute relative true error,


Solution:

ba
ab
I
f (a) 4 f
f (b)
a)

6
2

c)

a0
b 100
ab
50
2

f(x) 0 , 0 x 30
9.1688 10 6 x 3 2.7961 10 3 x 2 2.8487 10 1 x 9.6778, 30 x 172
0, 172 x 200

f (0) 0
f (100) 9.1688 10 6 (100) 3 2.7961 10 3 (100) 2 2.8487 10 1 (100) 9.6778

0.017
f (50) 9.1688 10 6 (50) 3 2.7961 10 3 (50) 2 2.8487 10 1 (50) 9.6778

Chapter 5

1.2784

ba
ab
I
f (a ) 4 f
f (b)
6
2

100 0

f (0) 4 f (50) f (100)


6

100

0 4(1.2784) (0.017)
6
84.94667

b) The exact value of the above integral is found using Maple for calculating the
true error and relative true error.
100

f ( x)dx
0

60.7926

so the true error is


Et True Value Approximat e Value

60.7926 (84.94667)

24.1540

c) The absolute relative true error,


t

, would then be

True Error
100
True Value

60.7926 (84.94667)
100
60.7926

39.73%

5.2.3 Multiple Segment Simpsons 1/3rd 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

Simpsons Rule

two segments. Note that

n needs to be even. Divide interval a, b into n

equal segments, hence the segment width h


xn

ba
.
n

f ( x)dx

f ( x)dx

x0

where
x0 a
xn b
x2

f ( x)dx

f ( x)dx

x0

x4

f ( x)dx ......

x2

xn 2

xn 4

f ( x )dx

xn

f ( x)dx

xn 2

Apply Simpsons 1/3rd Rule over each interval,


b

f ( x )dx ( x

f ( x0 ) 4 f ( x1 ) f ( x 2 )
f ( x 2 ) 4 f ( x3 ) f ( x 4 )
( x4 x2 )

...
6
6

x0 )

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

6
6

( x n2 xn 4 )

Since
x i xi 2 2h
i 2, 4, ..., n

then
b

f ( x0 ) 4 f ( x1 ) f ( x 2 )
f ( x 2 ) 4 f ( x3 ) f ( x 4 )
2h

...
6
6

f ( x )dx 2h
a

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

6
6

2h

h
f ( x0 ) 4 f ( x1 ) f ( x3 ) ... f ( xn1 ) 2 f ( x2 ) f ( x4 ) ... f ( xn2 ) f ( x n )
3

Chapter 5

n 1
n2
n1
n 2
h
ba
f ( x0 ) 4 f ( xi ) 2 f ( xi ) f ( xn ) f ( x)dx f ( x0 ) 4 f ( xi ) 2 f ( xi ) f ( xn )
3

3n
i 1
i 2
i 1
i2
a
i odd
i even
i odd
i even

H.W: Draw a flow chart to calculate the integral of the function f(x) from a to b
using n equal intervals by Simpson Rule.
Example 2:
Human vision has the remarkable ability to infer 3D shapes from 2D images. The
intriguing question is: can we replicate some of these abilities on a computer?
Yes, it can be done and to do this, integration of vector fields is required. The
following integral needs to integrated.
100

f ( x )dx
0

where
f(x) 0 , 0 x 30
9.1688 10 6 x 3 2.7961 10 3 x 2 2.8487 10 1 x 9.6778, 30 x 172
0, 172 x 200

a) Use four segment Simpsons 1/3rd Rule to find the value of the integral.
b) Find the true error, Et for part (a).
c) Find the absolute relative true error for part (a).

Solution:
a) Using
I

n segment Simpsons 1/3rd Rule,

n 1
n 2
ba
f ( x 0 ) 4 f ( x i ) 2 f ( x i ) f ( x n )

3n
i 1
i 2
i odd
i even

n4
a0
b 100

Simpsons Rule

ba
n
100 0

25
f(x) 0 , 0 x 30
9.1688 10 6 x 3 2.7961 10 3 x 2 2.8487 10 1 x 9.6778, 30 x 172
0, 172 x 200

So
f ( x 0 ) f ( 0)
f (0) 0

f ( x1 ) f (0 25) f (25)
f ( 25) 0

f ( x 2 ) f (25 25) f (50)


f (50) 9.1688 10 6 (50) 3 2.7961 10 3 (50) 2 2.8487 10 1 (50) 9.6778

1.2784
f ( x3 ) f (50 25) f (75)
f (75) 9.1688 10 6 (75) 3 2.7961 10 3 (75) 2 2.8487 10 1 (75) 9.6778

0.17252
f ( x 4 ) f ( y n ) f ( 270)
f (100) 9.1688 10 6 (100) 3 2.7961 10 3 (100) 2 2.8487 10 1 (100) 9.6778

0.017

n 1
n 2
ba
f ( x 0 ) 4 f ( x i ) 2 f ( x i ) f ( x n )

3n
i 1
i 2

i odd
i even

Chapter 5

2
100 0 3
f (0) 4 f ( xi ) 2 f (xi ) f (100)

3(4)
i1
i2
iodd ieven

100
f (0) 4 f ( x1 ) 4 f ( x3 ) 2 f ( x 2 ) f (100)
12
25

f (0) 4 f (25) 4 f (75) 2 f (50) f (100)


3
25

0 4(0) 4(0.17252) 2(1.2784) (0.017)


3

26.91667

b) The exact value of the above integral is found using Maple for calculating the
true error and relative true error.
100

f ( x)dx
0

60.7926

so the true error is


Et True Value Approximat e Value

60.7926 (26.91667)

33.8759

c) The absolute relative true error,


t

, would then be

True Error
100
True Value

60.7926 ( 26.91667)
100
60.7926

55.723%

Table 1: Values of Simpsons 1/3rd Rule for Example 2 with multiple segments

Approximate Value

Et

84.94667

-24.154

39.731%

26.91667

33.875

55.723%

Simpsons Rule

66.6063

-5.8137

9.5632%

62.3177

-1.5251

2.5088%

You might also like