Sie sind auf Seite 1von 33

Part 6 NUMERICAL INTEGRATION MAT 575

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

Is it possible to approximate the area using a quadratic function,

y  ax 2  bx  c or a polynomial of higher order? Chapter 11 will discuss on


b
how to approximate a definite integral  f ( x ) dx using a polynomial of degree
a

two and degree three.

11.2 Simpson’s 1/3 Rule


b
Suppose that the area represented by  f ( x ) dx is divided by the ordinates
a

y 0 , y1, y 2 into two subintervals each of width h as shown in Figure 11.2. A


particular parabola can be found passing through the three points with the
given coordinates.

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

If y = ax 2 + bx + c is the parabola through the ordinates as shown, then


(x1 - h, y0 ), (x1, y1), (x1  h, y2 ) are on this parabola
i.e.

y0  a(x1 - h)2  b(x1 - h)  c (2)


y1  ax12  bx1  c (3)
y 2  a(x1  h)2  b(x1  h) (4)

167
Part 6 NUMERICAL INTEGRATION MAT 575

The area in Figure 11.2 is approximated with the quadratic function

y  ax 2  bx  c .

0 a b

Figure 11.3

   
x1  h
2
 ax  bx  c dx 
a
x1  h3  x1  h3  b x1  h2  x1  h2
x1  h 3 2
 cx1  h  x1  h
which simplifies to
x1 h
2
 ax  bx  c dx 
h
3
  
2a x1  h2  x1  hx1  h  x1  h2  3b2x1  6c 
x1 h

Then, using (2), (3) and (4) we find that


x1  h
2
 ax  bx  c dx 
h
y0  4y1  y2 
x1 h 3

From (1),
b h
 f ( x ) dx  (y0  4y1  y 2 )
a 3

This argument can be extended to another two subintervals also of width h.

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

Steps – Simpson’s 1/3 Rule


 Identify the interval; [a, b]
 Identify the function; f(x)
 Identify the step size or number of subintervals; h, n
 Apply the Simpson 1/3 rule
h 2k 2k - 2
S1/ 3  (y0  y 2k  4 ∑y 2r -1  ...  2 ∑y 2r )
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

 Identify the interval; [a, b]


[0, π]
 Identify the function; f(θ)

f ( )  sin
 Identify the step size or number of subintervals; h or n
ba
h
n
n4 and
 0 
 
4 4
 Apply the Simpson’s 1/3 rule

i i sin coef coef*yi


0 θ0 = 0 y0 = 0.0000 1 0.0000
1  y1 = 0.8409 4 3.3636
θ1 =
4
2 2 y2 = 1.0000 2 2.0000
θ2 =
4
3 3 y3 = 0.8409 4 3.3636
θ3 =
4
4 θ4 =  y4 = 0.0000 1 0.0000

 sin d  S1/ 3 2.2848
0

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

 Identify the interval; [a, b]


[0, 1]
 Identify function
1
f ( x) 
1  x2
 Identify the step size or number of subintervals; h or n
ba
h
n
n4 and
1 0
  0.25
4
(a) Apply the trapezoidal rule
coef x
x f(x) coef
f(x)
0.0000 1.0000 1 1.0000
0.2500 0.9412 2 1.8824
0.5000 0.8000 2 1.6000
0.7500 0.6400 2 1.2800
1.0000 0.5000 1 0.5000
6.2624

171
Part 6 NUMERICAL INTEGRATION MAT 575

 1  x 2 dx  2 f0  2f1  2f2  2f3  f4 


1 h
0


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

 1  x 2 dx  3 f0  4f1  2f2  4f3  f4 


1 h
0


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  42.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.

11.3 Error Analysis


Here we introduce discussions regarding the computation of error in using
b
Simpson 1/3 rule to approximate  f ( x ) dx .
a

Error in Simpson’s 1/3 Rule


b


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

Steps – Error Analysis


 Identify the interval; [a, b]
 Identify the given information; h, n
 Identify the function; f(x)
 Find the maximum of the fourth derivative;
f (4) (x)  M for a  x  b
 Compute the error;
(b  a)5
E  M
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
n4
 Identify the function

 1  x 1
