CMDA 4604: Intermedite Topics in Mthemticl Modeling Lecture 19: Interpoltion nd Qudrture In this lecture we mke brief diversion into the res of interpoltion nd qudrture. Given function f C[, b], we sy tht polynomil p interpoltes f t the point x [, b] if f x = p x. In the context of tody s lecture, we im to use interpoltion s wy to construct good polynomil pproximtions to f. The next lecture we will put tody s results into the broder context of the course: we will show how the pproximte solutions constructed by the finite element method cn be relted to interpolting polynomils, nd so the ccurcy of interpolting polynomils will led to error bounds for the finite element method. We hve three gols tody: 1 construct interpolting polynomils p n ; 2 bound the error fx p n x; 3 integrte interpolting polynomils to pproximte the integrl of f 1. Constructing Interpolting Polynomils. We seek to solve the following problem: Polynomil interpoltion problem. Given function f C[, b] nd points x 0,..., x n [, b], construct polynomil p n of degree not exceeding n such tht p n x j = fx j, j = 0,..., n. In ny numericl nlysis course, one lerns tht unique solution p n to this problem lwys exists, nd be constructed in vrious wys. Here we shll just detil one elegnt wy to develop the interpolnt, clled the Lgrnge form. The ide behind the Lgrnge form is simple. Consider the functions L k x = i=0 i k x x i x k x i. Note tht ech L k is degree-n polynomil. For ech vlue of k, the product contins n terms of the form x x j /x k x j. Ech of these terms is degree-1 polynomil. The product of n degree-1 polynomils is degree-n polynomil. Moreover, these polynomils hve very specil property: by construction, L k tkes the vlue 1 t x k nd hs roots t ech of the points x j, j k: L k x j = { 1, j = k 0, j k. These n+1 polynomils L 0,..., L n form bsis for the n+1 dimensionl vector spce of polynomils hving degree n or less. 1
These Lgrnge bsis functions mke it trivil to construct the solution p n to the polynomil interpoltion function: p n x = fx k L k x. k=0 Since p n is the sum of degree-n polynomils, it too is degree-n polynomil. The property tht L k x i = 0 for i k ensures tht t the interpoltion point x j, p n x j = fx k L k x j = fx j L j x j = fx j. k=0 Thus the polynomil p n psses through f t the designted points. But how ccurtely does p n pproximte f t the other points in the intervl [, b] where we hve not specified the interpoltion condition? 2. Interpoltion Error Anlysis. We now seek to chrcterize the mximum error mx fx p nx. x [,b] The chrcteriztion of this error is one of the most fundmentl results in numericl nlysis. Theorem Interpoltion Error Bound. Suppose f C n+1 [, b] nd let p n P n denote the polynomil tht interpoltes f t the points x 0,..., x n [, b] for j = 0,..., n. The for every x [, b] there exists ξ [, b] such tht fx p n x = f n+1 ξ n + 1! x x j. This result yields bound for the worst error over the intervl [, b]: mx fx p nx mx x [,b] ξ [,b] f n+1 ξ mx n + 1! x [,b] x x j. 1 Proof. Consider some rbitrry point x [, b]. We seek descriptive expression for the error f x p n x. If x = x j for some j {0,..., n}, then f x p n x = 0 nd there is nothing to prove. Thus, suppose for the rest of the proof tht x is not one of the interpoltion points. To describe f x p n x, we shll build the polynomil of degree n + 1 tht interpoltes f t x 0,..., x n, nd lso x. Of course, this polynomil will give zero error t x, since it interpoltes f there. From this polynomil we cn extrct formul for f x p n x by mesuring how much the degree n + 1 interpolnt improves upon the degree-n interpolnt p n t x. Since we wish to understnd the reltionship of the degree n + 1 interpolnt to p n, we shll write tht degree n + 1 interpolnt in mnner tht explicitly incorportes p n. Given this setting, use of the Newton form of the interpolnt is nturl; i.e., we write the degree n + 1 polynomil s p n x + γ x x j 2
for some constnt γ chosen to mke the interpolnt exct t x. For convenience, we write wx x x j nd then denote the error of this degree n + 1 interpolnt by φx fx p n x + γwx. To mke the polynomil p n x + γwx interpolte f t x, we shll pick γ such tht φ x = 0. The fct tht x {x j } n ensures tht w x 0, nd so we cn force φ x = 0 by setting γ = f x p n x. w x Furthermore, since fx j = p n x j nd wx j = 0 t ll the n + 1 interpoltion points x 0,..., x n, we lso hve φx j = fx j p n x j γwx j = 0. Thus, φ is function with t lest n + 2 zeros in the intervl [, b]. Rolle s Theorem 1 tells us tht between every two consecutive zeros of φ, there is some zero of φ. Since φ hs t lest n + 2 zeros in [, b], φ hs t lest n + 1 zeros in this sme intervl. We cn repet this rgument with φ to see tht φ must hve t lest n zeros in [, b]. Continuing in this mnner with higher derivtives, we eventully conclude tht φ n+1 must hve t lest one zero in [, b]; we denote this zero s ξ, so tht φ n+1 ξ = 0. We now wnt more concrete expression for φ n+1. Note tht φ n+1 x = f n+1 x p n+1 n x γw n+1 x. Since p n is polynomil of degree n or less, p n+1 n 0. Now observe tht w is polynomil of degree n + 1. We could write out ll the coefficients of this polynomil explicitly, but tht is bit tedious, nd we do not need ll of them. Simply observe tht we cn write wx = x n+1 + qx, for some q P n, nd this polynomil q will vnish when we tke n + 1 derivtives: d n+1 w n+1 x = xn+1 dxn+1 + q n+1 x = n + 1! + 0. Assembling the pieces, φ n+1 x = f n+1 x γ n + 1!. Since φ n+1 ξ = 0, we conclude tht γ = f n+1 ξ n + 1!. Substituting this expression into 0 = φ x = f x p n x λw x, we obtin f x p n x = f n+1 ξ n + 1! x x j. 1 Recll the Men Vlue Theorem from clculus: Given d > c, suppose f C[c, d] is differentible on c, d. Then there exists some η c, d such tht fd fc/d c = f η. Rolle s Theorem is specil cse: If fd = fc, then there is some point η c, d such tht f η = 0. 3
This error bound hs strong prllels to the reminder term in Tylor s formul. Recll tht for sufficiently smooth h, the Tylor expnsion of f bout the point x 0 is given by fx = fx 0 + x x 0 f x 0 + + x x 0 k k! f k x 0 + f k+1 ξ k + 1! x x 0 k. Ignoring the reminder term t the end, note tht the Tylor expnsion gives polynomil model of f, but one bsed on locl informtion bout f nd its derivtives, s opposed to the polynomil interpolnt, which is bsed on globl informtion, but only bout f, not its derivtives. Rerrnging this expression, we hve fx fx 0 + x x 0 f x 0 + + x x 0 k f k x 0 = f k+1 ξ k! k + 1! x x 0 k, perfect nlogue of the interpoltion error formul we hve just proved. 3. Interpoltory Qudrture Formuls. The finite element method requires computtions like f, φ k = 1 0 fxφ k x dx to construct the lod vector. It my be inconvenient or even impossible for some f to compute this inner product. For such cses we wish to pproximte the integrl. We shll consider the generic problem of pproximting If = fx dx. Polynomil interpoltion provides simple wy to pproximte the integrl: Construct the polynomil interpolnt p n to f t designted points; Approximte fx dx by p nx dx. If we construct p n using the Lgrnge form described bove, this procedure becomes very simple: Construct the interpolting polynomil p n x = fx j L j x; Integrte the interpolting polynomil to obtin I n f, pproximting the exct integrl If: I n f = p n x dx = fx j L j x dx = fx j L j x dx. 4
Notice tht the integrls tht remin depend on the Lgrnge bsis functions L j but not on f. We will cll these integrls the weights of the qudrture rule: w j = L j x dx. Then the qudrture rule tkes the simple form I n f = w j fx j. The points x 0,..., x n re clled the nodes of the qudrture rule. When you choose evenly spced points over [, b], you recover fmilir rules tht you hve lredy encountered in clculus: n = 0 x 0 = + b/2, L 0 x = 1 gives fx dx b f 1 2 + b; n = 1 x 0 =, x 1 = b gives the trpezoid rule: fx dx b 2 f + fb ; n = 2 x 0 =, x 1 = + b/2, x 2 = b gives Simpson s rule: fx dx b 6 f + 4f 1 2 + b + fb. The first rule pproximtes f with n interpolting constnt; the trpezoid rule pproximtes f with n interpolting liner polynomil; Simpson s rule pproximtes f with n interpolting qudrtic. How does one quntify the error If I n f? Simply integrte the error formul for polynomil interpoltion! One must then clculte: If I n f = = fx p n x dx f n+1 ξx n + 1! x x j dx. The error nlysis for the trpezoid rule where x 0 = nd x 1 = b follows from ppliction of the men vlue theorem for integrls: fx dx p 1 x dx = = 1 2 f η 1 2 f ξxx x b dx x x b dx = 1 2 f η 1 6 3 1 2 2 b + 1 2 b2 1 6 b3 = 1 12 f ηb 3 5
for some η [, b]. As we expect, if fx is liner polynomil, then f x = 0 for ll x, nd hence the trpezoid rule will be exct. The nlysis for Simpson s rule is bit more complicted. One cn ctully show something stronger thn wht you might expect from integrting the polynomil interpoltion error: fx dx p 2 x dx = 1 b 5 90 2 5 f 4 η for some η [, b]. Notice tht this bound involves f 4, rther thn the expected f 3 : Simpson s rule will be exct for cubic polynomils, not just qudrtics! If you wnt greter ccurcy thn these bounds suggest, you could simply increse the degree n, nd there re some settings in which this mkes gret sense: but one must be creful bout how to select the nodes x 0,..., x n, nd uniformly spced points re not the best choice. Composite rules. As n lterntive to integrting high-degree polynomil, one cn pursue simpler pproch tht is often very effective, especilly for problems tht re not prticulrly smooth e.g., our ht functions: Brek the intervl [, b] into subintervls, nd pply the trpezoid rule or Simpson s rule on ech subintervl. Applying the trpezoid rule gives fx dx = xj x j 1 fx dx x j x j 1 fx j 1 + fx j. 2 The stndrd implementtion ssumes tht f is evluted t uniformly spced points between nd b, x j = + jh for j = 0,..., n nd h = b /n, giving the following fmous formultion: fx dx h 2 n 1 f + 2 f + jh + fb. Of course, one cn redily djust this rule to cope with irregulrly spced points. The error in the composite trpezoid rule cn be derived by summing up the error in ech ppliction of the trpezoid rule: fx dx h 2 n 1 f + 2 f + jh + fb = 1 12 f η j x j x j 1 3 = h3 12 f η j for η j [x j 1, x j ]. We cn simplify these f terms by noting tht 1 n n f η j is the verge of n vlues of f evluted t points in the intervl [, b]. Nturlly, this verge cnnot exceed the mximum or minimum vlue tht f ssumes on [, b], so there exist points ξ 1, ξ 2 [, b] such tht f ξ 1 1 f η j f ξ 2. n Thus the intermedite vlue theorem gurntees the existence of some η [, b] such tht f η = 1 f η j. n 6
The composite trpezoid error bound thus simplifies to fx dx h 2 n 1 f + 2 f + jh + fb = h2 12 b f η. Similr nlysis cn be performed to derive the composite Simpson s rule. We now must ensure tht n is even, since ech intervl on which we pply the stndrd Simpson s rule hs width 2h. Simple lgebr leds to the formul fx dx h n/2 f + 4 3 n/2 1 f + 2j 1h + 2 f + 2jh + fb. Derivtion of the error formul for the composite Simpson s rule follows the sme strtegy s the nlysis of the composite trpezoid rule. One obtins fx dx h n/2 f + 4 3 for some η [, b]. n/2 1 f + 2j 1h + 2 f + 2jh + fb = h4 180 b f 4 η 7