Polynomial Interpolation – Part II – Prof. Dr. Florian Rupp German University of Technology in Oman (GUtech) Introduction to Numerical Methods for ENG & CS (Mathematics IV) Spring Term 2016 Exercise Session Reviewing the highlights from last time (1/ 2) Reviewing the highlights from last time Page 174, exercise 4 Verify that the polynomials p(x) = 5x3 − 27x2 + 45x − 21 q(x) = x4 − 5x3 + 8x2 − 5x + 4 interpolate the data x f (x) = y 1 2 2 1 3 6 4 47 and explain why this does not violate the uniqueness part of the existence and uniqueness theorem on polynomial interpolation. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 3 / 48 Reviewing the highlights from last time (1/ 2) We have x f (x) = y p(x) q(x) 1 2 2 2 2 1 1 1 3 6 6 6 4 47 47 47 and thus p(x) = 5x3 − 27x2 + 45x − 21 and q(x) = x4 − 5x3 + 8x2 − 5x + 4 are both interpolating polynomials. Though, their degree differs and thus the uniqueness part is not violated. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 4 / 48 Reviewing the highlights from last time (2/ 2) Reviewing the highlights from last time Given the table x f (x) = y ■ ■ 0 7 2 11 3 28 4 63 Page 174, exercise 1 Use the Lagrange interpolation process to obtain a polynomial of least degree that interpolates the above table. Page 174, exercise 1 (reformulated) Use the Newton interpolation process to obtain a polynomial of least degree that interpolates the above table. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 5 / 48 Today, we will focus on further details of polynomial interpolation Today’s topics: ■ Calculating the coefficients for Newton’s interpolation ansatz using divided differences ■ Interpolation with monomials and the Vandermode matrix Corresponding textbook chapters: 4.1 Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 6 / 48 Calculating the Newton Coefficients Using Divided Differences The key idea in gaining the Newton coefficients (1/ 4) We now turn to the problem of determining the coefficients a0 , a1 , . . . , an of the Newton interpolation polynomial pn (x) = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ) + . . . · · · + an (x − x0 )(x − x1 ) · · · (x − xn−1 ) , efficiently. Again, we start with a table of values of a function f : x f (x) x0 f (x0 ) x1 f (x1 ) x2 f (x2 ) ... ... xn f (xn ) The points x0 , x1 , x2 , . . . , xn are assumed to be distinct, but no further assumption is made about their positions on the real line. We already know that for each n = 0, 1, . . . there exists an unique polynomial pn such that ■ ■ the degree of pn is at most n, and pn (xi ) = f (xi ) for all i = 0, 1, . . . , n. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 8 / 48 The key idea in gaining the Newton coefficients (2/ 4) A crucial observation about the Newton interpolation polynomial pn (x) = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ) + . . . · · · + an (x − x0 )(x − x1 ) · · · (x − xn−1 ) , is that its coefficients a0 , a1 , . . . , an do not depend on n. In other words, pn is obtained from pn−1 by adding one more term, without altering the coefficients already present in pn−1 itself: pn (x) = pn−1 (x) + an (x − x0 )(x − x1 ) · · · (x − xn−1 ) . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 9 / 48 The key idea in gaining the Newton coefficients (3/ 4) A systematic way of determining the unknown coefficients a0 , a1 , . . . , an from the table x f (x) x0 f (x0 ) x1 f (x1 ) x2 f (x2 ) ... ... xn f (xn ) is to set x equal in turn to x0 , x1 , . . . , xn during the construction of the Newton interpolation polynomial pn (x) = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ) + . . . · · · + an (x − x0 )(x − x1 ) · · · (x − xn−1 ) , i.e. p0 (x0 ) = f (x0 ) = a0 , p1 (x1 ) = f (x1 ) = a0 + a1 (x1 − x0 ) , p2 (x2 ) = f (x2 ) = a0 + a1 (x2 − x0 ) + a2 (x2 − x0 )(x2 − x1 ) , etc. . . . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 10 / 48 The key idea in gaining the Newton coefficients (4/ 4) The equations p0 (x0 ) = f (x0 ) = a0 , p1 (x1 ) = f (x1 ) = a0 + a1 (x1 − x0 ) , p2 (x2 ) = f (x2 ) = a0 + a1 (x2 − x0 ) + a2 (x2 − x0 )(x2 − x1 ) , etc. can be solved for the ai ’s in turn, starting with a0 : a0 = f [x0 ] := f (x0 ) f (x1 ) − f (x0 ) f (x1 ) − a0 = a1 = f [x0 , x1 ] := x1 − x0 x1 − x0 f (x2 ) − a0 − a1 (x2 − x0 ) a2 = f [x0 , x1 , x2 ] := (x2 − x0 )(x2 − x1 ) = Prof. Dr. Florian Rupp f (x2 )−f (x1 ) x2 −x1 − f (x1 )−f (x0 ) x1 −x0 x2 − x0 , etc. GUtech 2016: Numerical Methods – 11 / 48 Some remarks on Newton’s divided differences The (bracket) notation ak = f [x0 , x1 , . . . , xk ] indicates that ak depends on the values of f at the nodes x0 , x1 , . . . , xn . As the values ak are uniquely determined through the system of equations shown on the last slide we can view the identity ak =: f [x0 , x1 , . . . , xk ] as definition of the quantity f [x0 , x1 , . . . , xk ]. The quantity f [x0 , x1 , . . . , xk ] is called divided difference of order k for f. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 12 / 48 Example: Determining divided differences Example Determine the quantities f [x0 ], f [x0 , x1 ] and f [x0 , x1 , x2 ] based on the table x f (x) 1 3 −4 13 0 −23 The determining systems of equations reads as p0 (x0 ) = f (x0 ) = 3 = a0 , p1 (x1 ) = f (x1 ) = 13 = a0 + a1 (x1 − x0 ) = a0 + a1 (−5) , p2 (x2 ) = f (x2 ) = −23 = a0 + a1 (x2 − x0 ) + a2 (x2 − x0 )(x2 − x1 ) = a0 + a1 (−1) + a2 (−1)(4) . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 13 / 48 Example: Determining divided differences Example [cont.] From 3 = a0 , 13 = a0 − 5a1 , −23 = a0 − a1 − 4a2 , we can read of the coefficients of the Newton interpolation polynomial as a0 = 3 = f [1] a1 = −2 = f [1, −4] a2 = 7 = f [1, −4, 0] . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 14 / 48 Newton’s form of the interpolating polynomial With the notation of the divided differences, the Newton form of the interpolating polynomial takes the form pn (x) = n X i=0 = n X ai i−1 Y (x − xj ) j=0 f [x0 , x1 , . . . , xi ] (x − xj ) , j=0 i=0 with the convention i−1 Y Q−1 j=0 (x − xj ) := 1. n in p is f [x , x , . . . , x ] because the term Notice that the coefficient of x n 0 1 n Q xn occurs only in n−1 j=0 (x − xj ). Thus, if f is a polynomial of degree ≤ n − 1, then f [x0 , x1 , . . . , xn ] = 0 leading to a Newton interpolating polynomial of degree ≤ n − 1, too. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 15 / 48 Computing the divided differences (1/ 2) The determining system of the coefficients (a.k.a. the divided differences) f (x0 ) = a0 , f (x1 ) = a0 + a1 (x1 − x0 ) , f (x2 ) = a0 + a1 (x2 − x0 ) + a2 (x2 − x0 )(x2 − x1 ) , etc. can be rewritten as f (xk ) = k X i=0 ai i−1 Y (xk − xj ) , for 0 ≤ k ≤ n . j=0 It is evident, that the computation of the coefficients can be performed recursively. E.g. a1 can be computed once a0 is known, a2 can be computed once a0 and a1 are known and so on. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 16 / 48 Computing the divided differences (2/ 2) We rewrite f (xk ) = Pk f (xk ) = ak k−1 Y i=0 ai Qi−1 j=0 (xk (xk − xj ) + − xj ) as k−1 X ai i=0 j=0 i−1 Y (xk − xj ) , j=0 and get f (xk ) − ak = k−1 X i=0 ai i−1 Y (xk − xj ) j=0 k−1 Y (xk − xj ) j=0 which allows a recursive computation of the coefficients ai = f [x0 , x1 , . . . , xi ]. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 17 / 48 Algorithm for computing the divided differences Algorithm (Divided Differences) 1. 2. Set f [x0 ] = f (x0 ). For k = 1, 2, . . . , n compute f [x0 , x1 , . . . , xk ] via f (xk ) − f [x0 , x1 , . . . , xk ] = k−1 X f [x0 , x1 , . . . , xi ] i−1 Y (xk − xj ) j=0 i=0 k−1 Y (xk − xj ) j=0 The divided differences f [x0 ], f [x0 , x1 ], . . . , f [x0 , x1 , . . . , xn ] can thus be computed at the cost of 13 n(3n + 1) additions, (n − 1)(n − 2) multiplications and n divisions. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 18 / 48 The first four divided difference Example Use our algorithm to write out the divided difference formulas for f [x0 ], f [x0 , x1 ], f [x0 , x1 , x2 ] and f [x0 , x1 , x2 , x3 ]. We have: f [x0 ] = f (x0 ) f (x1 ) − f [x0 ] f [x0 , x1 ] = x1 − x0 f (x2 ) − f [x0 ] − f [x0 , x1 ](x2 − x0 ) f [x0 , x1 , x2 ] = (x2 − x0 )(x2 − x1 ) f [x0 , x1 , x2 , x3 ] = f (x3 ) − f [x0 ] − f [x0 , x1 ](x3 − x0 ) − f [x0 , x1 , x2 ](x3 − x0 )(x3 − x1 ) (x3 − x0 )(x3 − x1 )(x3 − x2 ) Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 19 / 48 Improving the Computation of the Divided Differences Improving the computation of the divided differences We have just derived an algorithm that computes the divided differences f [x0 ], f [x0 , x1 ], . . . , f [x0 , x1 , . . . , xn ] at the cost of 13 n(3n + 1) additions, (n − 1)(n − 2) multiplications and n divisions. In this section, we will improve this result such that our new algorithm requires only ■ ■ n(n + 1) additions, 12 n(n + 1) divisions, and the storage of just three statements (!). The tools that allow for the derivation of this algorithm are ■ ■ the recursive property of the divided differences, and the invariance theorem for divided differences. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 21 / 48 The recursive property of the divided differences Theorem (Recursive Property of the Divided Differences) The divided differences obey the formula f [x0 , x1 , . . . , xk ] = f [x1 , x2 , . . . , xk ] − f [x0 , x1 , . . . , xk−1 ] xk − x0 For instance, this allows the computation of f [x0 , x1 , x2 ] via the scheme f [x0 ] i→ f [x0 , x1 ] f [x1 ] i→ i→ f [x0 , x1 , x2 ] f [x1 , x2 ] f [x2 ] Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 22 / 48 Proof of the recursive property (1/ 3) Since f [x0 , x1 , . . . , xk ] was defined to be equal to the coefficient ak in the Newton form of the interpolating polynomial pk (x) = k X i=0 ai i−1 Y (x − xj ) , j=0 we say that f [x0 , x1 , . . . , xk ] is the coefficient of xk in the polynomial pk of degree ≤ k which interpolates the function f at the points x0 , x1 , . . . , xk . Similarly, f [x1 , x2 , . . . , xk ] is the coefficient of xk−1 in the polynomial q of degree ≤ k − 1 which interpolates the function f at the points x1 , x2 , . . . , xk . And finally, we can interpret f [x0 , x1 , . . . , xk−1 ] as the coefficient of xk−1 in the polynomial pk−1 of degree ≤ k − 1 which interpolates the function f at the points x0 , x1 , . . . , xk−1 . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 23 / 48 Proof of the recursive property (2/ 3) We have ■ ■ ■ f [x0 , x1 , . . . , xk ] is the coefficient of xk in the polynomial pk , f [x1 , x2 , . . . , xk ] is the coefficient of xk−1 in the polynomial q, and f [x0 , x1 , . . . , xk−1 ] is the coefficient of xk−1 in the polynomial pk−1 . These three polynomials pk , q and pk−1 are related as follows: x − xk (q(x) − pk−1 (x)) . pk (x) = q(x) + xk − x0 ! To establish this, we utilize the interpolation properties of pk , q and pk−1 . First, we see that the right hand side is a polynomial of degree at most k. Next, we evaluate the right hand side at xi , i = 1, . . . , k − 1. This gives xi − xk xi − xk q(xi ) + (q(xi ) − pk−1 (xi )) = f (xi ) + (f (xi ) − f (xi )) xk − x0 xk − x0 = f (xi ) . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 24 / 48 Proof of the recursive property (3/ 3) Similarly, evaluating q(x) + x − xk (q(x) − pk−1 (x)) xk − x0 at x0 and xk gives f (x0 ) and f (xk ), respectively. Thus, both sides of the identity are interpolating the same k + 1 points and are polynomials with a degree at most k. Thus, their difference is a polynomial of degree at most k that vanishes at k + 1 points. Hence, the two sides are equal. Finally, as the coefficient of xk−1 in q is f [x1 , x2 , . . . , xk ] and that of xk−1 in pk−1 is f [x0 , x1 , . . . , xk−1 ], we have that the coefficient of xk on the right hand side of the equation is f [x1 , x2 , . . . , xk ] − f [x0 , x1 , . . . , xk−1 ] . xk − x0 Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 25 / 48 The invariance property of the divided differences Notice that f [x0 , x1 , . . . , xk ] is not changed if the nodes x0 , x1 , . . . , xk are permuted. Thus, e.g., we have f [x0 , x1 , x2 ] = f [x1 , x2 , x0 ] . The reason is that f [x0 , x1 , x2 ] is the coefficient of x2 in the quadratic polynomial p2 interpolating f at x0 , x1 and x2 , whereas f [x1 , x2 , x0 ] is the coefficient of x2 in the quadratic polynomial q2 interpolating f at x1 , x2 and x0 . Due to the uniqueness and existence theorem of polynomial interpolation these two polynomials are of course the same. This implies the following theorem: Theorem (Recursive Property of the Divided Differences) The divided difference f [x0 , x1 , . . . , xk ] is invariant under all permutations of the arguments x0 , x1 , . . . , xk . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 26 / 48 Generalization of the divided difference formula ... As the variables x0 , x1 , . . . , xk and k are arbitrary, the recursive formula can also be written as f [xi , xi+1 , . . . , xj−1 , xj ] = f [xi+1 , xi+2 , . . . , xj ] − f [xi , xi+1 , . . . , xj−1 ] xj − xi The first three divided differences are thus f [xi ] = f (xi ) f [xi+1 ] − f [xi ] f [xi , xi+1 ] = xi+1 − xi f [xi+1 , xi+2 ] − f [xi , xi+1 ] f [xi , xi+1 , xi+2 ] = . xi+2 − xi Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 27 / 48 ... and the divided difference table As an illustration for n = 3, this leads to the following divided difference table for an arbitrary function f : x x0 f [] f [x0 ] f[ , ] i→ x1 i→ x3 f [x0 , x1 , x2 ] f [x1 , x2 ] f [x2 ] i→ i→ i→ f[ , , , ] f [x0 , x1 ] f [x1 ] i→ x2 f[ , , ] f [x0 , x1 , x2 , x3 ] f [x1 , x2 , x3 ] f [x2 , x3 ] f [x2 ] In this table, the coefficients along the top diagonal are the ones needed to form the Newton form of the interpolating polynomial p3 . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 28 / 48 Example: Set-up of a divided difference table Example Construct a divided difference table for the function f given in the following data table, and write out the Newton form of the interpolating polynomial: x f (x) 1 3 3 2 13 4 0 3 2 5 3 We apply the just derived formulas for the divided differences: f [xi ] = f (xi ) f [xi+1 ] − f [xi ] f [xi , xi+1 ] = xi+1 − xi f [xi+1 , xi+2 ] − f [xi , xi+1 ] , and so on f [xi , xi+1 , xi+2 ] = xi+2 − xi Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 29 / 48 Example: Set-up of a divided difference table Example [cont.] Thus, for x f (x) 1 3 3 2 13 4 0 3 2 5 3 the first entry of the divided difference table for f reads as f [1, 3 2] = f [ 23 ] − f [1] = 3 2 −1 13 4 3 2 − 3) 1 = , 2 −1 and, for instance, after completion of the columns for f [] and f [ , ] the first entry f [ , , ] is given as f [1, 32 , 0] = Prof. Dr. Florian Rupp 1 1 − f [ 23 , 0] − f [1, 32 ] 1 6 2 = = . 0−1 0−1 3 GUtech 2016: Numerical Methods – 30 / 48 Example: Set-up of a divided difference table Example [cont.] Finally, the complete divided difference table for f reads as x 1 f [] 3 f[ , ] i→ 3 2 i→ 3 i→ 2 5 3 f[ , , , ] 1 2 13 4 i→ 0 f[ , , ] 1 6 − 23 1 3 i→ i→ −2 − 35 Thus, we obtain p3 (x) = 3 + 12 (x − 1) + 31 (x − 1)(x − 32 ) − 2(x − 1)(x − 32 )x . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 31 / 48 Classroom problem: Set-up of a divided difference table Classroom Problem Construct a divided difference table for the function f given in the following data table, and write out the Newton form of the interpolating polynomial: x f (x) 1 3 −4 13 0 −23 Use the just derived formulas for the divided differences: f [xi ] = f (xi ) f [xi+1 ] − f [xi ] f [xi , xi+1 ] = xi+1 − xi f [xi+1 , xi+2 ] − f [xi , xi+1 ] f [xi , xi+1 , xi+2 ] = . xi+2 − xi Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 32 / 48 Classroom problem: Set-up of a divided difference table Classroom Problem [Solution] x 1 f [] 3 f[ , ] i→ −4 −2 13 i→ i→ 0 f[ , , ] 7 −9 −23 Thus we obtain p2 (x) = 3 − 2(x − 1) + 7(x − 1)(x + 4) . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 33 / 48 Interpolation with Monomials and the Vandermode Matrix Approximation with basis functions ... Another view of interpolation is that for a given set of n + 1 data points x f (x) = y x0 y0 x1 y1 x2 y2 ... ... xn yn we want to express an interpolating function f (x) as a linear combination of a set of basis functions ϕ0 , ϕ1 , . . . , ϕn such that f (x) ≈ c0 ϕ0 (x) + c1 ϕ1 (x) + · · · + cn ϕn (x) , where the coefficients c0 , c1 , . . . , cn are to be determined. We want the function f to interpolate the data (xi , yi ), i.e., we want to have linear equations in c0 , c1 , . . . , cn of the form f (xi ) = c0 ϕ0 (xi ) + c1 ϕ1 (xi ) + · · · + cn ϕn (xi ) = yi , for each i = 0, 1, . . . , n. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 35 / 48 ... leads naturally to linear systems This is a system of linear equations Ac = y , where the entries of the coefficient matrix A are given by ai,j = ϕj (xi ), which is the value of the jth basis function evaluated at the ith data point. The right-hand side vector y contains the known data values yi , and the components of the vector c are the unknown coefficients ci . Thus, in principle interpolation is nothing else than solving a linear system . . . Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 36 / 48 Monomials as basis functions for polynomial interpolation (1/ 2) ... The natural basis for the vector space Pn of all polynomials up to degree n consists of monomials ϕ0 (x) = 1 , ϕ1 (x) = x , ϕ2 (x) = x2 , ϕn (x) = xn . ... Consequently, a interpolation polynomial pn has the form pn (x) = c0 + c1 x + c2 x2 + · · · + cn xn , and the associates linear 1 x0 x20 . . . 1 x1 x2 . . . 1 1 x2 x2 . . . 2 .. .. .. . . . . . . 1 xn x2n Prof. Dr. Florian Rupp system Ac = y reads n c0 x0 c1 xn1 n x2 c2 = .. .. . . cn . . . xnn as y0 y1 y2 .. . yn . GUtech 2016: Numerical Methods – 37 / 48 Monomials as basis functions for polynomial interpolation (2/ 2) ... Sketch of the first few monomials on [−1, 1]: φ0 = 1 1 2 0.8 φ2 = x 0.6 0.4 0.2 φ4 = x4 0 −0.2 3 −0.4 φ3 = x −0.6 −0.8 φ1 = x −1 −1 Prof. Dr. Florian Rupp −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 GUtech 2016: Numerical Methods – 38 / 48 ... may not be the smartest choice The coefficient matrix is the well-known Vandermonde matrix. We already know that it is regular provided the points x0 , x1 , . . . , xn are distinct. So, in principle, we can solve the polynomial interpolation problem. Although, the Vandermonde matrix is invertible, we know that it is ill-conditioned as n increases: For large n, the monomials are less distinguishable from one another (see the figure on the previous slide). Thus, the columns of the Vandermonde matrix become nearly dependent in this case. Moreover, high-degree polynomials often oscillate widely and are highly sensitive to small changes in the data. Up to now, we have discussed three choices for the basis functions of Pn : the Lagrange polynomials li (x), the Newton polynomials πi , and the monomials. It turns out that there are better choices for the basis functions; namely, the Chebysev polynomials have more desirable features. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 39 / 48 The Chebysev polynomials ... The Chebysev polynomials play an important role in mathematics because they have several special properties such as the recursive relation T0 (x) = 1 , T1 (x) = x Ti (x) = 2xTi−1 (x) − Ti−2 (x) for i = 2, 3, 4, . . . . Thus, the first six Chebysev polynomials are T0 (x) = 1 , T1 (x) = x , T4 (x) = 8x4 − 8x2 + 1 , T2 (x) = 2x2 − 1 , T3 (x) = 4x3 − 3x , T5 (x) = 16x5 − 20x3 + 5x . The Chebysev polynomials are usually employed on the interval [−1, 1]. With change of variable, they can be used on any interval. E.g., substituting x by cos(t) allows for their use on the interval [0, 2π]. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 40 / 48 ... their graphs ... Sketch of the first few Chebysev polynomials on [−1, 1]: T0(x) 1 T1(x) 0.8 0.6 T2(x) 0.4 0.2 0 −0.2 T (x) 3 −0.4 −0.6 T4(x) −0.8 T5(x) −1 −1 Prof. Dr. Florian Rupp −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 GUtech 2016: Numerical Methods – 41 / 48 ... and the equal oscillation property One of the important properties of the Chebysev polynomials is the equal oscillation property. Notice in the previous figure that successive extreme points of the Chebysev polynomials are equal in magnitude and alternate in sign. This property tends to distribute the error uniformly when Chebysev polynomials are used as basis functions. In polynomial interpolation for continuous functions, it is particularly advantageous to select as the interpolation points the roots or the extreme points of a Chebysev polynomial. This causes the maximum error over the interval of the interpolation to be minimized. (We will illustrate this effect next time.) Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 42 / 48 Summary & Outlook Major concepts covered today (1/ 4): Newton’s form ■ The Newton form of the interpolation polynomial is pn (x) = n X i=0 ai i−1 Y (x − xj ) . j=0 with divided differences ai ■ f [x1 , x2 , . . . , xi ] − f [x0 , x1 , . . . , xi−1 ] = f [x0 , x1 , . . . , xi ] = xi − x0 The Lagrange and the Newton form are just two different representations of the unique polynomial p of degree n that interpolates a table of n + 1 pairs of points (xi , f (xi )) for i = 0, 1, . . . , n. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 44 / 48 Major concepts covered today (2/ 4): polynomial interpolation example ■ We illustrate the Lagrange and Newton form with the aid of a small table for n = 2: x f (x) x0 f (x0 ) x1 f (x1 ) x2 f (x2 ) The Lagrange interpolation polynomial is (x − x1 )(x − x2 ) (x − x0 )(x − x2 ) p2 (x) = f (x0 ) + f (x1 ) (x0 − x1 )(x0 − x2 ) (x1 − x0 )(x1 − x2 ) (x − x0 )(x − x1 ) + f (x2 ) (x2 − x0 )(x2 − x1 ) Clearly, p2 (x0 ) = f (x0 ), p2 (x1 ) = f (x1 ) and p2 (x2 ) = f (x2 ). Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 45 / 48 Major concepts covered today (3/ 4): polynomial interpolation example ■ Next, we form the divided difference table x x0 f [] f [x0 ] f[ , ] i→ x1 f [x0 , x1 ] f [x1 ] i→ i→ x2 f[ , , ] f [x0 , x1 , x2 ] f [x1 , x2 ] f [x2 ] Using the divided difference entries from the top diagonal, we have p2 (x) = f [x0 ] + f [x0 , x1 ](x − x0 ) + f [x0 , x1 , x2 ](x − x0 )(x − x1 ) . Again, it can be easily shown that p2 (x0 ) = f (x0 ), p2 (x1 ) = f (x1 ) and p2 (x2 ) = f (x2 ). Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 46 / 48 Preparation for the next lecture (1/ 2) Please, prepare these short exercises for the next lecture: 1. Page 175, exercise 10 a Use a divided differences table to construct Newton’s interpolation polynomial for the following data: x f (x) 0 7 2 11 3 28 4 63 2. Page 175, exercise 10 b Without simplifying the Newton interpolation polynomial obtained above, write this polynomial in nested form for easy evaluation. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 47 / 48 Preparation for the next lecture (2/ 2) Please, prepare these short exercises for the next lecture: 3. Page 176, exercise 22 Find a polynomial of least degree that takes these values: x f (x) = y 1.73 0 1.82 0 2.61 7.8 5.22 0 8.26 0 Hint: Rearrange the table so that the non-zero value of f (x) is the last entry, or think of some better way. Prof. Dr. Florian Rupp GUtech 2016: Numerical Methods – 48 / 48
© Copyright 2025 Paperzz