MAT 3633 Note 1

Lagrange Interpolation
Lucio Tavernini
August 15, 2011
Contents
1.1 The Lagrange Interpolating Polynomial . . . . . . . . . 21
1.2 The Error in Lagrange Interpolation . . . . . . . . . . . 23
1.3 Divided Differences . . . . . . . . . . . . . . . . . . . . . 25
1.4 Computing with Divided Differences . . . . . . . . . . . 28
1.5 Interpolation Using Equidistant Points . . . . . . . . . 30
1.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.1 The Lagrange Interpolating Polynomial
1.1.1 Definition (Degree of a Polynomial). The polynomial
a
n
x
n
+ a
n−1
x
n−1
+· · · + a
1
x + a
0
in x has degree n if a
n
= 0. This defines the degree of every polynomial except one,
the zero polynomial p(x) = 0. The degree of the zero polynomial is undefined.
1.1.2 Remark. The number x

is called a zero of the polynomial p if p(x

) = 0.
The zero polynomial has infinitely many zeros. A polynomial of degree zero has
no zeros. A polynomial of degree at least one may have no zeros unless we go to
the complex numbers.
1
1
The field R is not algebraically closed, but the complex field C is.
21
Note 1: Lagrange Interpolation – August 15, 2011 22
We have the Fundamental Theorem of Algebra: Every polynomial over the com-
plex numbers C of positive degree has at least one zero. Thus, if p is a polynomial
of degree n ≥ 1 and and x

is a zero of p, then we have p(x) = q(x)(x−x

), where
q is a polynomial of degree n −1. It follows that if p is a polynomial with m + 1
distinct zeros x
0
, x
1
, . . . , x
m
, then p is a polynomial of the form
p(x) = c(x −x
0
)(x −x
1
) · · · (x −x
m
),
where c is some constant not equal to zero. In other words, p is a polynomial of
degree m + 1, since the coefficient of the leading power x
m+1
is c = 0.
1.1.3 Remark. The theorem given below states that there is a unique solution to
a generalization of the problem of passing a line through two points, a parabola
through three points, an so on; provided that each data point lies on a unique
vertical line
1.1.4 Theorem (Lagrange Interpolation). Given n+1 data points (x
0
, y
0
), . . . , (x
n
, y
n
)
in the plane, with x
i
= x
j
for i = j, there is a unique polynomial p of degree at
most n that interpolates the given data, i.e.: such that p(x
i
) = y
i
for i = 0, . . . , n.
Proof. First we show existence.
To show existence of an interpolating polynomial we use Lagrange’s interpo-
lation formula (given by (1) and (2)) for representing it. The reasoning goes as
follows.
Suppose that we have n + 1 polynomials L
0
, . . . , L
n
of degree n such that
L
i
(x
j
) =
_
0, i = j,
1, i = j.
Define the polynomial p by
(1) p(x) =
n

i=0
L
i
(x)y
i
.
Clearly, p is a polynomial of degree at most n, since each of the L’s is a polynomial
of degree n. Further, we have
p(x
j
) =
n

i=0
L
i
(x
j
)y
i
= L
j
(x
j
)y
j
= y
j
,
for j = 0, . . . , n. In other words, p interpolates the given data.
Now, we construct the L’s. The polynomial (x − x
0
) · · · (x −x
n
) has the zeros
x
0
, . . . , x
n
. So, to remove x
i
from this list, we use the polynomial
(x −x
0
) · · · (x −x
i−1
)(x −x
i+1
) · · · (x −x
n
).
Note 1: Lagrange Interpolation – August 15, 2011 23
Finally, to obtain L
i
(x
i
) = 1, we divide by a constant. We obtain
(2) L
i
(x) =
(x −x
0
) · · · (x −x
i−1
)(x −x
i+1
) · · · (x −x
n
)
(x
i
−x
0
) · · · (x
i
−x
i−1
)(x
i
−x
i+1
) · · · (x
i
−x
n
)
.
Note that since the x’s are distinct, we never divide by zero. Each L
i
is called a
Lagrange coefficient polynomial.
Now, we prove uniqueness. To prove uniqueness, we argue that any two inter-
polating polynomials of degree at most n are identical. To this end, suppose that
p and q are polynomials of degree at most n that interpolate the given data. This
means that
p(x
i
) = y
i
and q(x
i
) = y
i
for i = 0, . . . n.
Define the polynomial P = p −q. Then P is a polynomial of degree at most n
also (since p and q are). Moreover
P(x
i
) = p(x
i
) −q(x
i
) = y
i
−y
i
= 0 for i = 0, . . . , n.
In other words,
P(x) = c(x −x
0
)(x −x
1
) · · · (x −x
n
),
where c is some constant and x
i
= x
j
for i = j.
We have a contradiction, there is no polynomial P degree at most n with n +1
distinct zeros. There is only one polynomial that satisfies our requirement: the zero
polynomial P(x) = 0 for all x. Therefore, p = q. That is, any two interpolating
polynomials are identical.
1.2 The Error in Lagrange Interpolation
1.2.1 Definition (The Interpolation Error). Given the function f : [a, b] → R
and given n + 1 distinct points x
0
, . . . , x
n
in [a, b], let p
n
denote the polynomial of
degree at most n that interpolates f at the given points. In other words, p
n
is such
that p
n
(x
i
) = f(x
i
) for i = 0, . . . , x
n
.
Using Lagrange’s formula, we see that p
n
can be written
(1) p
n
(x) =
n

i=0
L
i
(x)f(x
i
),
where the L
i
are the Lagrange coefficient polynomials given by
L
i
(x) =
(x −x
0
) · · · (x −x
i−1
)(x −x
i+1
) · · · (x −x
n
)
(x
i
−x
0
) · · · (x
i
−x
i−1
)(x
i
−x
i+1
) · · · (x
i
−x
n
)
.
Note 1: Lagrange Interpolation – August 15, 2011 24
Define the interpolation error E(x) = f(x)−p
n
(x) for x in [a, b]. We can obtain
a useful expression for E(x), provided f is sufficiently differentiable, as we show
below.
1.2.2 Proposition. Let x
0
, . . . , x
n
be n + 1 distinct real numbers. Let t be any
real number. Define a and b by
a = min{t, x
0
, . . . , x
n
},
b = max{t, x
0
, . . . , x
n
}.
Let f be a real-valued function defined on [a, b] with n + 1 continuous derivatives.
Let p
n
denote the polynomial of degree at most n that interpolates f at x
0
, . . . , x
n
.
Then, there exists a number τ in (a, b) such that
E(t) = f(t) −p
n
(t) =
(t −x
0
) · · · (t −x
n
)
(n + 1)!
f
(n+1)
(τ).
(Note the similarity between the above and the remainder in Taylor’s formula.)
Proof. Note that if a = b there is nothing to prove. The result is true if t = x
i
for
i = 0, . . . , n. So, we proceed for t = x
i
. Fix t and define
G(x) = E(x) −
Ψ(x)
Ψ(t)
E(t),
for all x in [a, b], where
Ψ(x) = (x −x
0
) · · · (x −x
n
).
Because E and Ψ are n +1 times continuously differentiable functions, so is G.
Note that for i = 0, . . . , x
n
we have
G(x
i
) = E(x
i
) −
Ψ(x
i
)
Ψ(t)
E(t) = 0,
and
G(t) = E(t) −
Ψ(t)
Ψ(t)
E(t) = 0.
Thus, G has n+2 distinct zeros in [a, b]. By the mean value theorem, its derivative
G

