Math 131. Numerical Integration Larson Section 4.6


 Howard McLaughlin
 6 months ago
 Views:
Transcription
1 Mth. Numericl Integrtion Lrson Section. This section looks t couple of methods for pproimting definite integrls numericlly. The gol is to get good pproimtion of the definite integrl in problems where n ntiderivtive of f() is not known. f() d; this becomes necessry Trpezoidl Rule. Suppose f is continuous on the intervl [, b]. Prtition the intervl [, b] into n equl subintervls with the prtition = 0 < < < <... < n < n = b where k k =, = b n nd so k = + k. Then f() d (b ) n [f( 0) + f( ) + f( ) f( n ) + f( n )] nd, s n, the righthnd side pproches f() d. The following emple will compre using simple rectngles nd the trpezoidl rule to estimte the re under curve. Emple. () Use lower sum to pproimte the re of the region under the curve y = for with four rectngles of equl width. (b) Use the trpezoidl rule to pproimte the re of the region under the curve y = for with n =. (c) The lower sum rectngles re shown below to the left, nd the pproimting trpezoids re below to the right. Which (the rectngles or trpezoids) ppers to provide better pproimtion? Use the Fundmentl theorem of clculus to determine the ctul re, nd then determine how ccurte the estimtes in () nd (b) re. y y
2 Solution: () Ech of the rectngles hs bse 0.5, nd the heights re: (0.5)( ) =.00, (0.5)(.5 ) =.95 (0.5)( ) =.800, nd (0.5)(.5 ) =.95 respectively. Therefore, the sum of the re of the rectngles is A = (0.5)(.00) + (0.5)(.95) + (0.5)(.800) + (0.5)(.95) = (0.5)( ) =.975 Thus the lower sum is.975 (b) Using the trpezoidl rule with f() = , =, b = nd n = we compute f() d (b ) n [f( 0) + f( ) + f( ) + f( ) + f( )] = ( ) [f() + f(.5) + f() + f(.5) + f()] () = (0.5)[.00 + (.95) + (.800) + (.95) ] = (0.5)(.90) = Thus the trpezoidl rules sys the re is pproimtely (c) From the grphs, we know the ctul re is somewht lrger thn the lower sum, nd it looks to be very close to the sum of the res of the trpezoids. (Note tht the trpezoids were intentionlly drwn with thick green borders so tht comprison with the top of the trpezoids nd the grph of the function could be seen). So, from the grphs, we deduce.975 ctul re, nd we know ctul re From the Fundmentl theorem of clculus, we know the ctul re, A, is A = ( ) = = [9(0.5) + (0.8)] [ ] So the lower sum underestimted the ctul re by pproimtely = 0.958, nd the trpezoidl rule ws off by pproimtely = Generlly, you will not be ble to know whether the trpezoids underestimte or overestimte the ctul integrl. A couple of generl observtions from the previous emple. The trpezoidl rule will usully provide much better estimte thn using right endpoints or left endpoints with n equl number of subintervls. However, in the event you cn use the Fundmentl theorem of clculus to evlute n integrl, you should of course use it. Finlly, if you cnnot find n ntiderivtive to evlute n integrl nd you use the trpezoidl rule, it would be relly useful to know how ccurte your nswer is. This is ddressed in the net result.
3 Theorem. (Trpezoidl Rule Error) Suppose f hs continuous second derivtive on the intervl [, b], then the bsolute error E in pproimting stisfies E (b ) n [m f () ], b. f() d by the Trpezoidl rule The righthnd side in the trpezoidl rule error formul gives us worstcse scenrio for the error; tht is the ctul error will usully be somewht smller thn the right hnd side vlue, but will never eceed the right hnd side vlue. Emple. () Determine the mimum error predicted by the trpezoidl rule error formul for [ ] d using n = s ws done in Emple. (b) Wht vlue of n (number of trpezoids) would be needed to gurntee the error in estimting the intgrl [ ] d does not eceed Solution: () We will use the formul for E with f() = , n =, = nd b =. First, we find f () = (0.5) =.0 nd so the mimum vlue of f () on the intervl is.0. Therefore, E ( ).0 [.0] = ( ) 0.07 (b) We hve E ( ) (n ) [.0], nd so we solve = ( ) (.0) (n ) which mens n = ( ) (0.000) [.0] n We lwys go up to the net higher whole number when n is not whole number, so we would use n = 8. In prt () of the previous emple, the predicted mimum error ws ectly equl to the ctul error, it will usully be the cse tht the ctul error is less thn the predicted mimum error (which is the worst cse scenrio). Emple. () Use the trpezoidl rule with n = to estimte π 0 sin d. (b) Use the trpezoidl error formul to determine the lrgest possible error you would epect in your nswer to () (you will be given the error formuls for Simpson s Rule nd the Trpezoidl Rule if needed on the finl test)?
4 Solution: () According to the trpezoidl rule with n =, we hve π 0 sin() d π 0 [sin(0) + sin(π/) () + sin(π/) + sin(π/) + sin(π/) + sin(5π/) + sin(π)] = π [ ].95 (b) For this question f () = sin nd so the mimum of f () for 0 π is. Therefore, the ctul error E stisfies ( ) (b ) E = m n f () = π 0 π ( ) In this cse, we cn use the Fundmentl theorem of clculus to determine π π sin d = cos = ( ) = 0 nd so E.95 = 0.0, nd so we note this does not eceed the bound of we found using the trpezoidl rule error formul. 0 An importnt rule tht uses res under prbols to provide numericl pproimtions definite integrls is clled Simpson s rule. It tends to work rel well for functions tht hve nice higher order derivtives. Simpson s Rule. Suppose f is continuous on the intervl [, b]. Prtition the intervl [, b] into n equl subintervls, where n is n even integer, with the prtition = 0 < < < <... < n < n = b where k k =, = b n nd so k = + k. Then f() d (b ) n [f( 0) + f( ) + f( ) + f( )... + f( n ) + f( n ) + f( n )] nd, s n, the righthnd side pproches f() d. Note tht the coefficients nd in Simpson s rule lternte, nd follow the pttern...
5 The following provides n emple using Simpson s rule where we do not know n ntiderivtive. Emple. Use Simpson s rule to estimte sin() d with n =. Solution: First = 9 8 = 0.5. Then 0 = 8, = 8.5, = 8.50, = 8.75 nd = 9. Then Simpson s rule sys sin() 9 sin() d = 9 d 8 ( ) [ 9 8 sin((8)) 9 () 8 + sin((8.5)) sin((8.75)) + sin((9)) ] = 9 [ sin(8.00) + sin(9.50) + sin(5.00) ] + sin(5.50) sin(5.00) 9 + sin((8.50)) 8.50 As with the Trpezoidl rule, it is importnt to determine how ccurte our nswers re when using Simpson s rule. The following error formul cn help you do this. Theorem. (Simpson s Rule Error) Suppose f hs continuous fourth derivtive on the intervl [, b], then the bsolute error E in pproimting f() d by Simpson s rule stisfies E (b )5 80n [m f () () ], b. The different prts in the penultimte emple provides prctice on the vrious rules presented in this section. Emple 5. () Estimte (b) Estimte sin( )d with n = subintervls using the trpezoidl rule. sin( )d with n = subintervls using Simpson s rule.
6 (c) Use the error formul for Simpson s rule to determine the lrgest error you would epect in evluting 5 d using Simpson s rule with n = 0, 000 subintervls? (d) Use the error formul for the trpezoidl rule to determine the lrgest error you would epect in evluting 5 d using the trpezoidl rule with n = 0, 000 subintervls? (e) Use the trpezoidl rule error formul to find n so tht the error in pproimting using the trpezoidl rule does not eceed (f) Use Simpson s rule error formul to find n so tht the error in pproimting Simpson s rule does not eceed d d using Solution: () Using the trpezoidl rule with n = sin( )d (5 ) () [sin( ) + sin(0 / ) + sin( / ) + sin( ) + sin( / ) + sin( / ) + sin(5 )] [.0779] (b) Using Simpson s rule with n = sin( )d (5 ) () [sin( ) + sin(0 / ) + sin( / ) + sin( ) + + sin( / ) + sin( / ) + sin(5 )] [ ] Note Wolfrm Alph provides n pproimte vlue of.055 for (c) f () () = 0, so m f () () = 0() for. Thus E ( )5 80(0000 ) 0 = 0. (d) f () = 0. Thus m f () = 0( ) for. Then E ( ) 50 = (0000 ) sin( ) d.
7 (e) f = nd so m f () = / for 8. Solve n.0000 to find n 70.8 nd n is n integer so we choose n = 7. (f) f () = 5 nd so m f () = / 5 = / for 8. Solve 5 80n.0000 to find n.9 (nd n even) nd so we choose n =. The finl emple illustrtes the vrious types of questions you my see involving the trpezoidl rule. Emple. () Use n upper sum to pproimte the re of the region under the curve y = for with si rectngles of equl width. + (b) Use the trpezoidl rule to pproimte the re of the region under the curve y = + for with n =. (c) By compring the grphs given below, does one method pper to give significntly more ccurte estimte of the re thn the other? If so, which one is better? (d) Use the error formul for the trpezoidl rule to determine the mimum possible error tht occurred in (b). (e) Use the error formul for the trpezoidl rule to determine the the smllest possible n in the trpezoidl rule tht could be used to pproimte the ctul re to within y y
8 Solution: () Ech of the rectngles hs bse 0.5, nd so the upper sum is U = ( (0.5) ) (b) According to the trpezoidl rule, we hve (b ) f() d n [f( 0) + f( ) + f( ) + f( ) + f( ) + f( 5 ) + f( )] ( ) = [f() + f(.5) + f() + f(.5) + f() + f(.5) + f()] () = ( ) +.08 (c) From the grph, it is cler tht the ctul re is less thn the upper sum, nd so the ctul re is less thn.90, however, it is lso cler tht the trpezoids provide much better estimte of the ctul re, so the ctul re is.08. (d) The error E in the Trpezoidl rule stisfies E (b ) n In our cse = nd b =, n = nd we find m{ f () : b}. f () = ( + ), f () = ( + ) = ( + ) Clerly f () is decresing function on [, ] so its mimum vlue on this intervl occurs t. Therefore, ( ) E ( ) ( + ) 0.00 Tht is, the ctul re will be within 0.00 of the trpezoidl rule estimte of.08 tht mens the ctul re is between nd , tht is.878 Actul Are.78 (e) Given desired error E = (t most) we solve = ( ) (n ) ( + ) n = ( ) ( ) ( + ) = 9.8 nd so n nd so we choose n = (for the trpezoidl rule, lwys go up to the net higher whole number in the cse n is not whole number).