Professional Documents
Culture Documents
Sec 4-1
Sec 4-1
y = cos(x)
y = p (x)
2
x
π/4 π/2
PURPOSES OF INTERPOLATION
y=tan(x)
1 1.3 x
y = tan(x)
y = p (x)
1
x
1.1 1.2
QUADRATIC INTERPOLATION
P2(xi) = yi, i = 0, 1, 2
for given data points (x0, y0) , (x1, y1) , (x2, y2). One
formula for such a polynomial follows:
The functions
(x−x )(x−x ) (x−x )(x−x )
L0(x) = (x −x1)(x −x2 ) , L1(x) = (x −x0)(x −x2 )
0 1 0 2 1 0 1 2
(x−x )(x−x )
L2(x) = (x −x0)(x −x1 )
2 0 2 1
are called ‘Lagrange basis functions’ for quadratic in-
terpolation. They have the properties
(
1, i = j
Li(xj ) =
0, i =
6 j
for i, j = 0, 1, 2. Also, they all have degree 2. Their
graphs are on an accompanying page.
Introduce
R(x) = P2(x) − Q(x)
From the properties of P2 and Q, we have deg(R) ≤
2. Moreover,
R(xi) = P2(xi) − Q(xi) = yi − yi = 0
for all three node points x0, x1, and x2. How many
polynomials R(x) are there of degree at most 2 and
having three distinct zeros? The answer is that only
the zero polynomial satisfies these properties, and there-
fore
R(x) = 0 for all x
x1 − x0 = x2 − x1
EXAMPLE
We can show
yi = f (xi), i = 0, 1, ..., n
Using the divided differences
Let
d1 = f [x0, x1]
d2 = f [x0, x1, x2]
..
dn = f [x0, ..., xn]
Then the formula
Pn(x) = f (x0) + f [x0, x1] (x − x0)
+f [x0, x1, x2] (x − x0) (x − x1)
+f [x0, x1, x2, x3] (x − x0) (x − x1) (x − x2)
+···
+f [x0, ..., xn] (x − x0) · · · (x − xn−1)
can be written as
Pn(x) = f (x0) + (x − x0) (d1 + (x − x1) (d2 + · · ·
+(x − xn−2) (dn−1 + (x − xn−1) dn) · · · )
Thus we have a nested polynomial evaluation, and
this is quite efficient in computational cost.