0% found this document useful (0 votes)
129 views9 pages

Simpson S Rules

Simpson's rule provides a more accurate way to estimate integrals than the trapezoidal rule by using higher-order polynomials. Simpson's 1/3 rule uses a second-order polynomial to connect three points, resulting in a formula that is the integral of the area under the parabola between those points. This formula divides the interval into three equal subintervals and weights the endpoint functions by 1 and the middle function by 4. Simpson's 1/3 rule is more accurate than the trapezoidal rule because it is a third-order Newton-Cotes formula.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views9 pages

Simpson S Rules

Simpson's rule provides a more accurate way to estimate integrals than the trapezoidal rule by using higher-order polynomials. Simpson's 1/3 rule uses a second-order polynomial to connect three points, resulting in a formula that is the integral of the area under the parabola between those points. This formula divides the interval into three equal subintervals and weights the endpoint functions by 1 and the middle function by 4. Simpson's 1/3 rule is more accurate than the trapezoidal rule because it is a third-order Newton-Cotes formula.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

21.

2 SIMPSON’S RULES 615

Finally, round-off errors can limit our ability to determine integrals. This is due both
to the machine precision as well as to the numerous computations involved in simple
techniques like the multiple-segment trapezoidal rule.
We now turn to one way in which efficiency is improved. That is, by using higher-
order polynomials to approximate the integral.

21.2 SIMPSON’S RULES


Aside from applying the trapezoidal rule with finer segmentation, another way to obtain
a more accurate estimate of an integral is to use higher-order polynomials to connect the
points. For example, if there is an extra point midway between f(a) and f(b), the three
points can be connected with a parabola (Fig. 21.10a). If there are two points equally
spaced between f(a) and f(b), the four points can be connected with a third-order poly-
nomial (Fig. 21.10b). The formulas that result from taking the integrals under these
polynomials are called Simpson’s rules.

21.2.1 Simpson’s 1/3 Rule


Simpson’s 1y3 rule results when a second-order interpolating polynomial is substituted
into Eq. (21.1):
b b
I5 #a
f(x) dx > #a
f2 (x) dx

If a and b are designated as x0 and x2 and f2(x) is represented by a second-order Lagrange


polynomial [Eq. (18.23)], the integral becomes
x2
c
(x 2 x1 )(x 2 x2 ) (x 2 x0 )(x 2 x2 )
I5 #x0
(x0 2 x1 )(x0 2 x2 )
f(x0 ) 1
(x1 2 x0 )(x1 2 x2 )
f(x1 )

f(x2 ) d dx
(x 2 x0 )(x 2 x1 )
1
(x2 2 x0 )(x2 2 x1 )

FIGURE 21.10
(a) Graphical depiction of f (x) f (x)
Simpson’s 1/3 rule: It consists
of taking the area under a
parabola connecting three
points. (b) Graphical depiction
of Simpson’s 3/8 rule: It
consists of taking the area under
a cubic equation connecting
four points.

x x
(a) (b)
616 NEWTON-COTES INTEGRATION FORMULAS

After integration and algebraic manipulation, the following formula results:


h
I> [ f(x0 ) 1 4 f(x1 ) 1 f(x2 )] (21.14)
3
where, for this case, h 5 (b 2 a)y2. This equation is known as Simpson’s 1y3 rule. It
is the second Newton-Cotes closed integration formula. The label “1y3” stems from the
fact that h is divided by 3 in Eq. (21.14). An alternative derivation is shown in Box 21.3
where the Newton-Gregory polynomial is integrated to obtain the same formula.
Simpson’s 1y3 rule can also be expressed using the format of Eq. (21.5):

f(x0 ) 1 4 f(x1 ) 1 f(x2 )


I > (b 2 a) (21.15)
6
Width Average height

Box 21.3 Derivation and Error Estimate of Simpson’s 1/3 Rule

