Beruflich Dokumente
Kultur Dokumente
Chapter 11
Simpson’s
Rule
At the end of this chapter, students should be able to:
State Simpson’s 1/3 and Simpson’s 3/8 rules
Identify and apply the Simpson’s 1/3 and Simpson’s 3/8 rules
Determine error involved in using the Simpson’s rules
11.1 Introduction
Notice that in Riemann sum the area under a curve is being approximated by
a constant function y c while trapezoidal rule uses a linear function
y ax b (Figure 11.1).
y y
y1 y1
y2 y0 y2
y0 y3 y3
y4
y4
h h h h h h h h
a b x a b x
Figure 11.1
166
Part 6 NUMERICAL INTEGRATION MAT 575
y = f(x)
0 a b
Figure 11.2
Simpson’s 1/3 rule uses the area under the parabola as an approximation for
the area under the curve y f (x ) . Thus,
b x1 h
f ( x) dx ax bx c dx
2
(1)
a x1 h
167
Part 6 NUMERICAL INTEGRATION MAT 575
y ax 2 bx c .
0 a b
Figure 11.3
x1 h
2
ax bx c dx
a
x1 h3 x1 h3 b x1 h2 x1 h2
x1 h 3 2
cx1 h x1 h
which simplifies to
x1 h
2
ax bx c dx
h
3
2a x1 h2 x1 hx1 h x1 h2 3b2x1 6c
x1 h
From (1),
b h
f ( x ) dx (y0 4y1 y 2 )
a 3
y = f(x)
0 a b
Figure 11.4
The area under the parabola through y 0 , y1, y 2 is
168
Part 6 NUMERICAL INTEGRATION MAT 575
h
(y + 4y1 + y 2 )
3 0
and the area under the parabola through y 2 , y 3 , y 4 is
h
(y + 4y 3 + y 4 )
3 2
Thus, with 5 ordinates (or 4 subintervals), Simpson’s 1/3 rule is
b h
f ( x ) dx (y0 4y1 2y 2 4y 3 y 4 ) .
a 3
0 a b
Figure 11.5
Similarly the formula can be extended to cover any even number of
subintervals (or any odd number of ordinates). Hence, Simpson’s 1/3 rule
with (2k + 1) ordinates is
b h
f ( x ) dx (y0 4y1 2y 2 4y 3 ... 2y 2k -2 4y 2k -1 y 2k )
a 3
Note that the use of Simpson’s 1/3 rule requires an even number of
subintervals or odd number of ordinates. For easy computation, the ordinates
used can be arranged in the following form,
b h 2k 2k -2
f ( x ) dx (y0 y 2k 4 ∑y2r -1 ... 2 ∑y2r )
a 3 r 1 r 1
169
Part 6 NUMERICAL INTEGRATION MAT 575
Example 1
Use Simpson’s 1/3 rule with five ordinates to find an approximate value for
sin d
0
x^2
Solution
10
5 x^2
0
1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3
f ( ) sin
Identify the step size or number of subintervals; h or n
ba
h
n
n4 and
0
4 4
Apply the Simpson’s 1/3 rule
170
Part 6 NUMERICAL INTEGRATION MAT 575
h
sin d
3
(y0 4y 1 2y 2 4y 3 y 4 )
0
8.7272
12
2.2848
Example 2
1 1
Estimate the integral dx to 4 decimal places using five ordinates
2
0 1 x
by applying:
(a) trapezoidal rule
(b) Simpson’s rule
Solution
171
Part 6 NUMERICAL INTEGRATION MAT 575
0.25
6.2624
2
0.7828
(b) Simpson’s 1/3 rule
x f(x) coef coef x f(x)
0.0000 1.0000 1 1.0000
0.2500 0.9412 4 3.7647
0.5000 0.8000 2 1.6000
0.7500 0.6400 4 2.5600
1.0000 0.5000 1 0.5000
9.4247
0.25
9.4247
3
0.7854
Note: The exact solution correct to 4 decimal places is 0.7854.
Example 3
The following points were found empirically.
x 2.1 2.4 2.7 3.0 3.3 3.6 3.9
y 2.5 2.8 3.0 3.3 3.6 3.9 4.1
3 .9
Use the Simpson’s 1/3 rule to estimate y dx .
2.1
Solution
Note that the interval is [2.1, 3.9] , the step size is h = 0.3 and the number
of ordinates are 7. Therefore,
3.9
y dx
0.3
2.5 42.8 3.3 3.9 2(3.0 3.6) 4.1
2.1
3
5.98
172
Part 6 NUMERICAL INTEGRATION MAT 575
Warm up exercise
1 2
Consider the definite integral dx and divide the interval into 6
0 1 cos x
subintervals.
(i) Identify the interval.
(ii) Identify the step size.
(iii) Identify the function.
(iv) Approximate the definite integral above using Simpson’s 1/3 rule with
7 ordinates.
Let I f ( x ) dx and S1/3 be the approximated integral using Simpson 1/3 rule
a
with n subintervals, then
(b a)5
I S1 / 3 M where f ( 4)(x) M for a x b
180n 4
173
Part 6 NUMERICAL INTEGRATION MAT 575
Example 4
1
1
If Simpson’s 1/3 rule with 4 subintervals is used to approximate 1 x dx ,
0
determine:
(a) the estimated error.
(b) the true absolute error.
(c) the percentage error.
Solution
(a)
Identify the interval; [a, b]
[0, 1]
Identify the given information
n4
Identify the function
1 x 1
1
f ( x)
1 x
for 0 x 1 f ( 4)(x) 24 or M 24
(b a)5
E M
180n 4
(1 0)5
24
180( 4) 4
0.5208 x10 3
The value of the error implies that the approximation is accurate up to 2
decimal places.
174
Part 6 NUMERICAL INTEGRATION MAT 575
1 x dx 12 8.3190
1 1
0
0.6933
Exact definite integral is
1 1
dx ln 2 0.6931
01 x
(c)
exact approximat e
% error
exact
0.0002
x100
0.6931
0.0289
Example 5
41
The approximation for the integral dx by Simpson’s 1/3 rule is
1x
accurate to within 0.005. How large must n be?
Solution
175
Part 6 NUMERICAL INTEGRATION MAT 575
The interval for the definite integral is [1, 4] and the approximated error is
1
at least 0.005 while the function is f ( x ) . Hence,
x
f ( x ) x 2 f ( x ) 6x 4
f ( x ) 2x 3 f ( 4 ) ( x ) 24 x 5
and,
for 0 x 1 f ( 4)(x) 24 or M 24
(b a)5
M 0.005
180n 4
( 4 1)5
n4 24
180(0.005 )
6480
n 8.9721
Since Simpson’s 1/3 rule requires even number of subintervals then at
least 10 subintervals are needed to obtain an accuracy of 0.005.
Example 6
1
If the Simpson’s 1/3 rule is to be used to compute e x dx with an error
2
0
-4
of at most 0.5 x 10 , how many points are needed?
Solution
Note that the estimated error is 0.5 x 10-4. To determine the number of
points needed, we begin by calculating the number of subintervals or n.
2
f ( x) e x
2
f ( x ) 2xe x
2 2
f ( x) 2e x 4x 2 e x
2 2
f ( x) 12xe x 8x 3 e x
176
Part 6 NUMERICAL INTEGRATION MAT 575
2 2 2
f ( 4) ( x) 12e x 48x 2e x 16 x 4 e x
(1 0)5
4
M 0.5 x10 4
180n
(1 0)5
4
(54.3656 ) 0.5 x10 4
180n
n 8.8160
Therefore at least 10 subintervals or 11 points are needed to obtain an
error of at most 0.5x10-4.
(b a)5
E 4
f ( 4 ) ()
180n
Theorem
Suppose that f iv ( x ) exists on [a,b]. Then for n a positive integer,
b
f ( x ) dx Sn En
a
where
h 2k 2k - 2
S1/ 3 f(x0 ) f(x2k ) 4 ∑ f(x2r -1) ... 2 ∑f(x2r )
3 r 1 r 1
177
Part 6 NUMERICAL INTEGRATION MAT 575
Notice that the exponent in the error term here is 4 (it was 2 for the trapezoid
rule). This tells us that for a fixed n, Simpson's 1/3 rule should give higher
accuracy of approximately twice as many decimal places correct.
f
( 4)
( x ) dx
f ( 4)
() a
ba
Compute the error;
(b a)5 ( 4 )
E f ()
180n4
Example 4
If Simpson’s 1/3 rule with 4 subintervals is used to approximate the
1 1
integral dx , determine:
01 x
Solution
178
Part 6 NUMERICAL INTEGRATION MAT 575
(a)
Identify the interval; [a, b]
[0, 1]
Identify the given information
n4
Identify the function
1 x 1
1
f ( x)
1 x
f
( 4)
( x ) dx
f ( 4)
() a
ba
1
241 x
5
dx
0
1
1
6
4
1 x 0
6
6 5.625
24
Compute the error
(b a)5
E f ( 4 ) ()
180n 4
(1 0)5
5.625
180( 4) 4
1.2207 x 10 4
0.1221 x 10 3
179
Part 6 NUMERICAL INTEGRATION MAT 575
1 x dx 12 8.3190
1 1
0
0.6933
Exact definite integral is
1
1
1 x dx ln 2 0.6931
0
(c)
exact approximat e
% error
exact
0.0002
x100
0.6931
0.0289
Example 5
41
The approximation for the integral dx by Simpson’s 1/3 rule is
1x
accurate to within 0.005. How large must n be?
Solution
180
Part 6 NUMERICAL INTEGRATION MAT 575
The interval for the definite integral is [1, 4] and the approximated error is
1
at least 0.005 while the function is f ( x ) . Hence,
x
f ( x ) x 2 f ( x ) 6x 4
f ( x ) 2x 3 f ( 4 ) ( x ) 24 x 5
and
b
f
( 4)
( x ) dx
f ( 4)
() a
ba
4
24x
5
dx
1
3
4
6
4
x 1
3
6
4
6
4
3
1.9922
In order to achieve the required accuracy the number of subintervals
needed is
(b a)5 ( 4 )
f () 0.005
180n 4
( 4 1)5
n4 1.9922
180(0.005 )
537 .85
n 4.8159
Since Simpson’s 1/3 rule requires even number of subintervals then at
least 6 subintervals are needed to obtain an accuracy of 0.005.
Example 6
1
If the Simpson’s 1/3 rule is to be used to compute e x dx with an error
2
0
of at most 0.5 x 10-4, how many points are needed?
Solution
181
Part 6 NUMERICAL INTEGRATION MAT 575
2
Note that the interval for the definite integral f ( x ) e x is [0, 1] and the
estimated error is 0.5 x 10-4. To determine the number of points needed,
let’s do the error analysis.
2 2 2
f ( x) 2xe x f ( x) 2e x 4x 2 e x
2 2 2 2 2
f ( x) 12xe x 8x 3 e x f ( 4) ( x) 12e x 48x 2e x 16 x 4 e x
So,
1
f ( 4 ) () 12 xe x 8 x 3 e x
2 2
0
12e 1 8e 1 0
1.4715
(1 0)5 ( 4 )
f ( ) 0.5 x 10 4
4
180n
n 4 163 .5
n 3.5759
Therefore at least 4 subintervals or 5 points are needed to obtain an
error of at most 0.5 x 10-4.
Warm up exercise
3
Assume ln x dx is being estimated by Simpson’s 1/3 rule with 5 ordinates.
1
182
Part 6 NUMERICAL INTEGRATION MAT 575
b 3h
f ( x ) dx (y0 3y1 3y 2 2y 3 3y 4 3y 5 2y 6
a 8
... 2y 3k -3 3y 3k -2 3y 3k -1 y3k )
Example 7
0.9 1
Estimate dx to 4 decimal places using Simpson’s 3/8 with 4
0 1 x2
ordinates.
Solution
Identify the interval
[0, 0.9]
Identify the function
1
f ( x)
1 x2
183
Part 6 NUMERICAL INTEGRATION MAT 575
3(0.3)
6.5107
8
0.7325
Example 8
1
x
Apply Simpson’s 3/8 rule to estimate e cos 4x dx using six
0
subintervals.
Solution
184
Part 6 NUMERICAL INTEGRATION MAT 575
1
3h
e
x
cos 4 x dx (y0 3y 1 3y 2 2y 3 3y 4 3y 5 y 6 )
8
0
1
3
7.0785
6
8
0.4424
Example 9
A tree trunk is 120 meter long. At a distance x meter from one end, its
sectional area A is given in square meter by the following table at intervals
of 20 meters:
L 0 20 40 60 80 100 120
A 120 124 128 130 132 136 144
Solution
In calculus we learned that,
b
Volume Area( x ) dx
a
185
Part 6 NUMERICAL INTEGRATION MAT 575
120
Volume Area(L ) dL
0
3(20 )
2084 15630 m3
8
Warm up exercise
1 2
Consider the definite integral dx and divide the interval into 6
0 1 cos x
subintervals.
(i) Identify the interval.
(ii) Identify the step size.
(iii) Identify the function.
(iv) Approximate the definite integral above using Simpson’s 1/3 rule with
7 ordinates.
Let I f ( x ) dx and S3/8 be the approximated integral using Simpson 3/8 rule
a
with n subintervals, then
(b a)5
I S3 / 8 4
M where f ( 4)(x) M for a x b
80n
186
Part 6 NUMERICAL INTEGRATION MAT 575
Example 13
1.1
If Simpson’s 3/8 rule is to be used to compute 2 ln x x dx with step size
0.2
h = 0.15, determine:
(a) the estimated error.
(b) the estimated subintervals used.
Solution
(a)
Identify the interval; [a, b]
[0.2, 1.1]
Identify the given information; h
h 0.15
2 4
f ( x ) 1 f ( x )
x x3
2 12
f x f ( 4 ) x 4
x2 x
Compute the maximum bound of the fourth derivative
187
Part 6 NUMERICAL INTEGRATION MAT 575
(b a) h 4 ba
E M , n
80 h
1 0.20.15 4 7500
80
0.80.15 4 7500
80
0.0380
0.3 80 x10 1
Hence, it can be concluded that with h = 0.15, Simpson’s 3/8 rule is
accurate up to one decimal places.
(b)
b a 1.1 0.2
n 6
h 0.15
Example 14
Find the minimum number of ordinates needed in order for the
4 2
approximation of the integral dx by Simpson’s 3/8 accurate to within
1 x 1
0.005.
Solution
188
Part 6 NUMERICAL INTEGRATION MAT 575
(b a)5
M 0.005
80n 4
4 15 1.5 0.005
80n 4
n 4 911 .25
n 5.4943
Example 15
1
If the Simpson’s 3/8 rule is to be used to compute e x cos 4x dx with
0
an error of at most 0.5 x 10-4, how many subintervals are needed?
Solution
(b a)5
M 0.00005
80n 4
1 05 257 0.00005
80n 4
n 15.9209
In order to have an error of at most 0.5 x 10-4, 18 subintervals are
required.
189
Part 6 NUMERICAL INTEGRATION MAT 575
Example 16
Find the minimum number of ordinates needed in order for the
3
approximation of the integral e x sin x dx by Simpson’s 3/8 accurate to
0
within 0.005.
Solution
Given x 0, , f ( x) ex sin x and approximated error is 0.005. Hence,
3
for 0 x f ( 4)(x) 0.8715 or M 9.8715
3
(b a)5
M 0.005
80n 4
3 0 9.8715 0.005
5
80n 4
n 2.3611
Therefore, at least 3 subintervals are needed.
190
Part 6 NUMERICAL INTEGRATION MAT 575
(b a)h 4 ( 4)
E f ()
80
Theorem
Suppose that f ( 4) ( x ) exists on [a,b]. Then for n a positive integer,
b
f ( x ) dx Sn En
a
where
3h
S3 / 8 (y0 3y1 3y 2 2y 3 3y 4 3y 5 2y 6
8
... 2y 3k -3 3y 3k -2 3y 3k -1 y3k )
and the error En is given by
(b a)h 4 ( 4)
E f ()
80
for some point in [a, b].
f
( 4)
( x ) dx
f ( 4 ) () a
ba
Compute the approximated error;
(b a)h 4 ( 4) (b a)5
E f () or E 4
f ( 4 ) ()
80 80n
191
Part 6 NUMERICAL INTEGRATION MAT 575
Example 13
1.1
If Simpson’s 3/8 rule is to be used to compute 2 ln x x dx with step size
0.2
h = 0.15, determine:
(a) the estimated error.
(b) the estimated subintervals needed.
Solution
(a)
Identify the interval; [a, b]
[0.2, 1.1]
Identify the given information; h
h 0.15
2 4
f ( x ) 1 f ( x )
x x3
2 12
f x f ( 4 ) x 4
x2 x
Compute the average value of the fourth derivative
b
f
( 4)
( x ) dx
f ( 4)
() a
ba
1 .1
12
x4
dx
0 .2
1 0 .2
1.1
1 4
0.8 x 3 0.2
621 .2434
Compute the error
192
Part 6 NUMERICAL INTEGRATION MAT 575
(b a)h 4 ( 4 )
E f ()
80
1 0.20.15 4 621.2434
80
0.80.15 4 621.2434
80
0.02516
0.2516 x10 1
Hence, it can be concluded that with h = 0.15, Simpson’s 3/8 rule is
accurate up to one decimal places.
Example 14
Find the minimum number of ordinates needed in order for the
4 2
approximation of the integral dx by Simpson’s 3/8 accurate to within
1 x 1
0.005.
Solution
193
Part 6 NUMERICAL INTEGRATION MAT 575
f
( 4)
( x ) dx
f ( 4)
() a
ba
4
48x 1
5
dx
1
4 1
4
12
4
x 1 1
0.7308
Use the error formula
(b a)5
4
f ( 4 ) ( ) 0.005
80n
4 15 0.7308 0.005
80n 4
n 4 443 .961
n 4.5902
Hence, at least 6 subintervals or 7 ordinates are needed to satisfy the
required accuracy.
Example 15
1
If the Simpson’s 3/8 rule is to be used to compute e x cos 4x dx with
0
an error of at most 0.5 x 10-4, how many subintervals are needed?
Solution
194
Part 6 NUMERICAL INTEGRATION MAT 575
(b a)5
4
f ( 4 ) ( ) 0.00005
80n
1 05 47.8032 0.00005
80n 4
n 10.4556
In order to have an error of at most 0.5 x 10-4, at least 12 subintervals are
required.
Example 16
Find the minimum number of ordinates needed in order for the
3
approximation of the integral e x sin x dx by Simpson’s 3/8 accurate to
0
within 0.005.
Solution
Given x 0, , f ( x) ex sin x and approximated error is 0.005. Hence
3
f
( 4)
( x)
3 2e x cos x 2e x sin x 03
2e 3 cos sin 21
3
3 3
3.9019
(b a)5
4
f ( 4 ) ( ) 0.005
80n
5
3.9019
3 0.005
80n 4
n 1.8721
Therefore, at least 3 subintervals are needed.
195
Part 6 NUMERICAL INTEGRATION MAT 575
3
Warm up exercise
Assume ln x dx is being estimated by Simpson’s 3/8 rule with 6 subintervals.
1
Exercise 11
1. Use the Simpson’s 1/3 rule to estimate the following definite integral with n
subintervals.
2 1 1.6
x
(i) dx ; n = 4 (d) xe dx ;n=6
0 1 cos x 1
20 x 3
(ii) dx ; n = 10 (e) 2 ln x dx ; n =8
0 5 1
sin t 2
(iii) dt ;n=8 (f) 2x cos x dx ; n = 10
t 0
3. Refer question (1) and use the error estimate formula to approximate the
error if the given integral is approximated by Simpson’s 1/3 rule with the given
subintervals, n.
196
Part 6 NUMERICAL INTEGRATION MAT 575
18 x 3
(ii) dx ;n=9 (v) 2 ln x dx ; n = 6
0 5 1
sin t 2
(iii) dt ;n=9 (vi) 2x cos x dx ; n = 12
t 0
b
length 1 ( f ' ( x ))2 dx
a
(a) Approximate the arc length of each function using Simpson’s 1/3 rule with
n = 10.
(b) Approximate the error.
(c) How many ordinates are needed to estimate the integral with an accuracy
of 0.5 x 10 3 .
(i) f ( x) x3 for 0 x 1
(ii) f ( x ) sin 2x for 0 x
8
2x
(iii) f ( x) e for 0 x 0.5
197
Part 6 NUMERICAL INTEGRATION MAT 575
7. Use the Simpson’s 3/8 rule with n = 6 to estimate the area of the region under
the curve m( t ) 50 2t 2 and above the t-axis.
8. Stocking a Fish Pond. As the fish and game warden of your township, you are
responsible for stocking the town pond with fish before the fishing season.
The average depth of the pond is 20 feet. Using the scaled map, you
measure distances across the pond at 225-foot intervals, as shown in the
diagram.
(a) Use the Simpson’s 3/8 Rule to estimate the volume of the pond.
(b) You plan to start the season with one fish per 100 cubic feet. You intend to
have at least 25% of the opening day’ fish population left at the end of the
season. What is the maximum number of licenses the town can sell if the
average seasonal catch is 20 fish per license?
0 ft
860 ft
520 ft
800 ft
1000 ft
1140 ft
1160 ft
1110 ft
860 ft
0 ft
198