has n + 1 distinct zeros in (a, b). We proceed by induction: G
(j)
has n + 2 − j
distinct zeros in (a, b) for j = 1, . . . , n + 1..
Thus, G
(n+1)
has at least one zero in (a, b). Let τ denote any such zero, i.e.:
G
(n+1)
(τ) = 0.
Note 1: Lagrange Interpolation – August 15, 2011 25
Because
E
(n+1)
(x) = f
(n+1)
(x)
and
Ψ
(n+1)
(x) = (n + 1)!
we obtain
G
(n+1)
(x) = f
(n+1)
(x) −
(n + 1)!
Ψ(t)
E(t),
which gives
0 = G
(n+1)
(τ) = f
(n+1)
(τ) −
(n + 1)!
Ψ(t)
E(t),
whence
E(t) =
Ψ(t)
(n + 1)!
f
(n+1)
(τ).
1.2.3 Remark. We have obtained the representation of f
(1) f(t) = p
n
(t) +
(t −x
0
) · · · (t −x
n
)
(n + 1)!
f
(n+1)
(τ),
where min{t, x
0
, . . . , x − n} < τ < max{t, x
0
, . . . , x
n
}. Compare the above with
the representation
f(t) = p(t) +
(t −x
0
)
n+1
(n + 1)!
f
(n+1)
(τ),
where min{t, x
0
} < τ < max{t, x
0
}. Here, p is the Taylor polynomial of f at x
0
,
(2) p(t) =
n

i=0
(t −x
0
)
i
i!
f
(i)
(x
0
).
We see that (1) is some sort of a discrete analogue of (2). There is a much nicer
way to represent the interpolating polynomial (1) that brings out this analogy. The
representation uses divided differences.
1.3 Divided Differences
1.3.1 Definition. Let f : [a, b] → R be sufficiently differentiable. Let p
n
de-
note the polynomial of degree at most n that interpolates f at the distinct points
x
0
, . . . , x
n
in [a, b]. We want to find a way to obtain p
n
from p
n−1
. To this end, we
write
(1) p
n
(x) = p
n−1
(x) + c
n
(x),
Note 1: Lagrange Interpolation – August 15, 2011 26
where we think of c
n
as a “correction term” we add to p
n−1
to obtain p
n
. Can we
find a simple way to represent c
n
?
First, we observe that
c
n
(x
i
) = p
n
(x
i
) −p
n−1
(x
i
)
= f(x
i
) −f(x
i
)
= 0
for i = 0, . . . , n − 1. Since c
n
must be a polynomial of degree at most n, it must
be the polynomial
c
n
(x) = a
n
(x −x
0
) · · · (x −x
n−1
),
where the coefficient a
n
is to be determined. Note: If a
n
= 0, c
n
is the zero
polynomial; otherwise, c
n
is a polynomial of degree n.
We obtain
a
n
(x
n
−x
0
) · · · (x
n
−x
n−1
) = c
n
(x
n
)
= p
n
(x
n
) −p
n−1
(x
n
)
= f(x
n
) −p
n−1
(x
n
),
since p
n
(x
n
) = f(x
n
), giving
a
n
=
f(x
n
) −p
n−1
(x
n
)
(x
n
−x
0
) · · · (x
n
−x
n−1
)
.
The coefficient a
n
is called is called the nth order divided difference and is denoted
by
a
n
= f[x
0
, . . . , x
n
].
(The notation may seem strange, but is the standard notation widely used.)
Finally, (1) yields the formula
(2) p
n
(x) = p
n−1
(x) + (x −x
0
) · · · (x −x
n−1
)f[x
0
, . . . , x
n
].
Define f[x
0
] = f(x
0
). The first three interpolating polynomials have the repre-
sentations
p
0
(x) = f[x
0
],
p
1
(x) = f[x
0
] + (x −x
0
)f[x
0
, x
1
],
p
2
(x) = f[x
0
] + (x −x
0
)f[x
0
, x
1
] + (x −x
0
)(x −x
1
)f[x
0
, x
1
, x
2
],
while p
n
has the representation
(3) p
n
(x) =
n

i=0
[(x −x
0
) · · · (x −x
i−1
)]f[x
0
, . . . , x
i
].
Note 1: Lagrange Interpolation – August 15, 2011 27
The above is known as Newton’s divided differences formula for the interpolating
polynomial.
Compare the Taylor series for f about the point x
0
f(x) = f(x
0
) + (x −x
0
)f

(x
0
) +
(x −x
0
)
2
2!
f

(x
0
) +· · ·
+
(x −x
0
)
n
n!
f
(n)
(x
0
) +
(x −x
0
)
n+1
(n + 1)!
f
(n+1)

1
)
with the interpolating polynomial approximation
f(x) = f[x
0
] + (x −x
0
)f[x
0
, x
1
] + (x −x
0
)(x −x
1
)f[x
0
, x
1
, x
2
] +· · ·
(x −x
0
) · · · (x −x
n−1
)f[x
0
, . . . , x
n
] +
(x −x
0
) · · · (x −x
n
)
(n + 1)!
f
(n+1)

2
),
where τ
1
and τ
2
are points in (a, b). The interpolating polynomial p
n
is unique.
Whether we use Lagrange’s formula or the above reprentation, we have the same
polynomial. The above representation, however, makes a pretty good case for
thinking of the interpolating polynomial as a discrete analogue of the Taylor series,
with the kth divided difference being a discrete analogue of the kth derivative. We
prove this below.
1.3.2 Proposition. If f is a real function on [a, b] with k continuous derivatives
there and x
0
, . . . , x
k
are distinct points in [a, b], then
f[x
0
, . . . , x
k
] =
f
(k)
(τ)
k!
for some τ in the smallest open interval containing x
0
, . . . , x
k
.
Proof. Thanks to 1.3.1(2) and the equality f(x
k
) = p
k
(x
k
), we have
f(x
k
) = p
k
(x
k
) = p
k−1
(x
k
) + (x
k
−x
0
) · · · (x
k
−x
k−1
)f[x
0
, . . . , x
k
],
which we rewrite as
f(x
k
) −p
k−1
(x
k
) = (x
k
−x
0
) · · · (x
k
−x
k−1
)f[x
0
, . . . , x
k
].
Thanks to Proposition 1.2.2, we obtain
f(x
k
) −p
k−1
(x
k
) =
(x
k
−x
0
) · · · (x
k
−x
k−1
)
k!
f
(k)
(τ).
From the above two equations we obtain
(x
k
−x
0
) · · · (x
k
−x
k−1
)f[x
0
, . . . , x
k
] =
(x
k
−x
0
) · · · (x
k
−x
k−1
)
k!
f
(k)
(τ),
which is the desired result.
Note 1: Lagrange Interpolation – August 15, 2011 28
1.4 Computing with Divided Differences
1.4.1 Remarks. If p is a polynomial of degree at most n, then, of course, p is of
the form
(1) p(x) = a
n
x
n
+· · · + a
1
x + a
0
.
The coefficients a
0
, . . . , a
n
are unique. Indeed, if we also have
p(x) = b
n
x
n
+· · · + b
1
x + b
0
,
then subtraction yields
(a
n
−b
n
)x
n
+· · · + (a
1
−b
1
)x + (a
0
−b
0
) = 0
for all x. Therefore, the above is the zero polynomial, whence a
i
= b
i
, settling the
issue of uniqueness. We can therefore make the following important observation
about divided differences.
1.4.2 Proposition. Let f be a real function defined on [a, b] and let x
0
, . . . , x
n
be distinct points in [a, b]. The nth divided difference f[x
0
, . . . , x
n
] is a symmetric
function of x
0
, . . . , x
n
. In other words, let (i
0
, . . . , i
n
) denote any permutation of
(0, . . . , n). We have
f[x
0
, . . . , x
n
] = f[x
i
0
, . . . , x
in
].
Proof. Let p denote the polynomial of degree at most n that interpolates f at
x
0
, . . . , x
n
. Let q denote the polynomial of degree at most n that interpolates f at
x
i
0
, . . . , x
in
. Then
p(x) =
n