1
f ( x) 
1 x

 Compute the fourth derivative; f ( 4) ( x )

f ( x )  1  x  f ( x )  61  x 


2 4

f x   21  x  f ( 4 ) x   241  x 


3 5

 Compute the maximum bound of the fourth derivative

for 0  x  1 f ( 4)(x)  24 or M  24

 Compute the error

(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

(b) Approximate the integral by applying Simpson’s 1/3 rule


x f(x) coef coef x f(x)
0.0000 1.0000 1 1.0000
0.2500 0.8000 4 3.2000
0.5000 0.6667 2 1.3333
0.7500 0.5714 4 2.2857
1.0000 0.5000 1 0.5000
8.3190

 1  x dx  12 8.3190 
1 1
0
 0.6933
Exact definite integral is
1 1
 dx  ln 2  0.6931
01 x

True absolute error  exact integral  approximat ed integral


 0.0002

(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

In order to achieve the required accuracy the number of subintervals


needed is

(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

for 0  x  1 f ( 4)(x)  54.3656 or M  54.3656

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

Error in Simpson’s 1/3 Rule (using average value of fourth derivative)


Similarly here we introduce an alternative approach of approximating the error
in Simpson’s 1/3 rule by using the average of the fourth derivative (as
opposed to using the maximum bound of the fourth derivative).

A single-segment application of Simpson’s 1/3 rule has an approximate


truncation error of
1 5 ( 4) ba
E h f () ; h 
90 2
An estimate for the local truncation error for the multiple-application (many
segments or subintervals) of the Simpson’s rule is given by

(b  a)5
E 4
f ( 4 ) ()
180n

where  lies somewhere in the interval from a to b and f ( 4) ( ) is the average


value of the fourth derivative.

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

and the error En is given by


(b  a)5 ( 4)
En   f ( )
180n4
for some point  in [a, b].

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.

Steps – Error Analysis


 Identify the interval; [a, b]
 Identify the given information; E , h, n
 Identify the function; f(x)
 Find the fourth derivative; f ( 4) ( x )
 Compute the average value of the fourth derivative;
b

f
( 4)
( x ) dx
f ( 4)
()  a
ba
 Compute the error;
(b  a)5 ( 4 )
E f ()
180n4

Here we repeat Example 4, Example 5 and Example 6 using the


alternative approach or error formula.

Example 4
If Simpson’s 1/3 rule with 4 subintervals is used to approximate the
1 1
integral  dx , determine:
01 x

(d) the estimated error.


(e) the true absolute error.
(f) the percentage error.

Solution

178
Part 6 NUMERICAL INTEGRATION MAT 575

(a)
 Identify the interval; [a, b]
[0, 1]
 Identify the given information
n4
 Identify the function

 1  x 1
1
f ( x) 
1 x

 Compute the fourth derivative; f ( 4) ( x )

f ( x )  1  x  f ( x )  61  x 


2 4

f x   21  x  f ( 4 ) x   241  x 


3 5

 Compute the average value of the fourth derivative


b

f
( 4)
( x ) dx
f ( 4)
()  a
ba
1

 241  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

The absolute error indicates that the approximation is accurate up to 3


decimal places.

179
Part 6 NUMERICAL INTEGRATION MAT 575

(b) Approximate the integral by applying Simpson’s 1/3 rule


x f(x) coef coef x f(x)
0.0000 1.0000 1 1.0000
0.2500 0.8000 4 3.2000
0.5000 0.6667 2 1.3333
0.7500 0.5714 4 2.2857
1.0000 0.5000 1 0.5000
8.3190

 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

Absolute error  exact  approximat e


 0.0002

(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
ba
4

 24x 
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

(i) Identify the interval and the step size.


( 4)
(ii) Determine f(x), f ''' ( x ) and f ( x ) .
(iii) Compute the approximated error.

182
Part 6 NUMERICAL INTEGRATION MAT 575

11.4 Simpson’s 3/8 rule


Simpson’s 3/8 rule is also known as 3/8 Newton-Cotes formula (or Newton-
Cotes for n=3). In Simpson’s 1/3 rule, we are supposed to divide a given
interval into even number of subintervals. Meanwhile, Simpson’s 3/8 rule
requires that the interval given be divided into three or multiple of three
subintervals i.e. number of subintervals = 3, 6, 7, 9, …, 3k (k = 1, 2, 3, …).
Thus, the number of ordinates needed is 3k + 1 (minimum 4). The formula for
Simpson’s 3/8 rule is given by

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 )

Steps – Simpson’s 3/8 Rule


 Identify the interval; [a, b]
 Identify the function; f(x)
 Identify the step size or number of subintervals; h, n
 Apply the Simpson’s 3/8 rule
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

 Identify the step size or number of subintervals


n3 and h  0.3
 Apply the Simpson 3/8 rule
0.9 3h
 f ( x ) dx  (y0  3y1  3y 2  y 3 )
0 8


3(0.3)
6.5107 
8
 0.7325

x f(x) coef coef*f(x)


0.0 1.0000 1 1.0000
0.3 0.9174 3 2.7523
0.6 0.7353 3 2.2059
0.9 0.5525 1 0.5525
6.5107

Example 8
1
x
Apply Simpson’s 3/8 rule to estimate e  cos 4x dx using six
0

subintervals.

Solution

The interval of the definite integral is [0, 1] with f ( x)  e  x  cos 4x .


Applying the Simpson’s 3/8 rule with 6 subintervals yields:

x f(x) coef coef*f(x)


0 2.0000 1 2.0000
1/6 1.6324 3 4.8971
1/3 0.9518 3 2.8553
1/2 0.1904 2 0.3808
2/3 -0.3759 3 -1.1277
5/6 -0.5471 3 -1.6412
1 -0.2858 1 -0.2858
7.0785

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

Approximate the volume of the tree trunk.

Solution
In calculus we learned that,
b
Volume   Area( x ) dx
a

In this case the area is given in tabulated values instead of an analytical


function. The interval is given from 0 to 120 meters. The volume of the
tree trunk can be approximated using Simpson’s 3/8 rule as below:

L A(L) coef coef*A(L)


0 120 1 120
20 124 3 372
40 128 3 384
60 130 2 260
80 132 3 396
100 136 3 408
120 144 1 144
2084

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.

11.5 Error Analysis

Here we introduce discussions regarding the computation of error in using


b
Simpson 3/8 rule to approximate  f ( x ) dx .
a

Error in Simpson’s 3/8 Rule


b


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

Steps – Error Analysis


 Identify the interval; [a, b]
 Identify the given information; h, n
 Identify the function; f(x)
 Find the maximum of the fourth derivative;
f (4) (x)  M for a  x  b
 Compute the error;
(b  a)5
E  M
80n 4

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

 Find the fourth derivative; f ( 4) ( x )

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

for 0.2  x  1.1 f ( 4)(x)  7500 or M  7500

 Compute the error

187
Part 6 NUMERICAL INTEGRATION MAT 575

(b  a) h 4 ba
E M , n
80 h


1  0.20.15 4 7500 
80


0.80.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

At least 6 subintervals are required (n must be a multiple of three).

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

 Identify the interval; [a, b]


[1, 4]
 Identify the given information; E
E  0.005

 Find the fourth derivative; f ( 4) ( x )

f ( x )  2x  1 f ( x )  12x  1


2 4

f x   4x  1 f ( 4 ) x   48x  1


3 5

 Compute the maximum of the fourth derivative

188
Part 6 NUMERICAL INTEGRATION MAT 575

for 1  x  4 f ( 4)(x)  1.5 or M  1.5

 Use the error formula

(b  a)5
M  0.005
80n 4
4  15 1.5  0.005
80n 4
n 4  911 .25
n  5.4943

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

Given x  0,1 , f ( x)  e  x  cos 4x and error of at most 0.5 x 10-4. Hence,

f ( x)  e  x  4 sin 4x f ( x)  e  x  16 cos 4x

f ( x)  e  x  64 sin 4x f ( 4) ( x)  e  x  cos 4x

for 0  x  1 f ( 4)(x)  257 or M  257

(b  a)5
M  0.00005
80n 4
1  05 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

f ( x)  e x sin x  e x cos x f ( x)  2e x cos x  2e x sin x

f ( x)  2e x cos x f ( 4) ( x)  2e x sin x


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.

Error in Simpson’s 3/8 Rule (using average value of fourth derivative)


Similarly here we introduce an alternative approach of approximating the error
in Simpson’s 3/8 rule by using the average of the fourth derivative (as
opposed to using the maximum bound of the fourth derivative).

A single-segment application of Simpson’s 3/8 rule has an approximate


truncation error of
3 5 ( 4) ba
E h f () , h
80 3
An estimate for the local truncation error for the multiple-application of the
Simpson’s 3/8 rule is given by

190
Part 6 NUMERICAL INTEGRATION MAT 575

(b  a)h 4 ( 4)
E f ()
80

where  lies somewhere in the interval from a to b and f ( 4) ( ) is the average


value of the fourth derivative.

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].

Steps – Error Analysis


 Identify the interval; [a, b]
 Identify the given information; E , h, n
 Find the fourth derivative; f ( 4) ( x )
 Compute the average value of the fourth derivative;
b

f
( 4)
( x ) dx
f ( 4 ) ()  a
ba
 Compute the approximated error;
(b  a)h 4 ( 4) (b  a)5
E f () or E 4
f ( 4 ) ()
80 80n

Here we repeat Example 13, Example 14, Example 15 and Example 16


using the alternative approach or error formula.

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

 Find the maximum of the fourth derivative; f 4 ( x )

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
ba
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.20.15 4  621.2434 
80


0.80.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.

(b) The number of subintervals


b  a 1.1  0.2
n  6
h 0.15
At least 6 subintervals are required (multiple of three).

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

 Identify the interval; [a, b]


[1, 4]
 Identify the given information; E
E  0.005

 Find the fourth derivatives; f ( 4) ( x )

f ( x )  2x  1 f ( x )  12x  1


2 4

f x   4x  1 f ( 4 ) x   48x  1


3 5

 Compute the average value of the fourth derivative

193
Part 6 NUMERICAL INTEGRATION MAT 575

f
( 4)
( x ) dx
f ( 4)
()  a
ba
4

 48x  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  15 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

Given x  0,1 , f ( x)  e  x  cos 4x and error of at most 0.5 x 10-4. Hence

f ( x)  e  x  4 sin 4x f ( x)  e  x  16 cos 4x

f ( x)  e  x  64 sin 4x f ( 4) ( x)  e  x  cos 4x


( 4)
f ( x)  47.8032

194
Part 6 NUMERICAL INTEGRATION MAT 575

(b  a)5
4
f ( 4 ) ( )  0.00005
80n
1  05 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   21
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

(i) Identify the interval and the step size.


( 4)
(ii) Determine f ( 4) ( x ) and f (x) .
(iii) Compute the approximated error.

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

2. The table indicates a relationship between two variables x and y.


x 1.2 1.3 1.4 1.5 1.6 1.7
y 1.94 2.19 2.46 2.75 3.06 3.39
1.7
Assume y = f(x) where f is continuous, and approximate  f ( x ) dx using the
1.2
Simpson’s 1/3 rule.

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

4. For the following definite integrals with n subintervals, approximate:


(a) the integral using Simpson’s 3/8 rule.
(b) the error.

2 1 1.6
x
(i)  dx ;n = 3 (iv)  xe dx ; n = 6
0 1  cos x 1

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

5. The arc length of the curve y = f(x) over the interval a  x  b is

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

6. Volume of Water in a Swimming Pool. A rectangular swimming pool is 30 ft


wide and 50 ft long. The table below shows the depth h(x) of the water at 5-ft
intervals from one end of the pool to the other. Estimate the volume of water
in the pool using Simpson’s 1/3 Rule with n=10, applied to the integral
50
V =  30  h( x )dx .
0

Position (ft) Depth (ft) Position(ft) Depth (ft)


x h(x) x h(x)_ __
0 6.0 30 11.5
5 8.2 35 11.9
10 9.1 40 12.3
15 9.9 45 12.7
20 10.5 50 13.0
25 11.0

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.

(a) What is the exact area of this region?


(b) What is the smallest n that results in the value of this estimate?

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

Das könnte Ihnen auch gefallen