Simpson 3/8 Rule For Integration

Transcription

Chapter 07.08Simpson 3/8 Rule for IntegrationAfter reading this chapter, you should be able to1. derive the formula for Simpson’s 3/8 rule of integration,2. use Simpson’s 3/8 rule it to solve integrals,3. develop the formula for multiple-segment Simpson’s 3/8 rule of integration,4. use multiple-segment Simpson’s 3/8 rule of integration to solve integrals,5. compare true error formulas for multiple-segment Simpson’s 1/3 rule and multiplesegment Simpson’s 3/8 rule, and6. use a combination of Simpson’s 1/3 rule and Simpson’s 3/8 rule to approximateintegrals.IntroductionThe main objective of this chapter is to develop appropriate formulas for approximating theintegral of the formI b f ( x)dx(1)aMost (if not all) of the developed formulas for integration are based on a simple concept ofapproximating a given function f (x) by a simpler function (usually a polynomial function)f i (x) , where i represents the order of the polynomial function. In Chapter 07.03, Simpsons1/3 rule for integration was derived by approximating the integrand f (x) with a 2nd order(quadratic) polynomial function. f 2 ( x )f 2 ( x) a 0 a1 x a 2 x 207.08.1(2)

07.08.2Chapter 07.08 Figure 1 f ( x) Cubic function.In a similar fashion, Simpson 3/8 rule for integration can be derived by approximating thegiven function f (x) with the 3rd order (cubic) polynomial f 3 ( x )f 3 ( x ) a0 a1 x a 2 x 2 a3 x 3 a0 a (3) 123 {1, x, x , x } a 2 a 3 which can also be symbolically represented in Figure 1.Method 1The unknown coefficients a0 , a1 , a 2 and a3 in Equation (3) can be obtained by substituting 4known coordinate data points {x0 , f ( x0 )}, {x1 , f ( x1 )}, {x2 , f ( x2 )} and {x3 , f ( x3 )}Equation (3) as follows.f ( x0 ) a 0 a1 x0 a 2 x02 a3 x02 f ( x1 ) a 0 a1 x1 a 2 x12 a3 x12 f ( x 2 ) a 0 a1 x 2 a 2 x 22 a3 x 22 f ( x3 ) a 0 a1 x3 a 2 x32 a3 x32 Equation (4) can be expressed in matrix notation asinto(4)

Simpson 3/8 Rule for Integration07.08.3 1 x0 x02 x03 a 0 f ( x0 ) 23 1 x1 x1 x1 a1 f ( x1 ) (5) 1 x 2 x 22 x 23 a 2 f ( x 2 ) 23 1 x3 x3 x3 a3 f ( x3 ) The above Equation (5) can symbolically be represented as (6)[A]4 4 a 4 1 f 4 1Thus, a1 a 1a 2 [A] f(7) a3 a 4 Substituting Equation (7) into Equation (3), one gets 1(8)f 3 ( x ) 1, x, x 2 , x 3 [A] fAs indicated in Figure 1, one hasx0 a x1 a h b a a 3 2a b 3 x 2 a 2h (9)2b 2a a 3 a 2b 3 x3 a 3h 3b 3a a 3 b With the help from MATLAB [Ref. 2], the unknown vector a (shown in Equation 7) can besolved for symbolically.{}Method 2Using Lagrange interpolation, the cubic polynomial function f 3 ( x ) that passes through 4data points (see Figure 1) can be explicitly given as

07.08.4Chapter 07.08(x x1 )(x x2 )(x x3 )(x x0 )(x x2 )(x x3 ) f ( x1 ) f (x0 ) (x0 x1 )(x0 x2 )(x0 x3 )(x1 x0 )(x1 x2 )(x1 x3 )(x x0 )(x x1 )(x x3 )(x x0 )(x x1 )(x x2 ) f ( x3 ) f ( x3 ) (x2 x0 )(x2 x1 )(x2 x3 )(x3 x0 )(x3 x1 )(x3 x2 )f 3 (x ) (10)Simpsons 3/8 Rule for IntegrationSubstituting the form of f 3 ( x ) from Method (1) or Method (2),bI f ( x )dxab f 3 ( x )dxa (b a ) Since{ f (x0 ) 3 f (x1 ) 3 f (x2 ) f (x3 )}8(11)b a3b a 3hand Equation (11) becomes3h(12)I { f ( x0 ) 3 f ( x1 ) 3 f ( x 2 ) f ( x3 )}8Note the 3/8 in the formula, and hence the name of method as the Simpson’s 3/8 rule.The true error in Simpson 3/8 rule can be derived as [Ref. 1](b a ) 5(13) f ′′′′(ζ ) , where a ζ bEt 6480Example 1The vertical distance in meters covered by a rocket from t 8 to t 30 seconds is given by30 140000 s 2000 ln 9.8t dt 8 140000 2100t Use Simpson 3/8 rule to find the approximate value of the integral.h