j=0
L
j
(x)f(x
j
) =
n

j=0
L
i
j
(x)f(x
i
j
) = q(x).
Since p is unique, and so is its representation of the form (1), each a
k
is invariant
with respect to any permutation of (x
0
, . . . , x
n
). In particular, we have a
n
=
f[x
0
, . . . , x
n
].
1.4.3 Remarks. We compute finite differences from tabulated data as follows.
Let p
n
denote, as usual, the polynomial of degree at most n that interpolates f at
x
0
, . . . , x
n
. Let q
n−1
denote the polynomial of degree at most n−1 that interpolates
f at the points x
1
, . . . , x
n
.
Define the polynomial p of degree at most n by
p(x) =
x −x
0
x
n
−x
0
q
n−1
(x) +
x
n
−x
x
n
−x
0
p
n−1
(x).
Note 1: Lagrange Interpolation – August 15, 2011 29
We have
p(x
0
) =
x
n
−x
0
x
n
−x
0
p
n−1
(x
0
) = f(x
0
)
and
p(x
n
) =
x
n
−x
0
x
n
−x
0
n
n−1
(x
n
) = f(x
n
).
We show how to generate the table shown in Figure 1.
x
k
f
k
f[x
k
, x
k+1
] f[x
k
, . . . , x
k+2
] f[x
k
, . . . , x
k+3
]
0.0000000000 0.0000000000
0.9995833854
0.0500000000 0.0499791693 −0.0499687578
0.9970849475 −0.9968772388
0.1000000000 0.0998334166 −0.0998126198
0.9920943165 −0.9918876474
0.1500000000 0.1494381325 −0.1494070021
0.9846239664 −0.9844188535
0.2000000000 0.1986693308 −0.1986279448
0.9746925692 −0.9744895252
0.2500000000 0.2474039593 −0.2473524211
0.9623249481 −0.9621244805
0.3000000000 0.2955202067 −0.2954586451
0.9475520159 −0.9473546257
0.3500000000 0.3428978075 −0.3428263764
0.9304106971 −0.9302168777
0.4000000000 0.3894183423 −0.3893372202
0.9109438361 −0.9107540719
0.4500000000 0.4349655341 −0.4348749238
0.8892000899 −0.8890148553
0.5000000000 0.4794255386 −0.4793256666
0.8652338065 −0.8650535645
0.5500000000 0.5226872289 −0.5225783448
0.8391048893 −0.8389300903
0.6000000000 0.5646424734 −0.5645248493
0.8108786468 −0.8107097278
0.6500000000 0.6051864057 −0.6050603357
0.7806256300 −0.7804630132
0.7000000000 0.6442176872 −0.6440834864
0.7484214557 −0.7482655476
0.7500000000 0.6816387600 −0.6814967638
0.7143466175
0.8000000000 0.7173560909
Figure 1: A table of divided differences.
Note 1: Lagrange Interpolation – August 15, 2011 30
Form our present discussion, we have, for 1 ≤ i ≤ n −1,
p(x
i
) =
x
i
−x
0
x
n
−x
0
q
n−1
(x
i
) +
x
n
−x
i
x
n
−x
0
p
n−1
(x
i
)
=
x
i
−x
0
x
n
−x
0
f(x
i
) +
x
n
−x
i
x
n
−x
0
f(x
i
)
= f(x
i
).
Further, we have that p = p
n
, i.e.: p interpolates f at x
0
, . . . , x
n
. Thanks
to the uniqueness of the interpolating polynomial and to the uniqueness of the
representation of the form (1),
f[x
0
, . . . , x
n
] = leading coefficient of p(x)
=
leading coefficient of q
n−1
(x)
x
n
−x
0

leading coefficient of p
n−1
(x)
x
n
−x
0
=
f[x
1
, . . . , x
n
] −f[x
0
, . . . , x
n−1
]
x
n
−x
0
.
Beginning with tabulated values of f, as shown to the left in the table of
Figure 1, using the above relation
• we compute the column of first-order divided differences f[x
k
, x
k+1
],
• then, we proceed to compute the column of second-order divided differences
f[x
k
, x
k+1
, x
k+2
],
• then we keep going as far as we want, up to the column with the single entry
f[x
0
, . . . , x
n
].
1.5 Interpolation Using Equidistant Points
Below, we show some basic forms taken by the interpolating polynomial when the
data points are equally spaced.
1.5.1 Definition. Suppose that f is a real function defined on [a, b]. For fixed
positive integer N, define
h = (b −a)/N and x
i
= a + ih, for i = 0, . . . , N.
Thus, to every f ∈ R
[a,b]
there corresponds a unique finite sequence
{f(x
0
), f(x
1
), . . . , f(x
N
)},
Note 1: Lagrange Interpolation – August 15, 2011 31
which is an element of R
N+1
. We use the shorthand
ˆ
f = {
ˆ
f
0
,
ˆ
f
1
, . . . ,
ˆ
f
N
}
to denote such a sequence.
For the chosen N we define the forward difference operator ∆ as follows. ∆ is
a function (operator
2
)
∆ : R
N+1
→ R
N
which maps a sequence
ˆ
f ∈ R
N+1
to the sequence ∆
ˆ
f in R
N
given by
(∆
ˆ
f)
i
=
ˆ
f
i+1

ˆ
f
i
,
for i = 0, 1, . . . , N −1.
For j = 0, 1, . . . , N, we define