As was done in Box 21.2 for the trapezoidal rule, Simpson’s 1y3 a2 a3 a2
rule can be derived by integrating the forward Newton-Gregory I 5 h c a f (x0 ) 1 ¢f (x0 ) 1 a 2 b ¢ 2 f (x0 )
2 6 4
interpolating polynomial (Box 18.2):
a4 a3 a2
x2
¢ 2 f (x0 ) 1a 2 1 b ¢ 3 f (x0 )
I5 # c f (x0 ) 1 ¢f (x0 )a 1 a(a 2 1) 24 6 6
2
a5 a4 11a3 a2 2
1a 2 b f (4) (j)h4 d
x0

¢ f (x0 ) 3 2 1
120 16 72 8 0
1 a(a 2 1) (a 2 2)
6 and evaluated for the limits to give
f (4) (j)
a(a 2 1) (a 2 2) (a 2 3)h4 d dx ¢ 2 f (x0 )
I 5 h c 2 f (x0 ) 1 2¢ f (x0 ) 1
1
24
3
Notice that we have written the polynomial up to the fourth-order
f (j)h4 d
1 (4)
term rather than the third-order term as would be expected. The 1 (0) ¢ 3 f (x0 ) 2 (B21.3.1)
reason for this will be apparent shortly. Also notice that the limits 90
of integration are from x0 to x2. Therefore, when the simplifying Notice the significant result that the coefficient of the third divided
substitutions are made (recall Box 21.2), the integral is from a 5 difference is zero. Because Df(x0) 5 f(x1) 2 f(x0) and D2f(x0) 5
0 to 2: f(x2) 2 2f(x1) 1 f(x0), Eq. (B21.3.1) can be rewritten as
2
¢ 2 f (x0 )
I5h # c f (x0 ) 1 ¢f (x0 )a 1 a(a 2 1) h 1 (4)
0
2 I5 [ f (x0 ) 1 4 f (x1 ) 1 f (x2 ) ] 2 f (j)h5
3 90
¢ 3 f (x0 ) Simpson’s 1y3 Truncation error
1 a(a 2 1) (a 2 2)
6
(4) Thus, the first term is Simpson’s 1y3 rule and the second is the
a(a 2 1) (a 2 2) (a 2 3)h4 d da
f (j)
1 truncation error. Because the third divided difference dropped
24
out, we obtain the significant result that the formula is third-order
which can be integrated to yield accurate.
21.2 SIMPSON’S RULES 617

where a 5 x0, b 5 x2, and x1 5 the point midway between a and b, which is given by
(b 1 a)y2. Notice that, according to Eq. (21.15), the middle point is weighted by two-
thirds and the two end points by one-sixth.
It can be shown that a single-segment application of Simpson’s 1y3 rule has a trun-
cation error of (Box 21.3)
1 5 (4)
Et 5 2 h f (j)
90
or, because h 5 (b 2 a)y2,

(b 2 a) 5 (4)
Et 5 2 f (j) (21.16)
2880

where j lies somewhere in the interval from a to b. Thus, Simpson’s 1Y3 rule is more
accurate than the trapezoidal rule. However, comparison with Eq. (21.6) indicates that it
is more accurate than expected. Rather than being proportional to the third derivative,
the error is proportional to the fourth derivative. This is because, as shown in Box 21.3,
the coefficient of the third-order term goes to zero during the integration of the interpo-
lating polynomial. Consequently, Simpson’s 1Y3 rule is third-order accurate even though
it is based on only three points. In other words, it yields exact results for cubic polyno-
mials even though it is derived from a parabola!

EXAMPLE 21.4 Single Application of Simpson’s 1/3 Rule


Problem Statement. Use Eq. (21.15) to integrate
f(x) 5 0.2 1 25x 2 200x2 1 675x3 2 900x4 1 400x5
from a 5 0 to b 5 0.8. Recall that the exact integral is 1.640533.
Solution.
f(0) 5 0.2  f(0.4) 5 2.456  f(0.8) 5 0.232
Therefore, Eq. (21.15) can be used to compute
0.2 1 4(2.456) 1 0.232
I > 0.8 5 1.367467
6
which represents an exact error of
Et 5 1.640533 2 1.367467 5 0.2730667  et 5 16.6%
which is approximately 5 times more accurate than for a single application of the trap-
ezoidal rule (Example 21.1).
The estimated error is [Eq . (21.16)]
(0.8) 5
Ea 5 2 (22400) 5 0.2730667
2880
where 22400 is the average fourth derivative for the interval as obtained using Eq. (PT6.4).
As was the case in Example 21.1, the error is approximate (Ea) because the average fourth
618 NEWTON-COTES INTEGRATION FORMULAS

