Alternatively a quick informal approach is to equate

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ne) that interpolates the data (x0 , y0 ) and (x1 , y1 ). Answer. Let p(x) = a0 + a1 x. Then solve the simultaneous equations p ( x0 ) = y 0 p ( x1 ) = y 1 =⇒ a0 + a1 x0 = y0 =⇒ a0 + a1 x1 = y1 to obtain a0 and a1 . Alternatively, a quick informal approach is to equate the ratios y1 − y0 p ( x) − y0 = , x − x0 x 1 − x0 and then rearrange to obtain y1 − y0 ( x − x0 ) . p ( x) = y 0 + x 1 − x0 Example. Find the interpolating polynomial through the points (−2, 4), (−1, 2), (0, −3), (1, 5), (3, 4). Answer. We have 5 data points. The interpolating polynomial has degree 4. See Matlab polinterp1.m. 2 Polynomial interpolation in Lagrange form n + 1 data points: (xj , yj ) for j = 0, . . . , n Lagrange polynomials of degree n as basis functions: n i ( x) x − xj xi − xj = j =0 j =i i ( xj ) = 1 for i = j , and i ( xj ) for i = 0, . . . , n = 0 if i = j Interpolating polynomial of degree n: p(x) = No linear system to solve, but i ( x) n i=0 y i i ( x) difficult to evaluate If f ∈ C n+1 ([a, b]), i.e., n + 1 times continually differentiable in [a, b], then the error in approximating f (x) by p(x) is f (n+1) (ξ ) f ( x) − p ( x) = (n + 1)! n ( x − xj ) j =1 for some unknown ξ ∈ [a, b] depending on x. Mat...
View Full Document

This note was uploaded on 05/26/2013 for the course MATHEMATIC 2089 taught by Professor Briancox during the Fall '13 term at National University of Singapore.

Ask a homework question - tutors are online