Simpson 3/8 Rule for IntegrationSolutionb anb a 330 8 3 7.3333h 140000 f (t ) 2000 ln 9.8t 140000 2100t 3hI { f (t 0 ) 3 f (t1 ) 3 f (t 2 ) f (t3 )}8t0 8140000 f (t 0 ) 2000 ln 9.8 8 140000 2100 8 177.2667 t t h 1 0 8 7.3333 15.3333 140000 f (t1 ) 2000 ln 9.8 15.3333 140000 2100 15.3333 372.4629 t t 2h 2 0 8 2(7.3333) 22.6666 140000 f (t 2 ) 2000 ln 9.8 22.6666 140000 2100 22.6666 608.8976 07.08.5

07.08.6Chapter 07.08 t t 3h 3 0 8 3(7.3333) 30 140000 f (t3 ) 2000 ln 9.8 30 140000 2100 30 901.6740 Applying Equation (12), one has3I 7.3333 {177.2667 3 372.4629 3 608.8976 901.6740}8 11063.3104 mThe exact answer can be computed asI exact 11061.34 mMultiple Segments for Simpson 3/8 RuleUsing n number of equal segments, the width h can be defined asb a(14)h nThe number of segments need to be an integer multiple of 3 as a single application ofSimpson 3/8 rule requires 3 segments.The integral shown in Equation (1) can be expressed asbI f ( x )dxab f 3 ( x )dxa x3x6xn b f (x )dx f (x )dx . f (x )dx3x0 a3x33Using Simpson 3/8 rule (See Equation 12) into Equation (15), one gets3h f ( x0 ) 3 f ( x1 ) 3 f ( x 2 ) f ( x3 ) f ( x3 ) 3 f ( x 4 ) 3 f ( x5 ) f ( x6 ) I 8 . f ( x n 3 ) 3 f ( x n 2 ) 3 f ( x n 1 ) f ( x n ) (15)xn 3n 2n 1n 3 3h )()()(332fxfxfxf ( xi ) f ( xn ) 0ii8 i 1, 4 , 7 ,.i 2 , 5,8,.i 3, 6 , 9 ,. (16)(17)Example 2The vertical distance in meters covered by a rocket from t 8 to t 30 seconds is given by

Simpson 3/8 Rule for Integration07.08.730 140000 s 2000 ln 9.8t dt 8 140000 2100t Use Simpson 3/8 multiple segments rule with six segments to estimate the vertical distance.SolutionIn this example, one has (see Equation 14):140000 9.8tf (t ) 2000 ln 140000 2100t 30 8 3.6666h 6{t0 , f (t0 )} {8,177.2667}{t1 , f (t1 )} {11.6666,270.4104}where t1 t0 h 8 3.6666 11.6666{t 2 , f (t 2 )} {15.3333,372.4629} where t 2 t0 2h 15.3333{t3 , f (t3 )} {19,484.7455} where t3 t0 3h 19{t 4 , f (t 4 )} {22.6666,608.8976} where t 4 t0 4h 22.6666{t5 , f (t5 )} {26.3333,746.9870} where t5 t0 5h 26.3333{t6 , f (t6 )} {30,901.6740} where t6 t0 6h 30Applying Equation (17), one obtains:n 3 3n 2 4n 1 53 I (3.6666 ) 177.2667 3 f (ti ) 3 f (ti ) 2 f (ti ) 901.6740 i 1, 4 ,.i 2 , 5,.i 3, 6 ,.8 177.2667 3(270.4104 608.8976 ) (1.3750 ) 3(372.4629 746.9870 ) 2(484.7455) 901.6740 11,601.4696 mExample 3Compute30 140000 I 2000 ln 9.8t dt ,8 140000 2100t using Simpson 1/3 rule (with n1 4), and Simpson 3/8 rule (with n2 3).SolutionThe segment width isb ah nb a n1 n2

07.08.8Chapter 07.0830 8(4 3) 3.1429 140000 f (t ) 2000 ln 9.8t 140000 2100t t0 a 8 t1 x0 1h 8 3.1429 11.1429 t 2 t 0 2h 8 2(3.1429 ) 14.2857 Simpson' s 1/3 rulet3 t 0 3h 8 3(3.1429 ) 17.4286 t 4 t 0 4h 8 4(3.1429 ) 20.5714 t5 t 0 5h 8 5(3.1429 ) 23.7143t 6 t 0 6h 8 6(3.1429 ) 26.8571Nowt 7 t 0 7 h 8 7(3.1429 ) 30140,000 f (t 0 8) 2000 ln 9.8 8 140,000 2100 8 177.2667Similarly:f (t1 ) 256.5863f (t 2 ) 342.3241f (t3 ) 435.2749f (t 4 ) 536.3909f (t5 ) 646.8260f (t 6 ) 767.9978f (t 7 ) 901.6740For multiple segments (n1 first 4 segments) , using Simpson 1/3 rule, one obtains (SeeEquation 19):n1 1 3n1 2 2 h I1 f (t 0 ) 4 f (ti ) 2 f (ti ) f t n1 i 1, 3,.i 2 ,. 3 h { f (t 0 ) 4( f (t1 ) f (t3 )) 2 f (t 2 ) f (t 4 )} 3 ( ) 3.1429 {177.2667 4(256.5863 435.2749 ) 2(342.3241) 536.3909} 3 4364.1197

Simpson 3/8 Rule for Integration07.08.9For multiple segments (n2 last 3 segments) , using Simpson 3/8 rule, one obtains (SeeEquation 17):n2 2 1n2 1 2n2 3 0 3h I 2 f (t 0 ) 3 f (ti ) 3 f (ti ) 2 f (ti ) f t n1 i 1, 3,.i 2 ,.i 3, 6 ,. 8 3h { f (t 0 ) 3 f (t1 ) 3 f (t 2 ) 2(no contribution ) f (t3 )} 8 ( ) 3h { f (t 4 ) 3 f (t5 ) 3 f (t 6 ) f (t 7 )} 8 3 3.1429 {536.3909 3(646.8260) 3(767.9978) 901.6740} 8 6697.3663The mixed (combined) Simpson 1/3 and 3/8 rules giveI I1 I 2 4364.1197 6697.3663 11061mComparing the truncated error of Simpson 1/3 rule(b a )5 f ′′′′(ζ )(18)Et 2880With Simpson 3/8 rule (See Equation 12), it seems to offer slightly more accurate answerthan the former. However, the cost associated with Simpson 3/8 rule (using 3rd orderpolynomial function) is significantly higher than the one associated with Simpson 1/3 rule(using 2nd order polynomial function).The number of multiple segments that can be used in the conjunction with Simpson1/3 rule is 2, 4, 6, 8, (any even numbers) forI b f ( x)dxa h { f ( x0 ) 4 f ( x1 ) f ( x2 ) f ( x2 ) 4 f ( x3 ) f ( x4 ) . f ( xn 2 ) 4 f ( xn 1 ) f ( xn )} 3 n 1n 2 h f ( x0 ) 4 f ( xi ) 2 f ( xi ) f ( xn ) (19)i 1, 3,.i 2 , 4 , 6. 3 However, Simpson 3/8 rule can be used with the number of segments equal to 3,6,9,12,. (canbe certain integers that are multiples of 3).If the user wishes to use, say 7 segments, then the mixed Simpson 1/3 rule (for the first 4segments), and Simpson 3/8 rule (for the last 3 segments) would be appropriate.

07.08.10Chapter 07.08Computer Algorithm for Mixed Simpson 1/3 and 3/8 Rule for IntegrationBased on the earlier discussion on (single and multiple segments) Simpson 1/3 and 3/8 rules,the following “pseudo” step-by-step mixed Simpson rules for estimatingI b f ( x)dxacan be given asStep 1User inputs information, such asf (x) integrandn1 number of segments in conjunction with Simpson 1/3 rule (a multiple of 2 (anyeven numbers)n2 number of segments in conjunction with Simpson 3/8 rule (a multiple of 3)Step 2Computen n1 n2b ah nx0 ax1 a 1hx 2 a 2h.xi a ih.x n a nh bStep 3Compute result from multiple-segment Simpson 1/3 rule (See Equation 19)n1 1n1 2 h I 1 f ( x0 ) 4 f ( xi ) 2 f ( xi ) f (xn1 ) 3 i 1, 3,.i 2 , 4 , 6. Step 4Compute result from multiple segment Simpson 3/8 rule (See Equation 17)n2 2n2 1n2 3 3h I 2 f ( x 0 ) 3 f ( x i ) 3 f ( x i ) 2 f ( x i ) f x n2 8 i 1, 4 , 7.i 2 , 5,8.i 3, 6 , 9 ,. Step 5I I1 I 2( )(19, repeated)(17, repeated)(20)

Simpson07.08.113/8Ruleforand print out the final approximated answer for I .SIMPSON’S 3/8 RULE FOR INTEGRATIONTopicSimpson 3/8 Rule for IntegrationSummary Textbook Chapter of Simpson’s 3/8 Rule for IntegrationMajorGeneral EngineeringAuthorsDuc NguyenDateJuly 9, 2017Web Site http://numericalmethods.eng.usf.eduIntegration

In apterCh 07.03, Simpsons 1/3 rule for integration derived by was approximating the integrand f (x) with a 2nd order (quadratic) polynomial function. f 2 (x) 2 f 2 0 1 a 2 x (2) 07.08.2 Chapter 07.08 . Figure 1 ( ) f x Cubic function. In a similar fashion, Simpson rule for integration can be derived by 3/8 approximating the .