derivative is not an exact estimate of f (4)(j). However, because this case deals with a fifth-
order polynomial, the result matches.

21.2.2 The Multiple-Application Simpson’s 1/3 Rule


Just as with the trapezoidal rule, Simpson’s rule can be improved by dividing the integra-
tion interval into a number of segments of equal width (Fig. 21.11):
b2a
h5 (21.17)
n
The total integral can be represented as
x2 x4 xn
I5 #x0
 
f(x) dx 1 #
x2
 
f(x) dx 1 p 1 #xn22
 
f(x) dx

Substituting Simpson’s 1y3 rule for the individual integral yields


f(x0 ) 1 4 f(x1 ) 1 f(x2 ) f(x2 ) 1 4 f(x3 ) 1 f(x4 )
I > 2h 1 2h
6 6
f(xn22 ) 1 4 f(xn21 ) 1 f(xn )
1 p 1 2h
6
or, combining terms and using Eq. (21.17),

n21 n22
f(x0 ) 1 4 a f(xi ) 1 2 a f(xj ) 1 f(xn )
i51, 3, 5 j52, 4, 6
I > (b 2 a)  (21.18)
3n
Width Average height

FIGURE 21.11
Graphical representation of f (x)
the multiple application of
Simpson’s 1y3 rule. Note that
the method can be employed
only if the number of segments
is even.

a b x
21.2 SIMPSON’S RULES 619

Notice that, as illustrated in Fig. 21.11, an even number of segments must be utilized to
implement the method. In addition, the coefficients “4” and “2” in Eq. (21.18) might
seem peculiar at first glance. However, they follow naturally from Simpson’s 1y3 rule.
The odd points represent the middle term for each application and hence carry the weight
of 4 from Eq. (21.15). The even points are common to adjacent applications and hence
are counted twice.
An error estimate for the multiple-application Simpson’s rule is obtained in the same
fashion as for the trapezoidal rule by summing the individual errors for the segments
and averaging the derivative to yield

(b 2 a) 5
Ea 5 2 f (4) (21.19)
180n4

where f (4) is the average fourth derivative for the interval.


 

EXAMPLE 21.5 Multiple-Application Version of Simpson’s 1y3 Rule


Problem Statement. Use Eq. (21.18) with n 5 4 to estimate the integral of
f(x) 5 0.2 1 25x 2 200x2 1 675x3 2 900x4 1 400x5
from a 5 0 to b 5 0.8. Recall that the exact integral is 1.640533.
Solution. n 5 4 (h 5 0.2):
f(0) 5 0.2 f(0.2) 5 1.288
f(0.4) 5 2.456 f(0.6) 5 3.464
f(0.8) 5 0.232
From Eq. (21.18),
0.2 1 4(1.288 1 3.464) 1 2(2.456) 1 0.232
I 5 0.8 5 1.623467
12
Et 5 1.640533 2 1.623467 5 0.017067  et 5 1.04%
The estimated error [Eq. (21.19)] is
(0.8) 5
Ea 5 2 (22400) 5 0.017067
180(4) 4

The previous example illustrates that the multiple-application version of Simp-


son’s 1y3 rule yields very accurate results. For this reason, it is considered superior
to the trapezoidal rule for most applications. However, as mentioned previously, it is
limited to cases where the values are equispaced. Further, it is limited to situations
where there are an even number of segments and an odd number of points. Conse-
quently, as discussed in the next section, an odd-segment–even-point formula known
620 NEWTON-COTES INTEGRATION FORMULAS

as Simpson’s 3y8 rule is used in conjunction with the 1y3 rule to permit evaluation
of both even and odd numbers of segments.

21.2.3 Simpson’s 3/8 Rule


In a similar manner to the derivation of the trapezoidal and Simpson’s 1y3 rule, a third-
order Lagrange polynomial can be fit to four points and integrated:
b b
I5 #a
 
