MA/CS 321
Spring 2024
Lecture 18: Polynomial Interpolation
Given a set of distinct points, (xi , yi ) for i = 0, 1, . . . , n, we want to find a polynomial of lowest
possible degree whose graph passes through all the points, which is called polynomial interpolation.
Definition 1. Given a set of distinct points, (xi , yi ) for i = 0, 1, . . . , n, a polynomial p(x) for which
p(xi ) = yi for 0 ≤ i ≤ n is said to interpolate all the points, and xi ’s are called nodes.
Example 1. Given two distinct points (x0 , y0 ) and (x1 , y1 ), the polynomial
p(x) =
x − x0
x − x1
y0 +
y1
x0 − x1
x1 − x0
interpolates the two points. Here we can verify that p(x0 ) = y0 and p(x1 ) = y1 , and p(x) is called
linear interpolating polynomial.
In general, given n + 1 distinct points x0 , x1 , . . . , xn and their function values yi = f (xi ), we want
to find a polynomial pn (x) of degree at most n such that pn (xi ) = f (xi ) for i = 0, . . . , n.
First, we define a system of n+1 special polynomials of degree n known as cardinal polynomials,
denoted as `i ,
n
Y
x − xj
(x − x0 ) · · · (x − xi−1 )(x − xi+1 ) · · · (x − xn )
`i (x) =
=
(xi − x0 ) · · · (xi − xi−1 )(xi − xi+1 ) · · · (xi − xn )
x
i − xj
j=0
j6=i
for i = 0, . . . , n. We can show that they satisfy the property
(
0 if i 6= j,
`i (xj ) = δij =
1 if i = j.
Here
Pn δij is the Kronecker delta function which gives 0 if i 6= j and 1 if i = j. It is easy to see that
j=1 δij aj = ai .
Next, we define the Lagrange form of the interpolating polynomial (also called the Lagrange
polynomial) as
n
X
pn (x) =
`i (x)f (xi )
i=0
which is a linear combination of `i ’s. We can verify that it indeed interpolates all the given points:
pn (xj ) =
n
X
`i (xj )f (xi ) =
i=0
n
X
δij f (xi ) = f (xj ).
i=0
Example 2. Use x0 = 1, x1 = 2, x2 = 3 to find the Lagrange polynomial p2 (x) for f (x0 ) = 1, f (x1 ) =
−1, f (x2 ) = 5.
Solution.
(x − x1 )(x − x2 )
(x − 2)(x − 3)
1
=
= (x − 2)(x − 3)
(x0 − x1 )(x0 − x2 )
(1 − 2)(1 − 3)
2
(x − x0 )(x − x2 )
(x − 1)(x − 3)
`1 (x) =
=
= −(x − 1)(x − 3)
(x1 − x0 )(x1 − x2 )
(2 − 1)(2 − 3)
(x − x0 )(x − x1 )
(x − 1)(x − 2)
1
`2 (x) =
=
= (x − 1)(x − 2).
(x2 − x0 )(x2 − x1 )
(3 − 1)(3 − 2)
2
`0 (x) =
1
MA/CS 321
Spring 2024
Thus
p2 (x) =
2
X
i=0
1
1
`i (x)f (xi ) = 1 × (x − 2)(x − 3) − (−1) × (x − 1)(x − 3) + 5 × (x − 1)(x − 2)
2
2
That is p2 (x) = 4x2 − 14x + 11.
In Example 2, we can rewrite it as
p2 (x) = 1 + (x − 1) [−2 + 4(x − 2)] = 1 − 2(x − 1) + 4(x − 1)(x − 2).
which is called the Newton form. We can use a recursive way to get the Newton form. Let pi (x) be
the interpolating polynomial that interpolates the points (x0 , y0 ), . . . , (xi−1 , yi−1 ). Then we start with
the constant function
p0 = f (x0 )
and assume pi (x) = pi−1 (x) + ai Πi−1
j=0 (x − xj ) for i = 1, 2, . . .. For example, when i = 1, we assume
p1 (x) = p0 + a1 (x − x0 ) where a1 is to be determined. Substitution of x = x1 and p1 (x1 ) = f (x1 ) gives
a1 =
f (x1 ) − f (x0 )
y1 − y0
=
.
x1 − x0
x1 − x0
Similarly, we can get the values of all ai ’s.
Revisit Example 2: We start with p0 = y0 = 1 and then assume p1 = p0 + a1 (x − x0 ). To
determine a1 , we use the newly added interpolation point (x1 , y1 ) and plugging it to p1 :
p1 (x1 ) = 1 + a1 (x1 − x0 )
− 1 = 1 + a1 (2 − 1)
⇒
a1 = −2.
Next we assume that p2 (x) = p1 (x) + a2 (x − x0 )(x − x1 ). To determine a2 , we plug (x2 , y2 ) into p2
and notice p2 (x2 ) = f (x2 ).
p2 (x2 ) = 1 − 2(x2 − x0 ) + a2 (x2 − x0 )(x2 − x1 )
⇒
a2 = 4.
Therefore, p2 = 1 − 2(x − 1) + 4(x − 1)(x − 2) which is the desired Newton form of the interpolating
polynomial.
2