You are on page 1of 16

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 Dierences . . . . . . . . . . . . . . . . . . . . . 25
1.4 Computing with Divided Dierences . . . . . . . . . . . 28
1.5 Interpolation Using Equidistant Points . . . . . . . . . 30
1.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.1 The Lagrange Interpolating Polynomial
1.1.1 Denition (Degree of a Polynomial). The polynomial
a
n
x
n
+ a
n1
x
n1
+ + a
1
x + a
0
in x has degree n if a
n
= 0. This denes the degree of every polynomial except one,
the zero polynomial p(x) = 0. The degree of the zero polynomial is undened.
1.1.2 Remark. The number x

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

) = 0.
The zero polynomial has innitely 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 eld R is not algebraically closed, but the complex eld 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)(xx

), 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 coecient 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 Lagranges 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.
Dene 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 Ls 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 Ls. 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
i1
)(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
i1
)(x x
i+1
) (x x
n
)
(x
i
x
0
) (x
i
x
i1
)(x
i
x
i+1
) (x
i
x
n
)
.
Note that since the xs are distinct, we never divide by zero. Each L
i
is called a
Lagrange coecient 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.
Dene 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 satises 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 Denition (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 Lagranges 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 coecient polynomials given by
L
i
(x) =
(x x
0
) (x x
i1
)(x x
i+1
) (x x
n
)
(x
i
x
0
) (x
i
x
i1
)(x
i
x
i+1
) (x
i
x
n
)
.
Note 1: Lagrange Interpolation August 15, 2011 24
Dene 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 suciently dierentiable, 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. Dene 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 dened 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 Taylors 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 dene
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 dierentiable 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 dierences.
1.3 Divided Dierences
1.3.1 Denition. Let f : [a, b] R be suciently dierentiable. 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 nd a way to obtain p
n
from p
n1
. To this end, we
write
(1) p
n
(x) = p
n1
(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
n1
to obtain p
n
. Can we
nd a simple way to represent c
n
?
First, we observe that
c
n
(x
i
) = p
n
(x
i
) p
n1
(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
n1
),
where the coecient 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
n1
) = c
n
(x
n
)
= p
n
(x
n
) p
n1
(x
n
)
= f(x
n
) p
n1
(x
n
),
since p
n
(x
n
) = f(x
n
), giving
a
n
=
f(x
n
) p
n1
(x
n
)
(x
n
x
0
) (x
n
x
n1
)
.
The coecient a
n
is called is called the nth order divided dierence 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
n1
(x) + (x x
0
) (x x
n1
)f[x
0
, . . . , x
n
].
Dene f[x
0
] = f(x
0
). The rst 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
i1
)]f[x
0
, . . . , x
i
].
Note 1: Lagrange Interpolation August 15, 2011 27
The above is known as Newtons divided dierences 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
n1
)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 Lagranges 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 dierence 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
k1
(x
k
) + (x
k
x
0
) (x
k
x
k1
)f[x
0
, . . . , x
k
],
which we rewrite as
f(x
k
) p
k1
(x
k
) = (x
k
x
0
) (x
k
x
k1
)f[x
0
, . . . , x
k
].
Thanks to Proposition 1.2.2, we obtain
f(x
k
) p
k1
(x
k
) =
(x
k
x
0
) (x
k
x
k1
)
k!
f
(k)
().
From the above two equations we obtain
(x
k
x
0
) (x
k
x
k1
)f[x
0
, . . . , x
k
] =
(x
k
x
0
) (x
k
x
k1
)
k!
f
(k)
(),
which is the desired result.
Note 1: Lagrange Interpolation August 15, 2011 28
1.4 Computing with Divided Dierences
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 coecients 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 dierences.
1.4.2 Proposition. Let f be a real function dened on [a, b] and let x
0
, . . . , x
n
be distinct points in [a, b]. The nth divided dierence 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 nite dierences 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
n1
denote the polynomial of degree at most n1 that interpolates
f at the points x
1
, . . . , x
n
.
Dene the polynomial p of degree at most n by
p(x) =
x x
0
x
n
x
0
q
n1
(x) +
x
n
x
x
n
x
0
p
n1
(x).
Note 1: Lagrange Interpolation August 15, 2011 29
We have
p(x
0
) =
x
n
x
0
x
n
x
0
p
n1
(x
0
) = f(x
0
)
and
p(x
n
) =
x
n
x
0
x
n
x
0
n
n1
(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 dierences.
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
n1
(x
i
) +
x
n
x
i
x
n
x
0
p
n1
(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 coecient of p(x)
=
leading coecient of q
n1
(x)
x
n
x
0

leading coecient of p
n1
(x)
x
n
x
0
=
f[x
1
, . . . , x
n
] f[x
0
, . . . , x
n1
]
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 rst-order divided dierences f[x
k
, x
k+1
],
then, we proceed to compute the column of second-order divided dierences
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 Denition. Suppose that f is a real function dened on [a, b]. For xed
positive integer N, dene
h = (b a)/N and x
i
= a + ih, for i = 0, . . . , N.
Thus, to every f R
[a,b]
there corresponds a unique nite 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 dene the forward dierence 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 dene

j
: R
N+1
R
Nj
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 nd it rather messy (and confusing to those who see it for the
rst time), even though it is pretty much the standard notation used in numerical
analysis.
1.5.4 Denition (Newtons Forward-Dierence 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
i1
)]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
i1

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
i1

j=0
(s k j)h
=
n

i=0
(
i

f)
k
i!
i1

j=0
(s k j)
=
n

i=0
(
i

f)
k
i1

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

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-dierence 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
coecient 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 dierences for the sine function.
1.6.2 Example. Finite dierences are not only useful in polynomial interpolation.
They are very eective 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 dierentiation 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 eect of an error in a table of divided dierences.
Note the wild behavior of the third dierence in the above table, where the entries
that dier from the table in Example 1 are shown in Italics.
As a rule, numerical dierentiation 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 dierentiation amplies
the errors (noise) that may be present in the data.