f(x) dx > # f (x) dx
a
  3

to yield
3h
I> [ f(x0 ) 1 3 f(x1 ) 1 3 f(x2 ) 1 f(x3 )]
8
where h 5 (b 2 a)y3. This equation is called Simpson’s 3y8 rule because h is multiplied
by 3y8. It is the third Newton-Cotes closed integration formula. The 3y8 rule can also
be expressed in the form of Eq. (21.5):

f(x0 ) 1 3 f(x1 ) 1 3 f(x2 ) 1 f(x3 )


I > (b 2 a)  (21.20)
8
Width Average height

Thus, the two interior points are given weights of three-eighths, whereas the end points
are weighted with one-eighth. Simpson’s 3y8 rule has an error of
3 5 (4)
Et 5 2 h f (j)
 

80
or, because h 5 (b 2 a)y3,

(b 2 a) 5 (4)
Et 5 2 f (j)  (21.21)
6480

Because the denominator of Eq. (21.21) is larger than for Eq. (21.16), the 3y8 rule is
somewhat more accurate than the 1y3 rule.
Simpson’s 1y3 rule is usually the method of preference because it attains third-
order accuracy with three points rather than the four points required for the 3y8
version. However, the 3y8 rule has utility when the number of segments is odd. For
instance, in Example 21.5 we used Simpson’s rule to integrate the function for four
segments. Suppose that you desired an estimate for five segments. One option would
be to use a multiple-application version of the trapezoidal rule as was done in Ex-
amples 21.2 and 21.3. This may not be advisable, however, because of the large
truncation error associated with this method. An alternative would be to apply Simp-
son’s 1y3 rule to the first two segments and Simpson’s 3y8 rule to the last three
(Fig. 21.12). In this way, we could obtain an estimate with third-order accuracy
across the entire interval.
21.2 SIMPSON’S RULES 621

f (x)

FIGURE 21.12
Illustration of how Simpson’s
1y3 and 3y8 rules can be 0
0 0.2 0.4 0.6 0.8 x
applied in tandem to handle
multiple applications with odd 1/3 rule 3/8 rule
numbers of intervals.

EXAMPLE 21.6 Simpson’s 3y8 Rule


Problem Statement.
(a) Use Simpson’s 3y8 rule to integrate
f(x) 5 0.2 1 25x 2 200x2 1 675x3 2 900x4 1 400x5
from a 5 0 to b 5 0.8.
(b) Use it in conjunction with Simpson’s 1y3 rule to integrate the same function for five
segments.
Solution.
(a) A single application of Simpson’s 3y8 rule requires four equally spaced points:
f(0) 5 0.2 f(0.2667) 5 1.432724
f(0.5333) 5 3.487177 f(0.8) 5 0.232
Using Eq. (21.20),
0.2 1 3(1.432724 1 3.487177) 1 0.232
I > 0.8 5 1.519170
8
Et 5 1.640533 2 1.519170 5 0.1213630  et 5 7.4%
(0.8) 5
Ea 5 2 (22400) 5 0.1213630
6480
622 NEWTON-COTES INTEGRATION FORMULAS

(b) The data needed for a five-segment application (h 5 0.16) is


f(0) 5 0.2 f(0.16) 5 1.296919
f(0.32) 5 1.743393 f(0.48) 5 3.186015
f(0.64) 5 3.181929 f(0.80) 5 0.232
The integral for the first two segments is obtained using Simpson’s 1y3 rule:
0.2 1 4(1.296919) 1 1.743393
I > 0.32 5 0.3803237
6
For the last three segments, the 3y8 rule can be used to obtain
1.743393 1 3(3.186015 1 3.181929) 1 0.232
I > 0.48 5 1.264754
8
The total integral is computed by summing the two results:
I 5 0.3803237 1 1.264753 5 1.645077
Et 5 1.640533 2 1.645077 5 20.00454383  et 5 20.28%

21.2.4 Computer Algorithms for Simpson’s Rules


