Академический Документы
Профессиональный Документы
Культура Документы
W W L CHEN
c
This chapter originates from material used by the author at Imperial College, University of London, between 1981 and 1990.
It is available free to all individuals, on the understanding that it is not to be used for financial gain,
and may be downloaded and/or photocopied, with or without permission from the author.
However, this document may not be kept on any information storage and retrieval system without permission
from the author, unless such system is not accessible to any individuals other than its owners.
Chapter 18
INTERPOLATION AND APPROXIMATION
page 1 of 7
The two examples above illustrate a very crude technique. When we attempt to fit a polynomial
through k points, we use a polynomial of degree (k 1). We then have to determine the k coefficients
of this polynomial. This amounts to solving a system of k linear equations in the k unknowns. Clearly
it is rather tedious, particularly when k is large.
Let us therefore use a different approach on the same problems.
Example 18.1.3. As in Example 18.1.1, let us find a polynomial through the points (0, 6), (1, 2) and
(5, 6). Try
p(x) = a(x 1)(x 5) + b(x 0)(x 5) + c(x 0)(x 1).
Since p(0) = 6, we must have 6 = a(0 1)(0 5), so that a = 6/5. Since p(1) = 2, we must have
2 = b(1 0)(1 5), so that b = 1/2. Since p(5) = 6, we must have 6 = c(5 0)(5 1), so that c = 3/10.
Hence
p(x) =
+
= x2 5x + 6.
5
2
10
Example 18.1.4. As in Example 18.1.2, let us find a polynomial through the points (1, 5), (0, 1),
(1, 1) and (3, 49). Try
p(x) = a(x 0)(x 1)(x 3) + b(x + 1)(x 1)(x 3) + c(x + 1)(x 0)(x 3) + d(x + 1)(x 0)(x 1).
Since p(1) = 5, we must have 5 = a(10)(11)(13), so that a = 5/8. Since p(0) = 1, we must
have 1 = b(0+1)(01)(03), so that b = 1/3. Since p(1) = 1, we must have 1 = c(1+1)(10)(13),
so that c = 1/4. Since p(3) = 49, we must have 49 = d(3 + 1)(3 0)(3 1), so that d = 49/24. Hence
5x(x 1)(x 3) (x + 1)(x 1)(x 3) x(x + 1)(x 3) 49x(x + 1)(x 1)
+
+
+
8
3
4
24
= 2x3 + x2 5x + 1.
p(x) =
Let us look at one more example. However, we shall be a little more systematic.
Example 18.1.5. We wish to find a polynomial through the points (1, 3), (3, 3) and (4, 9). Try
p(x) = a(x 3)(x 4) + b(x 1)(x 4) + c(x 1)(x 3).
Substituting x = 1, x = 3, x = 4, we obtain respectively
a=
p(1)
,
(1 3)(1 4)
b=
p(3)
,
(3 1)(3 4)
c=
p(4)
.
(4 1)(4 3)
Hence
p(x) = p(1)
(x 3)(x 4)
(x 1)(x 4)
(x 1)(x 3)
+ p(3)
+ p(4)
.
(1 3)(1 4)
(3 1)(3 4)
(4 1)(4 3)
k
Y
x xj
p(x) =
yi
xi xj
i=1
j=1
(1)
j6=i
Chapter 18 : Interpolation and Approximation
page 2 of 7
satisfies the requirements. To see that, note that for every i = 1, . . . , k, we have
k
Y
x xj
1 if x = xi ,
=
0 if x = x1 , . . . , xi1 , xi+1 , . . . , xk .
x
x
i
j
j=1
j6=i
where i = 1, . . . , n.
The problem now is to choose a0 , . . . , ak1 in such a way in order to make the errors small. There are
many ways to make errors small, and the following are examples:
n
X
(A) Choose a0 , . . . , ak1 to minimize
i .
i=1
1in
n
X
2i
i=1
Remark. It is generally considered that (A) is the best criterion but most awkward, and that (C) is the
least satisfactory criterion but easiest to use.
An analogous problem to that discussed in the previous section is the question of approximating a
function f (x) by a polynomial p(x) = ak1 xk1 + ak2 xk2 + . . . + a0 in an interval a x b. Here we
consider the errors
(x) = |p(x) f (x)|,
where a x b.
The problem now is to choose a0 , . . . , ak1 in such a way in order to make the errors small. There are
many ways to make errors small, and the following are examples:
Z b
(A) Choose a0 , . . . , ak1 to minimize
(x) dx.
a
Remark. As before, it is generally considered that (A) is the best criterion but most awkward, and that
(C) is the least satisfactory criterion but easiest to use.
Chapter 18 : Interpolation and Approximation
page 3 of 7
where 0 x 2.
Consider first of all the function h(x) = ax + b x2 . Then h(x) has a maximum value when dh/dx = 0.
This occurs when x = a/2, and this is in the interval 0 x 2 provided that 0 a 4. Note that
h(a/2) = a2 /4 + b. Also h(0) = b and h(2) = 2a + b 4. We now choose a and b such that
h(0) = h(2) < 0 < h
a
2
= h(0)
(the reader should draw a picture of h(x) in the interval 0 x 2 to illustrate these special requirements). Then we must have
b = 2a + b 4 < 0 <
a2
+ b = b,
4
so that a = 2 and b = 1/2. Hence the linear polynomial p(x) = 2x 1/2 gives
max (x) =
0x2
1
.
2
It should by now be clear that minimax approximations are rather awkward to use, even in the simplest
cases.
page 4 of 7
Example 18.4.1. Consider the points (1, 1), (2, 3), (3, 4), (4, 3), (5, 4) and (6, 2). Suppose that we wish
to find a least squares approximation by a polynomial of degree 1 (linear least squares approximation).
Suppose that p(x) = ax + b. We then consider the errors
i = |p(xi ) yi | = |axi + b yi |,
where i = 1, 2, 3, 4, 5, 6,
6
X
2i
6
X
=
(axi + b yi )2 .
i=1
i=1
Let us now think of S(a, b) as a function of the two variables a and b. We then must have
6
X
S
=2
xi (axi + b yi ),
0=
a
i=1
6
X
S
=2
(axi + b yi ),
b
i=1
0=
so that
6
X
!
x2i
a+
i=1
6
X
!
xi
b=
i=1
6
X
!
xi
a+
i=1
6
X
xi yi ,
i=1
6
X
!
1 b=
i=1
6
X
yi .
i=1
32
1
x+
5
15
where 0 x 2,
2 (x) dx =
T (a, b) =
0
(ax + b x2 )2 dx.
Let us now think of T (a, b) as a function of the two variables a and b. We then must have
2
8
a + 2b 4 ,
3
0
Z 2
T
8
2
0=
=2
(ax + b x ) dx = 2 2a + 2b
,
b
3
0
0=
T
=2
a
x(ax + b x2 ) dx = 2
page 5 of 7
2
3
n
X
(p(xi ) yi )2 .
i=1
for every j = 0, . . . , k
for every j = 0, . . . , k
page 6 of 7
page 7 of 7