LECTURE 9 Numericl Integrtion Recll from Clculus I tht denite integrl is generlly thought of s representing the re under the grph of fèxè between the points x = nd x = b, even though this is ctully only true when fèxè is non-negtive onë; bë. However, the geometric interprettion of the derivtive t lest mkes its the forml denition lim N! NX fè~x i èx ; x = b, N ; ~x i ë + ix; +èi + èxë little more pltble: for one thinks of the sum on the right hnd side s sum over the res of set of innitesiml rectngles tht just bout cover the grph of fèxè. Of course, in prctice one never uses the limit denition to compute n integrl. Rther, one relies on the Fundmentl Theorem of Clculus, which sys tht = F èbè, F èè where F èxè isny function such tht df = fèxè. Thus, the problem of crrying out direct integrl is dx reduced to nding n nti-derivtive of the integrnd. However, there re mny exmples of functions f for which there is no closed formul for nti-derivtive of f. A fmous exmple is fèxè =e x : Therefore, numericl integrtion is often the only mens for scribing vlues to expressions like Z 0 e x dx : Now just s in the cse of the derivtive, the forml denition leds nturlly to simple numericl procedure. We simply choose lrge vlue for N, set nd clculte x = b, N ~x i = +xi + x ; the midpoint of the intervl ëx i ;x i+ ë NX fè~x i èx : However, while it's esy to write this computtionl lgorithm down, it's not so obvious how to gure out how ccurte the resulting clcultion will be for ny given vlue of N.
9. NUMERICAL INTEGRATION In order to obtin relible estimte of the error we will replce the integrnd fèxè by polynomil interpoltion P f èxè. The reson for doing this is two-fold. First of ll, since P f èxè is polynomil we cn compute its integrl exctly: è A i x i! dx = èi +èa i èb i+, i+ è Secondly, wehve n exct expression for the error tht's introduced when we replce fèxè bynn th degree polynomil interpoltion: From this we cn deduce, fèxè, P f èxè = P f èxè = èn + è! f èn+è èç x è èn + è! f èn+è èç x è è! Just s in the cse of polynomil interpoltion we would like tochoose the interpoltion nodes x i in such wy tht the fctor W = è! dx ç!èxèdx is minimized. Recll tht in the cse of polynomil interpoltion we discovered tht the optiml choice of n + nodes x i, t lest on the intervl ë,; ë would be the roots of the Chebyshev polynomil T n+ èxè. We hve similr sitution here; however, insted of minimizing the mximl vlue of the product of the 's we must insted try to minimize the integrl of such product. This leds us to using, insted of the roots of the ordinry Chebyshev polynomils, the roots of nother specil set of polynomils, the Chebyshev polynomils of the second kind. These polynomils re dened s follows: U n èxè = sin, èn + è cos, èxè sin ècos, èxèè nd hve the following properties U n èxè =,n x n +lower order terms,n, U n+ èxè =èx, x 0 èèx, x èèx, x è èx, x n è where ç ç èi +èç x i = cos ; i =0; ; ;:::;n n + If x 0 ;:::;x n re the roots of U n+ èxè then Z, dx =,èn+è If f~x i j i =0; ;:::;ng is ny other collection of n + point inë,; ë, then Z, èx, ~x i è Thus, one optiml technique for computing n integrl Z, ç,èn+è would be to clculte n n + point interpoltion P f èxè on the intervl ë,; ë, using the points ç ç èi +èç x i = cos ; i =0; ; ;:::;n n +
. OTHER QUADRATURES 3 s interpoltion nodes nd then setting Z, Z, P f èxèdx : To hndle n integrl over more generl intervl, sy ë; bë we'd use the the sme trick tht we used for nding optiml nodes for ordinry interpoltion; we just mp the intervl ë,; ë linerly onto the intervl ë; bë nd look to see where the the nodes of U n èxè lnd. Thus, we set x i = + b + b, cos ç èi +èç n + ç ; i =0; ; ;:::;n determine the interpoltion polynomil P f èxè corresponding to this set of nodes, nd nlly set Problem 9.. Suppose = P f èxèdx is clculted numericlly by interpolting the function fèxè t the points ç ç x i = + b + b, èi +èç cos ; i =0; ; ;:::;n n + nd then integrting the interpoltion polynomil between nd b. Express the mximl error in terms of derivtive of f, n, nd the end points of integrtion nd b. èhint: Write down chnge of vribles formul reduces the integrl over ë; bë to n integrl over ë,; ë.è. Other Qudrtures Now ctully the progrm outlined bove cn be bit too computer intensive. Certinly we cn use up lot of computer time nding the Newton form for the interpoltion polynomil for lrge set of nodes, converting the Newton form of the interpoltion polynomil to stndrd form, nd then integrting term by term. Often wht suces is modest improvement over the nive lgorithm coming from the forml denition of the Riemnn integrl. Here's the bsic ide. The formul è9.è fèxè ç NX fè~x i èx ; x = b, N ; ~x i ë + ix; +èi + èxë ws bsed on the ide tht the re under the grph of fèxè cn be pproximted by forming prtitioning the intervl ë; bë into N subintervls ëx i ;x i+ ë of width x, pproximting the re A i under the grph of fèxè under between x i nd x i+ by è9.è The ide we'll pursue now ishow to improve the pproxi- nd then summing over the contributions A i. mtions è9.è. A i ç f è~x i èx ; ~x i ëx i ;x i+ ë Let's rst note tht the pproximtion è9.è is bout the worst possible. For eectively, we're replcing the function fèxè bypoint polynomil interpoltion of f on the intervl ëx i ;x i+ ë. No doubt our ccurcy would improve if we insted used three point polynomil interpoltion insted.
. OTHER QUADRATURES 4 For nottionl clrity, let's replce x i nd x i+ by nd x +h, nd consider the Lgrnge form of the three point interpoltion of fèxè on the intervl ë; +hë using the points ; + h; +h. We then hve è9.3è fèxè ç fèè èx,, hèèx,, hè è,hèè,hè + f è + hè èx, èèx,, hè èhèè,hè èx, èèx,, hè + fè +hè èhèèhè The expresion on the right hnd side is second order polynomil in x. Ifwe expnd it in powers of x nd integrte it between nd +h we obtin è9.4è Z +h h ç ëfèè+4fè + hè+fè +hèë 3 This formul is equivlent to Simpson's Rule è rule tht is often presented in elementry clculus courses.è We cn immeditely pply this formul to get new nd improved version of è9.è. Setting we hve = x i ; h = x nd so, setting we hve Z xi+x x i fèxè ç çèx i è= x = ëfèè+4fè +x=è + fè +xèë x = b, x i = + ix i= Z xi x i, i= ç èx i,èx Of course, there's nothing stopping us from interpolting the subintervls ëx i ;x i+ ë t four, ve or more points to obtin even more ccurte qudrture formule. However, the lgebr between the nlogs of equtions è9.3è nd è9.4è becomes pretty strenuous. There is n esy wy of guessing the correct qudture formul. To demonstrte this technique let me rework derivtion of eqution è9.4è. The key ide is tht polynomil interpoltion t the points x 0, x, :::; x n will lwys produce formul of the form è9.5è Z è n X f èx i è `ièxè! dx = f èx i è where the `ièxè re the crdinl functions for the nodes x 0 ;x ;:::;x n : If we dene then è??è tkes the form è9.6è `ièxè = A i ç j=0 j6=i èx, x j è èx i, x j è `ièxèdx f èx i è A i `ièxèdx
. OTHER QUADRATURES 5 no mtter wht the function fèxè is. Moreover, if fèxè is polynomil of degree less thn or equl to n, then fèxè is identicl to its polynomil interpoltion èrecll tht the error term is proprotionl to f èn+è èçè which would be zero if f were polynomil of degree ç nè. By tking fèxè =;x;x ;:::;x n we rrive t series of n + equtions for the n + constnts A i : b, =, b, =, b n+, n+ = n +. dx = xdx = x n dx = Solving this system of equtions for the constnts A i will give us qudture formul è9.6è tht cn be used for ny function fèxè. Let me now demonstrte this technique for the cse where we do three point interpoltion to clculte Z +h : A i x i A i x n i A i Set x 0 =, x = + h, x = +h. The interpoltion is exct when fèxè =: So A 0 + A + A = The interpoltion is lso exct when fèxè = x. So A 0 èè+a è + hè+a è +hè = Z +h,h And the interpoltion is exct when fèxè =x.thus, A 0 èè + A è + hè + A è +hè = We thus rrive t the following system of equtions The solution of this system nd so which is identicl to è9.4è. 0 @ + h +h è + hè è +hè Z +h 0 A Z +h xdx = Z +h @ A 0 A A A 0 = 3 h A = 4 3 h A = 3 h Problem 9.. Find qudrture formul for the integrl dx =h, è +hè, èè =h, h x dx = 3 0 A = @, è +hè 3, èè 3 = h è +hè, h +4h + 8 3 h3 ç 3 hfèè +4 3 hfè + hè+ hfè +hè 3 Z +3h fèxè A
. OTHER QUADRATURES 6 corresponding to the cse where the function fèxè is interpolted t four points: x 0 =, x = + h, x = +h, x 3 = +3h;