j
: R
N+1
→ R
N−j
by
(∆
0
ˆ
f) =
ˆ
f,
and
(∆
j+1
ˆ
f)
i
= (∆
j
ˆ
f)
i+1
−(∆
j
f)
i
,
for 0 < i ≤ N −j −1.
1.5.2 Proposition. For i = 0, . . . , N −k, we have
(1) f[x
k
, . . . , x
k+i
] =
(∆
i
ˆ
f)
k
i!h
i
.
Proof. The proof is by induction on i. The assertion is true for i = 0, since
f[x
k
] = f(x
k
) =
ˆ
f
k
= (∆
0
ˆ
f)
k
.
Suppose the assertion is true for some i ≥ 0 with i < N −k. Then, we have
f[x
k
, . . . , x
k+i+1
] =
f[x
k+1
, . . . , x
k+i+1
] −f[x
k
, . . . , x
k+i
]
x
k+i+1
−x
k
=
_
(∆
i
ˆ
f)
k+1
i!h
i

(∆
i
ˆ
f)
k
i!h
i
_
_
[(i + 1)h]
=
(∆
i
ˆ
f)
k+1
−(∆
i
ˆ
f)
k
(i + 1)!h
i+1
=
(∆
i+1
ˆ
f)
k
(i + 1)!h
i+1
,
2
“Operator” is usually reserved to name functions that map functions to functions. In this
case, ∆ maps sequences to sequences.
Note 1: Lagrange Interpolation – August 15, 2011 32
which is (1) with i replaced by i + 1. We have shown that the assertion holds for
i = 0, . . . , N −k.
1.5.3 Remark (Notation). Many use the notation ∆
i
f
k
for (∆
i
ˆ
f)
k
. While one
can get used to it, I find it rather messy (and confusing to those who see it for the
first time), even though it is pretty much the standard notation used in numerical
analysis.
1.5.4 Definition (Newton’s Forward-Difference Formula). Let p
n
denote the poly-
nomial of degree at most n that interpolates f at x
k
, . . . , x
k+n
. Thanks to 1.3.1(3)
this polynomial can be written
p
n
(x) =
k+n

i=k
[(x −x
k
) · · · (x −x
i−1
)]f[x
k
, . . . , x
i
].
Thanks to Proposition 1.5.2, we have
(1) p
n
(x) =
n

i=0
(∆
i ˆ
f)
k
i!h
i
i−1

j=0
(x −x
k+j
).
Introducing the notation s = (x −x
0
)/h, we can write
x −x
k+j
= x
0
+ sh + [x
0
+ (k + j)h]
= (s −k −j)h,
which we use to rewrite (1) as
p
n
(x) = p
n
(x
0
+ sh)
=
n

i=0
(∆
i
ˆ
f)
k
i!h
i
i−1

j=0
(s −k −j)h
=
n

i=0
(∆
i
ˆ
f)
k
i!
i−1

j=0
(s −k −j)
=
n

i=0
(∆
i
ˆ
f)
k
i−1