Pseudocodes for a number of forms of Simpson’s rule are outlined in Fig. 21.13. Note
that all are designed for data that are in tabulated form. A general program should have
the capability to evaluate known functions or equations as well. We will illustrate how
functions are handled in Chap. 22.
Notice that the program in Fig. 21.13d is set up so that either an even or odd num-
ber of segments may be used. For the even case, Simpson’s 1y3 rule is applied to each
pair of segments, and the results are summed to compute the total integral. For the odd
case, Simpson’s 3y8 rule is applied to the last three segments, and the 1y3 rule is applied
to all the previous segments.

21.2.5 Higher-Order Newton-Cotes Closed Formulas


As noted previously, the trapezoidal rule and both of Simpson’s rules are members of a
family of integrating equations known as the Newton-Cotes closed integration formulas.
Some of the formulas are summarized in Table 21.2 along with their truncation-error
estimates.
Notice that, as was the case with Simpson’s 1y3 and 3y8 rules, the five- and six-
point formulas have the same order error. This general characteristic holds for the higher-
point formulas and leads to the result that the even-segment–odd-point formulas (for
example, 1y3 rule and Boole’s rule) are usually the methods of preference.
However, it must also be stressed that, in engineering practice, the higher-order (that
is, greater than four-point) formulas are rarely used. Simpson’s rules are sufficient for
most applications. Accuracy can be improved by using the multiple-application version.
Furthermore, when the function is known and high accuracy is required, methods such
21.2 SIMPSON’S RULES 623

(a) (d )
FUNCTION Simp13 (h, f0, f1, f2) FUNCTION SimpInt(a,b,n,f)
Simp13 5 2*h* (f014*f11f2) / 6 h 5 (b 2 a) / n
END Simp13 IF n 5 1 THEN
(b) sum 5 Trap(h,fn21,fn)
FUNCTION Simp38 (h, f0, f1, f2, f3) ELSE
Simp38 5 3*h* (f013*(f11f2)1f3) / 8 m5 n
END Simp38 odd 5 n / 2 2 INT(n / 2)
IF odd . 0 AND n . 1 THEN
(c)
sum 5 sum1Simp38(h,fn23,fn22,fn21,fn)
FUNCTION Simp13m (h, n, f) m 5 n 23
sum 5 f(0) END IF
DOFOR i 5 1, n 2 2, 2 IF m . 1 THEN
sum 5 sum 1 4 * fi 1 2 * fi11 sum 5 sum 1 Simp13m(h,m,f)
END DO END IF
sum 5 sum 1 4 * fn21 1 fn END IF
Simp13m 5 h * sum / 3 SimpInt 5 sum
END Simp13m END SimpInt

FIGURE 21.13
Pseudocode for Simpson’s rules. (a) Single-application Simpson’s 1y3 rule, (b) single-
application Simpson’s 3y8 rule, (c) multiple-application Simpson’s 1y3 rule, and (d) multiple-
application Simpson’s rule for both odd and even number of segments. Note that for all cases,
n must be $1.

TABLE 21.2 Newton-Cotes closed integration formulas. The formulas are presented in the
format of Eq. (21.5) so that the weighting of the data points to estimate the
average height is apparent. The step size is given by h 5 (b 2 a)/n.

Segments
(n) Points Name Formula Truncation Error

f (x0 ) 1 f (x1 )
2 (1y12)h3f''(j)
   

1 2 Trapezoidal rule (b 2 a)
2

f (x0 ) 1 4f (x1 ) 1 f (x2 )


2 (1y90)h5f (4)(j)
     

2 3 Simpson’s 1/3 rule (b 2 a)


6

f (x0 ) 1 3f (x1 ) 1 3f (x2 ) 1 f (x3 )


2 (3y80)h5f (4)(j)
       

3 4 Simpson’s 3/8 rule (b 2 a)


8

7f (x0 ) 1 32f (x1 ) 1 12f (x2 ) 1 32f (x3 ) 1 7f (x4 )


2 (8y945)h7f (6)(j)
         

4 5 Boole’s rule (b 2 a)
90

19f (x0 ) 1 75f (x1 ) 1 50f (x2 ) 1 50f (x3 ) 1 75f (x4 ) 1 19f (x5 )
2 (275y12,096)h7f (6)(j)
           

5 6 (b 2 a)
288

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy