12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

128 chapter 6evaluate the function at the two endpoints and in the middle (Table 6.1):∫ xi+hx i−h∫ xi+h ∫ xif(x) dx = f(x) dx + f(x) dxx i x i−h≃ h 3 f i−1 + 4h 3 f i + h 3 f i+1. (6.16)Simpson’s rule requires the elementary integration to be over pairs of intervals,which in turn requires that the total number of intervals be even or that the numberof points N be odd. In order to apply Simpson’s rule to the entire interval, we addup the contributions from each pair of subintervals, counting all but the first andlast endpoints twice:∫ baf(x)dx ≃ h 3 f 1 + 4h 3 f 2 + 2h 3 f 3 + 4h 3 f 4 + ···+ 4h 3 f N−1 + h 3 f N. (6.17)In terms of our standard integration rule (6.3), we have{ hw i =3 , 4h 3 , 2h 3 , 4h 3 , ..., 4h 3 , h }3(Simpson’s rule). (6.18)The sum of these weights provides a useful check on your integration:N∑w i =(N − 1)h. (6.19)i=1Remember, the number of points N must be odd for Simpson’s rule.6.2.3 Integration Error (Analytic Assessment)In general, you should choose an integration rule that gives an accurate answerusing the least number of integration points. We obtain a crude estimate of theapproximation or algorithmic error E and the relative error ɛ by expanding f(x) ina Taylor series around the midpoint of the integration interval. We then multiplythat error by the number of intervals N to estimate the error for the entire region[a, b]. For the trapezoid and Simpson rules this yields( ) [b − a]3E t = ON 2 f (2) ,( ) [b − a]5E s = ON 4 f (4) ,ɛ t,s = E t,sf . (6.20)−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 128

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!