j=0
s −k −j
j + 1
.
Introduce the binomial function defined by
3
_
t
0
_
= 1,
3
Note that
_
t
i
_
reduces to the usual binomial coefficient
_
t
i
_
(read:“t choose i when t is a
positive integer.
Note 1: Lagrange Interpolation – August 15, 2011 33
and
_
t
i
_
=
i−1

j=0
t −j
j + 1
=
t(t −1) · · · (t −i + 1)
i!
, t > 0.
We can now rewrite p
n
as
p
n
(x
0
+ sh) =
n

i=0
_
s −k
i
_
(∆
i
ˆ
f)
k
=
ˆ
f
k
+ (s −k)(∆
ˆ
f)k +
(s −k)(s −k −1)
2
(∆
2
ˆ
f)
k
+· · · +
(s −k) · · · (s −k −n + 1)
n!
(∆
n
ˆ
f)
k
.
The above is called the Newton forward-difference formula for the polynomial p
n
of degree at most n that interpolates f at x
k
, . . . , x
k+n
. For k = 0 the above takes
the special form
(2) p
n
(x
0
+ sh) =
n

i=0
_
s
i
_
(∆
i
ˆ
f)
0
.
1.6 Examples
1.6.1 Example. The table in Figure 1 shows sinx, together with its divided dif-
ferences
f[x
k
, x
k+1
], f[x
k
, . . . , x
k+2
], f[x
k
, . . . , x
k+3
],
tabulated from 0 to 0.8 with a step of 0.05. (The values shown are rounded.)
Recalling the representation
p
3
(x) = f
0
+ (x −x
0
)f[x
0
, x
1
]
+ (x −x
0
)(x −x
1
)f[x
0
, x
1
, x
2
]
+ (x −x
0
)(x −x
1
)(x −x
2
)f[x
0
, x
1
, x
2
, x
3
],
we obtain the approximation
4
p
3
(x)
.
= 0.9995833854x
− 0.0499687578x(x −0.05)
− 0.9968772388x(x −0.05)(x −0.1)
4
The symbol
.
= means that the numeric values shown are rounded approximations to the true
coefficient values.
Note 1: Lagrange Interpolation – August 15, 2011 34
for the polynomial of degree at most 3 that interpolates sin at the points 0, 0.05,
0.1, 0.15.
Note that in this case the degree is actually 3. Note also that by starting farther
down in the table, we can obtain p
k
(x) for other values of k, as long as 3 ≤ k ≤ 16.
x
k
f
k
f[x
k
, x
k+1
] f[x
k
, . . . , x
k+2
] f[x
k
, . . . , x
k+3
]
0.0000000000 0.0000000000
0.9995833854
0.0500000000 0.0499791693 −0.0499687578
0.9970849475 −0.9968772388
0.1000000000 0.0998334166 −0.0998126198
0.9920943165 −0.9918876474
0.1500000000 0.1494381325 −0.1494070021
0.9846239664 −0.9844188535
0.2000000000 0.1986693308 −0.1986279448
0.9746925692 −0.9744895252
0.2500000000 0.2474039593 −0.2473524211
0.9623249481 −0.9621244805
0.3000000000 0.2955202067 −0.2954586451
0.9475520159 −0.9473546257
0.3500000000 0.3428978075 −0.3428263764
0.9304106971 −0.9302168777
0.4000000000 0.3894183423 −0.3893372202
0.9109438361 −0.9107540719
0.4500000000 0.4349655341 −0.4348749238
0.8892000899 −0.8890148553
0.5000000000 0.4794255386 −0.4793256666
0.8652338065 −0.8650535645
0.5500000000 0.5226872289 −0.5225783448
0.8391048893 −0.8389300903
0.6000000000 0.5646424734 −0.5645248493
0.8108786468 −0.8107097278
0.6500000000 0.6051864057 −0.6050603357
0.7806256300 −0.7804630132
0.7000000000 0.6442176872 −0.6440834864
0.7484214557 −0.7482655476
0.7500000000 0.6816387600 −0.6814967638
0.7143466175
0.8000000000 0.7173560909
Figure 1: A table of divided differences for the sine function.
1.6.2 Example. Finite differences are not only useful in polynomial interpolation.
They are very effective in detecting errors that may have occureed in the transmis-
sion or recording of smooth data. The table in Figure 1 is identical to the table in
Figure 1.6.1(1), with one major exception: One of the f
k
’s has been perturbed by
1%.
Note 1: Lagrange Interpolation – August 15, 2011 35
An important lesson to be learned from this example is that the computation
of approximate derivatives is extremely sensitive to noise in the data. That is,
approximate numerical differentiation can be expected to make small errors big-
ger. This is usually the opposite of what we can expect of approximate numerical
integration, since integration is a “smoothing” operation.
x
k
f
k
f[x
k
, x
k+1
] f[x
k
, . . . , x
k+2
] f[x
k
, . . . , x
k+3
]
0.0000000000 0.0000000000
0.9995833854
0.0500000000 0.0499791693 −0.0499687578
0.9970849475 −0.9968772388
0.1000000000 0.0998334166 −0.0998126198
0.9920943165 −0.9918876474
0.1500000000 0.1494381325 −0.1494070021
0.9846239664 −0.9844188535
0.2000000000 0.1986693308 −0.1986279448
0.9746925692 −0.9744895252
0.2500000000 0.2474039593 −0.2473524211
0.9623249481 −0.9621244805
0.3000000000 0.2955202067 −0.2954586451
0.9475520159 −0.9473546257
0.3500000000 0.3428978075 −0.3428263764
0.9304106971 −0.9302168777
0.4000000000 0.3894183423 −0.3893372202
0.9109438361 37.4432890164
0.4500000000 0.4349655341 1.4828272306
0.9850851976 −115.9511441203
0.5000000000 0.4842197940 −4.3147299754
0.7693486988 114.1970757005
0.5500000000 0.5226872289 1.3951238096
0.8391048893 −39.1929731787
0.6000000000 0.5646424734 −0.5645248493
0.8108786468 −0.8107097278
0.6500000000 0.6051864057 −0.6050603357
0.7806256300 −0.7804630132
0.7000000000 0.6442176872 −0.6440834864
0.7484214557 −0.7482655476
0.7500000000 0.6816387600 −0.6814967638
0.7143466175
0.8000000000 0.7173560909
Figure 1: The effect of an error in a table of divided differences.
Note the wild behavior of the third difference in the above table, where the entries
that differ from the table in Example 1 are shown in Italics.
As a rule, numerical differentiation is seldom used unless the smoothness of the
data is very high. Numerical integration, on the other hand, does usually present
Note 1: Lagrange Interpolation – August 15, 2011 36
such concerns. Integration is a smoothing operation, while differentiation amplifies
the errors (noise) that may be present in the data.

. we construct the L’s. . First we show existence. where q is a polynomial of degree n − 1.4 Theorem (Lagrange Interpolation). for j = 0. i. . Now. we use the polynomial (x − x0 ) · · · (x − xi−1 )(x − xi+1) · · · (x − xn ).3 Remark. The theorem given below states that there is a unique solution to a generalization of the problem of passing a line through two points. a parabola through three points. n. 1. Suppose that we have n + 1 polynomials L0 . In other words. 1. . to remove xi from this list. n. if p is a polynomial of degree n ≥ 1 and and x∗ is a zero of p. i = j. . . p is a polynomial of degree at most n. 2011 22 We have the Fundamental Theorem of Algebra: Every polynomial over the complex numbers C of positive degree has at least one zero. . Proof. . . Clearly. The reasoning goes as follows. p interpolates the given data. with xi = xj for i = j. (1) p(x) = i=0 Li (x)yi. xm . p is a polynomial of degree m + 1. x1. .: such that p(xi ) = yi for i = 0. then p is a polynomial of the form p(x) = c(x − x0)(x − x1) · · · (x − xm ). Ln of degree n such that Li (xj ) = Define the polynomial p by n 0. there is a unique polynomial p of degree at most n that interpolates the given data.e. an so on. It follows that if p is a polynomial with m + 1 distinct zeros x0 . . . yn ) in the plane. . Thus. i = j. The polynomial (x − x0) · · · (x − xn ) has the zeros x0. (xn . . then we have p(x) = q(x)(x − x∗).Note 1: Lagrange Interpolation – August 15. In other words. . . . So. provided that each data point lies on a unique vertical line 1. .1. xn . . . Further. . where c is some constant not equal to zero. we have n p(xj ) = i=0 Li (xj )yi = Lj (xj )yj = yj . Given n+1 data points (x0. since the coefficient of the leading power xm+1 is c = 0. since each of the L’s is a polynomial of degree n. y0 ). . . To show existence of an interpolating polynomial we use Lagrange’s interpolation formula (given by (1) and (2)) for representing it. . .1.

. Each Li is called a Lagrange coefficient polynomial. P (x) = c(x − x0 )(x − x1 ) · · · (x − xn ). .Note 1: Lagrange Interpolation – August 15. we never divide by zero. Define the polynomial P = p − q. In other words. suppose that p and q are polynomials of degree at most n that interpolate the given data. Given the function f : [a. That is. Now. Using Lagrange’s formula. . To this end. xn . there is no polynomial P degree at most n with n + 1 distinct zeros. n. any two interpolating polynomials are identical. pn is such that pn (xi ) = f(xi ) for i = 0. n. We have a contradiction. . Moreover P (xi ) = p(xi ) − q(xi) = yi − yi = 0 for i = 0. . 1. . . we divide by a constant. To prove uniqueness. .2. This means that p(xi ) = yi and q(xi) = yi for i = 0. where c is some constant and xi = xj for i = j. There is only one polynomial that satisfies our requirement: the zero polynomial P (x) = 0 for all x. Then P is a polynomial of degree at most n also (since p and q are). b] → R and given n + 1 distinct points x0 . . (xi − x0) · · · (xi − xi−1 )(xi − xi+1 ) · · · (xi − xn ) 23 Note that since the x’s are distinct.2 The Error in Lagrange Interpolation 1. . b]. . where the Li are the Lagrange coefficient polynomials given by Li (x) = (x − x0) · · · (x − xi−1 )(x − xi+1 ) · · · (x − xn ) . . . xn in [a. to obtain Li (xi) = 1. we see that pn can be written n (1) pn (x) = i=0 Li (x)f(xi ). we argue that any two interpolating polynomials of degree at most n are identical. we prove uniqueness. We obtain (2) Li (x) = (x − x0) · · · (x − xi−1 )(x − xi+1 ) · · · (x − xn ) . 2011 Finally. Therefore. (xi − x0) · · · (xi − xi−1 )(xi − xi+1 ) · · · (xi − xn ) .1 Definition (The Interpolation Error). p = q. . In other words. let pn denote the polynomial of degree at most n that interpolates f at the given points. .

. Thus. . The result is true if t = xi for i = 0. . . . . xn be n + 1 distinct real numbers. Let t be any real number. where Ψ(x) = (x − x0) · · · (x − xn ). We can obtain a useful expression for E(x).: G(n+1) (τ ) = 0. Then. . xn . as we show below. Note that for i = 0. . b = max{t. Ψ(t) Ψ(x) E(t). .2. Note that if a = b there is nothing to prove. (n + 1)! (Note the similarity between the above and the remainder in Taylor’s formula.) Proof. i. . x0. b) for j = 1. Let pn denote the polynomial of degree at most n that interpolates f at x0 . . . . . b] with n + 1 continuous derivatives. Let x0. so is G. b). we proceed for t = xi . . 1. xn we have G(xi ) = E(xi ) − and G(t) = E(t) − Ψ(xi ) E(t) = 0.2 Proposition. Ψ(t) Thus. Fix t and define G(x) = E(x) − for all x in [a. there exists a number τ in (a. . . G has n + 2 distinct zeros in [a. . . n + 1. . So. . G(n+1) has at least one zero in (a. By the mean value theorem. . . b]. Define a and b by a = min{t. . xn }. 2011 24 Define the interpolation error E(x) = f(x)−pn (x) for x in [a. .Note 1: Lagrange Interpolation – August 15. b]. . . xn }. x0. n. b) such that E(t) = f(t) − pn (t) = (t − x0) · · · (t − xn ) (n+1) f (τ ). Let f be a real-valued function defined on [a. . provided f is sufficiently differentiable. b). We proceed by induction: G(j) has n + 2 − j distinct zeros in (a. .e. Ψ(t) Ψ(t) E(t) = 0. Because E and Ψ are n + 1 times continuously differentiable functions. Let τ denote any such zero.. b]. its derivative G has n + 1 distinct zeros in (a.

. x0.1 Definition. We have obtained the representation of f (1) f(t) = pn (t) + (t − x0 ) · · · (t − xn ) (n+1) f (τ ). 1.3 Divided Differences 1.Note 1: Lagrange Interpolation – August 15. x − n} < τ < max{t. Compare the above with the representation (t − x0 )n+1 (n+1) f (τ ). .3 Remark. n (2) p(t) = i=0 (t − x0 )i (i) f (x0 ). . . b]. . . To this end. (n + 1)! 1. Let f : [a. . There is a much nicer way to represent the interpolating polynomial (1) that brings out this analogy. . 2011 Because E (n+1) (x) = f (n+1) (x) and Ψ(n+1) (x) = (n + 1)! we obtain G(n+1) (x) = f (n+1) (x) − which gives 0 = G(n+1) (τ ) = f (n+1) (τ ) − whence E(t) = (n + 1)! E(t). b] → R be sufficiently differentiable. x0} < τ < max{t.3. Ψ(t) 25 Ψ(t) (n+1) f (τ ). x0}. we write (1) pn (x) = pn−1 (x) + cn (x). Here. Ψ(t) (n + 1)! E(t). (n + 1)! where min{t. The representation uses divided differences. f(t) = p(t) + (n + 1)! where min{t. i! We see that (1) is some sort of a discrete analogue of (2). x0. We want to find a way to obtain pn from pn−1 . . . Let pn denote the polynomial of degree at most n that interpolates f at the distinct points x0. xn }. .2. p is the Taylor polynomial of f at x0. . xn in [a. .

. Note: If an = 0. . where the coefficient an is to be determined. x1] + (x − x0 )(x − x1 )f[x0. cn is the zero polynomial. . x1. . we observe that cn (xi ) = pn (xi ) − pn−1 (xi ) = f(xi ) − f(xi ) = 0 for i = 0. . . We obtain an (xn − x0 ) · · · (xn − xn−1 ) = cn (xn ) = pn (xn ) − pn−1 (xn ) = f(xn ) − pn−1 (xn ). . p2 (x) = f[x0 ] + (x − x0)f[x0 . 2011 26 where we think of cn as a “correction term” we add to pn−1 to obtain pn . Define f[x0 ] = f(x0 ). xn ]. . The first three interpolating polynomials have the representations p0 (x) = f[x0 ]. . . x1].) Finally. while pn has the representation n (3) pn (x) = i=0 [(x − x0 ) · · · (x − xi−1 )]f[x0. it must be the polynomial cn (x) = an (x − x0) · · · (x − xn−1 ). Since cn must be a polynomial of degree at most n. . cn is a polynomial of degree n. . . p1 (x) = f[x0 ] + (x − x0)f[x0 . giving an = f(xn ) − pn−1 (xn ) . x2]. since pn (xn ) = f(xn ). (1) yields the formula (2) pn (x) = pn−1 (x) + (x − x0 ) · · · (x − xn−1 )f[x0 . . (The notation may seem strange. n − 1. (xn − x0) · · · (xn − xn−1 ) The coefficient an is called is called the nth order divided difference and is denoted by an = f[x0. xi ]. . Can we find a simple way to represent cn ? First. . xn ]. . otherwise. but is the standard notation widely used.Note 1: Lagrange Interpolation – August 15.

. . . . xk ]. . we have the same polynomial. . . xk .2. we obtain (xk − x0) · · · (xk − xk−1 ) (k) f (τ ). . 1. . Compare the Taylor series for f about the point x0 f(x) = f(x0 ) + (x − x0 )f (x0) + (x − x0)2 f (x0 ) + · · · 2! (x − x0)n+1 (n+1) (x − x0 )n (n) + f (x0) + f (τ1 ) n! (n + 1)! with the interpolating polynomial approximation f(x) = f[x0] + (x − x0 )f[x0. . .2. then f (k) (τ ) k! for some τ in the smallest open interval containing x0. we have f(xk ) = pk (xk ) = pk−1 (xk ) + (xk − x0) · · · (xk − xk−1 )f[x0. Whether we use Lagrange’s formula or the above reprentation. makes a pretty good case for thinking of the interpolating polynomial as a discrete analogue of the Taylor series. The interpolating polynomial pn is unique. Thanks to Proposition 1.1(2) and the equality f(xk ) = pk (xk ). If f is a real function on [a. b]. k! . x1] + (x − x0 )(x − x1 )f[x0. . xn ] + (n + 1)! where τ1 and τ2 are points in (a. . xk are distinct points in [a. k! From the above two equations we obtain f(xk ) − pk−1 (xk ) = (xk − x0 ) · · · (xk − xk−1 )f[x0. 2011 27 The above is known as Newton’s divided differences formula for the interpolating polynomial. with the kth divided difference being a discrete analogue of the kth derivative. x1.3. (xk − x0 ) · · · (xk − xk−1 ) (k) f (τ ).2 Proposition. .Note 1: Lagrange Interpolation – August 15. (x − x0 ) · · · (x − xn−1 )f[x0. . .3. however. b] with k continuous derivatives there and x0 . f[x0 . . The above representation. which we rewrite as f(xk ) − pk−1 (xk ) = (xk − x0) · · · (xk − xk−1 )f[x0. . . We prove this below. . b). . . . . xk ] = which is the desired result. . x2 ] + · · · (x − x0) · · · (x − xn ) (n+1) f (τ2 ). xk ]. . xk ] = Proof. Thanks to 1. . .

Let qn−1 denote the polynomial of degree at most n−1 that interpolates f at the points x1 . . Let pn denote.4 Computing with Divided Differences 1. xn − x0 xn − x0 . xn ]. an are unique. . p is of the form (1) p(x) = an xn + · · · + a1x + a0. whence ai = bi .1 Remarks. The nth divided difference f[x0 . as usual. . . xn ). of course. . each ak is invariant with respect to any permutation of (x0 .2 Proposition. . We compute finite differences from tabulated data as follows. 1. if we also have p(x) = bn xn + · · · + b1 x + b0 . xin . Define the polynomial p of degree at most n by p(x) = x − x0 xn − x qn−1 (x) + pn−1 (x). In other words. the above is the zero polynomial. xn ] = f[xi0 . then subtraction yields (an − bn )xn + · · · + (a1 − b1 )x + (a0 − b0 ) = 0 for all x. . . settling the issue of uniqueness. . and so is its representation of the form (1). . . . . . . 1. xn . . . . Therefore. the polynomial of degree at most n that interpolates f at x0. . Let p denote the polynomial of degree at most n that interpolates f at x0. xn . . .3 Remarks. . 2011 28 1.4. . . . . . . xin ]. n). . we have an = f[x0. . . . The coefficients a0. Proof. If p is a polynomial of degree at most n.4. We have f[x0.4. . . . . xn . . . Since p is unique. Let q denote the polynomial of degree at most n that interpolates f at xi0 . . . . . xn be distinct points in [a. b]. . Let f be a real function defined on [a. . . . . Indeed. . . in ) denote any permutation of (0.Note 1: Lagrange Interpolation – August 15. . We can therefore make the following important observation about divided differences. . . In particular. let (i0 . . xn . Then n n p(x) = j=0 Lj (x)f(xj ) = j=0 Lij (x)f(xij ) = q(x). b] and let x0. then. . . . xn ] is a symmetric function of x0.

4500000000 0. xk+2] f[xk .9920943165 −0.7143466175 0.0998334166 0.9846239664 −0.3428263764 0. .2954586451 0.4794255386 0.4000000000 0.Note 1: Lagrange Interpolation – August 15.3428978075 0.7804630132 −0. xk+1 ] 0.2000000000 0. 2011 We have p(x0 ) = and p(xn ) = xn − x0 pn−1 (x0) = f(x0) xn − x0 29 xn − x0 nn−1 (xn ) = f(xn ).6500000000 0.6442176872 0.9621244805 −0.1986279448 0.7000000000 0.9475520159 −0.0499687578 0.8892000899 −0.9107540719 −0. .9844188535 −0.5500000000 0.7482655476 −0.7173560909 Figure 1: A table of divided differences.5646424734 0.0998126198 0.7500000000 0.8391048893 −0.2474039593 0.6440834864 0.9623249481 −0.9109438361 −0. .0000000000 0.7484214557 −0.3894183423 0.9746925692 −0. . .2955202067 0.6814967638 0.9995833854 f[xk . xn − x0 We show how to generate the table shown in Figure 1.9304106971 −0.1986693308 0.1494070021 0. .8650535645 −0. xk+3 ] −0. .7806256300 −0.5225783448 0.5226872289 0.8652338065 −0. .1000000000 0.2500000000 0.1494381325 0.8107097278 −0.8108786468 −0.8890148553 −0.9744895252 −0.0000000000 0.9473546257 −0.9968772388 −0.1500000000 0.3893372202 0.9302168777 −0.3000000000 0.6816387600 0.6050603357 0.6051864057 0.5645248493 0.9918876474 −0.9970849475 −0.4793256666 0.8389300903 −0.0499791693 f[xk . xk fk 0.3500000000 0.5000000000 0.4349655341 0.6000000000 0. .2473524211 0.0500000000 0.8000000000 0.4348749238 0.

xn ] − f[x0 . . . Thanks to the uniqueness of the interpolating polynomial and to the uniqueness of the representation of the form (1). xn − x0 Beginning with tabulated values of f. Thus. . . . using the above relation • we compute the column of first-order divided differences f[xk . Suppose that f is a real function defined on [a. . . we proceed to compute the column of second-order divided differences f[xk . f(x1 ). we show some basic forms taken by the interpolating polynomial when the data points are equally spaced.e. xk+2 ]. .5. For fixed positive integer N. to every f ∈ R[a. • then we keep going as far as we want. 1. 1. p(xi ) = xn − xi xi − x0 qn−1 (xi ) + pn−1 (xi ) xn − x0 xn − x0 xi − x0 xn − xi = f(xi ) + f(xi ) xn − x0 xn − x0 = f(xi ). .1 Definition. . . xn−1 ] = . . we have. . . .Note 1: Lagrange Interpolation – August 15. 30 Further. .: p interpolates f at x0 . . . xn ]. • then. . .b] there corresponds a unique finite sequence {f(x0 ). . as shown to the left in the table of Figure 1. we have that p = pn . b]. . xk+1 . . 2011 Form our present discussion. f[x0. . i. xk+1 ]. define h = (b − a)/N and xi = a + ih. for 1 ≤ i ≤ n − 1. f(xN )}. . . for i = 0. . N. . xn . up to the column with the single entry f[x0.5 Interpolation Using Equidistant Points Below. . xn ] = leading coefficient of p(x) leading coefficient of qn−1 (x) = xn − x0 leading coefficient of pn−1 (x) − xn − x0 f[x1 .

We use the shorthand ˆ ˆ ˆ ˆ f = {f0 . N − 1. For i = 0. fN } 31 to denote such a sequence. xk+i+1 ] − f[xk . . . N. xk+i+1 ] = f[xk+1 . 2011 which is an element of RN +1. . . ∆ is a function (operator2 ) ∆ : RN +1 → RN ˆ ˆ which maps a sequence f ∈ RN +1 to the sequence ∆f in RN given by ˆ ˆ ˆ (∆f)i = fi+1 − fi . . . N − k. 1. .Note 1: Lagrange Interpolation – August 15. . Then. i!hi Proof. The proof is by induction on i. . . (i + 1)!hi+1 ˆ ˆ (∆0f) = f. we define ∆j : RN +1 → RN −j by and for 0 < i ≤ N − j − 1. . . . . . . .2 Proposition. . . . ˆ ˆ (∆j+1 f)i = (∆j f)i+1 − (∆j f)i . For j = 0. .5. for i = 0. since (1) f[xk . we have f[xk . we have ˆ (∆if )k . 1. The assertion is true for i = 0. 2 . . . xk+i ] = ˆ ˆ f[xk ] = f(xk ) = fk = (∆0 f)k . ∆ maps sequences to sequences. . For the chosen N we define the forward difference operator ∆ as follows. . “Operator” is usually reserved to name functions that map functions to functions. xk+i ] xk+i+1 − xk iˆ ˆ (∆ f )k+1 (∆i f)k = − [(i + 1)h] i!hi i!hi ˆ ˆ (∆i f )k+1 − (∆if )k = (i + 1)!hi+1 ˆ (∆i+1 f)k = . In this case. f1. 1. . . . . . Suppose the assertion is true for some i ≥ 0 with i < N − k. . .

While one can get used to it. . 3 t i = 1. N − k. t i reduces to the usual binomial coefficient (read:“t choose i when t is a .5. I find it rather messy (and confusing to those who see it for the first time). . xi ]. . . j=0 Introducing the notation s = (x − x0 )/h. Many use the notation ∆i fk for (∆if )k . xk+n . ˆ 1. 1. 2011 32 which is (1) with i replaced by i + 1. . . which we use to rewrite (1) as pn (x) = pn (x0 + sh) n ˆ i−1 (∆i f)k = (s − k − j)h i!hi j=0 i=0 n = i=0 n ˆ (∆i f)k i! ˆ (∆if )k i−1 (s − k − j) j=0 i−1 = i=0 s−k−j . .Note 1: Lagrange Interpolation – August 15.1(3) this polynomial can be written k+n pn (x) = i=k [(x − xk ) · · · (x − xi−1 )]f[xk . Let pn denote the polynomial of degree at most n that interpolates f at xk .3 Remark (Notation). Thanks to Proposition 1. .2.3. we have n (1) pn (x) = i=0 ˆ (∆i f)k i!hi i−1 (x − xk+j ). .5.5. . . j+1 j=0 Introduce the binomial function defined by3 t 0 Note that positive integer. Thanks to 1. we can write x − xk+j = x0 + sh + [x0 + (k + j)h] = (s − k − j)h. . even though it is pretty much the standard notation used in numerical analysis. We have shown that the assertion holds for i = 0.4 Definition (Newton’s Forward-Difference Formula).

.6 Examples 1.05) − 0. .05)(x − 0. x2] + (x − x0)(x − x1)(x − x2)f[x0 . x2. The table in Figure 1 shows sin x. together with its divided differences f[xk . xk+2 ].05. . . . p3 (x) = 0. x1] + (x − x0)(x − x1)f[x0 .) Recalling the representation p3 (x) = f0 + (x − x0)f[x0 .1 Example. (The values shown are rounded. .9995833854x − 0. xk+1 ]. . f[xk . We can now rewrite pn as n pn (x0 + sh) = i=0 s−k ˆ (∆i f)k i (s − k)(s − k − 1) 2 ˆ ˆ ˆ = fk + (s − k)(∆f)k + (∆ f )k 2 (s − k) · · · (s − k − n + 1) n ˆ (∆ f)k . . . x3]. 4 . . For k = 0 the above takes the special form n (2) pn (x0 + sh) = i=0 s ˆ (∆i f)0 .9968772388x(x − 0. +··· + n! The above is called the Newton forward-difference formula for the polynomial pn of degree at most n that interpolates f at xk . f[xk .Note 1: Lagrange Interpolation – August 15. i 1. tabulated from 0 to 0.8 with a step of 0.0499687578x(x − 0. j+1 i! t > 0. x1.6. . x1. The symbol = means that the numeric values shown are rounded approximations to the true coefficient values.1) . 2011 and t i = j=0 33 i−1 t(t − 1) · · · (t − i + 1) t−j = . we obtain the approximation4 . . xk+3 ]. xk+n .

7500000000 0. .3893372202 −0. 0.8107097278 −0.2 Example.3000000000 0.9970849475 0.5645248493 −0.0998334166 0. xk fk 0.8890148553 −0. xk+1 ] 0.9109438361 0.6. Finite differences are not only useful in polynomial interpolation. 2011 34 for the polynomial of degree at most 3 that interpolates sin at the points 0. Note that in this case the degree is actually 3.1500000000 0.8892000899 0.8391048893 0. we can obtain pk (x) for other values of k.2473524211 −0. . with one major exception: One of the fk ’s has been perturbed by 1%.2954586451 −0.1. xk+3 ] Figure 1: A table of divided differences for the sine function.3428978075 0.1494381325 0.7143466175 0.7482655476 −0.8650535645 −0.9918876474 f[xk .9995833854 −0.0000000000 0.1986279448 −0.5500000000 0.05.7173560909 −0.8000000000 0.3500000000 0.5646424734 0.6050603357 −0.8108786468 0.7806256300 0.2474039593 0.5226872289 0. The table in Figure 1 is identical to the table in Figure 1. as long as 3 ≤ k ≤ 16.1000000000 0.8652338065 0.6442176872 0.6.4000000000 0.2000000000 0.9744895252 −0.1986693308 0.4794255386 0.1(1).4500000000 0. .9623249481 0.15.6051864057 0.6000000000 0. .9920943165 0.0499687578 −0. . Note also that by starting farther down in the table.9475520159 0.8389300903 −0.4793256666 −0.4348749238 −0.2500000000 0. .Note 1: Lagrange Interpolation – August 15.6500000000 0.0500000000 0.3894183423 0.3428263764 −0. They are very effective in detecting errors that may have occureed in the transmission or recording of smooth data.5000000000 0.6440834864 −0.9304106971 0.4349655341 0.9746925692 0.9844188535 −0. 1.6814967638 −0. . 0.0499791693 0.0000000000 0. xk+2] f[xk .9621244805 −0.9846239664 0. .0998126198 −0. .2955202067 0.6816387600 0.7804630132 −0.9473546257 −0.9302168777 −0.1494070021 −0.9968772388 f[xk .7000000000 0.9107540719 −0. 0.5225783448 −0.7484214557 0.

2000000000 0.8391048893 0.0000000000 0.9746925692 0. .3894183423 0.3147299754 114 .6051864057 0.Note 1: Lagrange Interpolation – August 15. does usually present .1986279448 −0. .5645248493 −0.0998126198 −0.0499687578 −0.3500000000 0.9846239664 0.6814967638 −0. .4000000000 0.9304106971 0.7000000000 0.9920943165 0. numerical differentiation is seldom used unless the smoothness of the data is very high. .9623249481 0.9511441203 −0.5226872289 0.0998334166 0. where the entries that differ from the table in Example 1 are shown in Italics.9844188535 −0. .1500000000 0.2955202067 0.2500000000 0. That is.9850851976 0.0000000000 0. xk 0. Note the wild behavior of the third difference in the above table. As a rule.8108786468 0.8107097278 1 .7484214557 0.6442176872 0. This is usually the opposite of what we can expect of approximate numerical integration. Numerical integration.1986693308 0.9302168777 −0.6816387600 0.7173560909 −0.1970757005 1 .8000000000 0. since integration is a “smoothing” operation.6050603357 −0. 2011 35 An important lesson to be learned from this example is that the computation of approximate derivatives is extremely sensitive to noise in the data.5500000000 0.9968772388 f[xk .6000000000 0.3893372202 37 .9918876474 f[xk .9744895252 −0. on the other hand.9473546257 −0.9970849475 0. .9475520159 0.6500000000 0.4828272306 −115 .4842197940 0 . . xk+3 ] Figure 1: The effect of an error in a table of divided differences.2954586451 −0.7482655476 −0.7804630132 −0.2473524211 −0.4500000000 fk 0.9109438361 0.7693486988 0.9621244805 −0.6440834864 −0.3428978075 0. xk+1 ] 0.1494070021 −0.7500000000 0.5000000000 0 .5646424734 0.4432890164 −0. .3951238096 −39 . xk+2] f[xk .2474039593 0.7143466175 0.3000000000 0.1000000000 0.9995833854 −0.7806256300 0.0500000000 0.1929731787 −4 .4349655341 0 . approximate numerical differentiation can be expected to make small errors bigger.3428263764 −0.0499791693 0.1494381325 0.

Note 1: Lagrange Interpolation – August 15. Integration is a smoothing operation. 2011 36 such concerns. . while differentiation amplifies the errors (noise) that may be present in the data.