Professional Documents
Culture Documents
Mathematics
2 Week 5_2
Interpolation
1940
Popula 132,16
tion
5
In
1950
1960
1970
151,32
6
179,32 203,30
3
2
1980
226,54
2
1990
249,633
We assume that the given data are exact and represent values of some unknown function. If
we desire to find a polynomial that passes through the same points as our unknown function,
we could set up a system of equations involving the coefficients of the polynomial. For
example, suppose we want to fit a cubic to these data:
First,
F (x)
3.2
22.0
2.7
17.8
1.0
14.2
4.8
38.3
5.6
51.7
Lagrangian Polynomials
When x = 3.2: a(3.2)3 + b(3.2)2 + c(3.2) + d = 22.0
Lagrangian Polynomials
Suppose we have a table of data with four pairs of x and f(x) values.
x f(x)
-------------x 0 f0
x 1 f1
x 2 f2
x 3 f3
p3 ( x )
( x x1 )( x x2 )( x x3 )
( x x0 )( x x2 )( x x3 )
f0
f1
( x0 x1 )( x0 x2 )( x0 x3 )
( x1 x0 )( x1 x2 )( x1 x3 )
( x x0 )( x x1 )( x x3 )
( x x0 )( x x1 )( x x2 )
f2
f3
( x2 x0 )( x2 x1 )( x2 x3 )
( x3 x0 )( x3 x1 )( x3 x2 )
Lagrangian
Polynomials
Example:
(3)(4)(6)
(1)( 4)( 6)
(2.4771)
(2.4829)
(4)(5)(7)
(4)(1)(3)
(1)( 3)(6)
(1)(3)(4)
(2.4843)
(2.4871)
(5)(1)( 2)
(7)(3)(2)
log10 301
(5)(12)
(3)(12)
(3)( 5)
(1)
(3)
(4)
(8)(15)
(8)(7)
(15)(7)
1 27 4
1.86
2 14 7
x
The
Finite Differences
Forward Differences
If y0, y1,,yn denote a set of values of y, then y 1-y0, y2 y1,,yn yn-1
are called the differences of y. Denoting these differences by
y0 , y1 ,..., yn
respectively, we have
y0 y1 y0 , y1 y2 y1 ,..., yn 1 yn yn 1
y0 , y1 ,..., yn
are
Finite Differences
The differences of the first forward differences are called second forward
2 y0 , 2 y1 ,...
differences and are denoted by
Similarly, one can define third forward differences, fourth forward differences. etc.
2 y0 y1 y0 ( y2 y1 ) ( y1 y0 ) y2 2 y1 y0
Thus
3 y0 2 y1 2 y0 ( y3 2 y2 y1 ) ( y2 2 y1 y0 )
y3 3 y2 3 y1 y0
It is therefore clear that any higher order difference can easily be expressed in
terms of the ordinates.
The following table shows how the forward differences of all orders can be
performed:
the set of (n+1) values, viz., ( x 0, y0), ( x1, y1),,( xn, yn), of x
and y, it is required to find yn (x), a polynomial of the nth degree
such that y and yn(x) agree at the tabulated points. Let the values
of x be equidistant, i.e., let xi = x0 + ih, i = 0,1,2,,n.
Since yn(x) is a polynomial of the nth degree, it may be written as
yn(x) = a0 + a1 (x x0 ) + a2 (x x0) (x x1)+ +an(x x0)( x x1)
( x xn-1) (i)
Imposing now the condition that y and y n(x) should agree at the
set of tabulated points, we obtain
Setting
y1 y0 y0
2 y0
a0 y0 ; a1
, a2 2 ,...
x1 x0
h
h 2
p ( p 1) 2
p ( p 1)( p 2)...( p n 1) n
yn ( x) y0 py0
y0 ...
y0 ...(ii )
2
n
which is Newtons forward difference interpolation formula.
Here h = 1, hence using the formula x = x 0+ph and choosing x0=0, we obtain p=x.
Substituting this value of p in (ii), we get y (x) = 1 + x(-1) + x(x-1).(2) / 2 + x(x-1)(x-2).(6)/6
= x3 2x2 + 1, which is the polynomial from which we obtained the above tabular values.
y (4) = 1 + 4(-1) +12 +24 = 33
Which is the same value as that obtained by substituting x = 4 in the cubic polynomial
above.
Note: This process of finding the value of y for some value of x outside the given range is
called extrapolation.
Divided Differences
Let
( x0, y0), ( x1,y1), , ( xn,yn) be the given (n+1) points. Then the divided
differences of orders 1,2,,n are defined by the relations
x0 , x1
y1 y0
,
x1 x0
x0 , x1 , x2
x1 , x2 x0 , x1
x2 x0
..............................................
x0 , x1 ,..., xn
x1 , x2 ,..., xn x0 , x1 ,..., xn 1
xn x0
Even
if the arguments are equal, the divided difference may still have a meaning.
We then set x1=x0 +
x0 , x1 lim 0 x0 , x0 lim 0
It
Hence
x0 , x1
y x0 y x0
y ' ( x0 )
y0
y1
x1 , x0
x0 x1 x1 x0
Divided Differences
Now
x0 , x1
x0 , x1 , x2
y1 y0 1
y0
x1 x0 h
x1 , x2 x0 , x1
x2 x0
generally, x0 , x1 ,..., xn
If
1 y1 y0
1 2
2 y0
2h h
h
2h
1 n
y0
n
hn
x, x0
y y0
x x0
y y0 ( x x0 ) x, x0
Again x, x0 , x1
x, x0 x0 , x1
x x1
x, x0 x0 , x1 ( x x1 ) x, x0 , x1
y y0 ( x x0 ) x0 , x1 ( x x0 )( x x1 ) x, x0 , x1
But x, x0 , x1 , x2
x, x0 , x1 x0 , x1 , x2
x x2
So x, x0 , x1 x0 , x1 , x2 ( x x2 ) x, x0 , x1 , x2
y y0 ( x x0 ) x0 , x1 ( x x0 )( x x1 ) x0 , x1 , x2 ( x x0 )( x x1 )( x x2 ) x, x0 x1 , x2
Similarly , y y0 ( x x0 ) x0 , x1 ( x x0 )( x x1 ) x0 , x1 , x2 ( x x0 )( x x1 )( x x2 ) x0 , x1 x2 , x3
This
x
log10x
300 2.4771
0.00145
304 2.4829
-0.00001
0.00140
305 2.4843
0
0.00140
307 2.4871
= x4 3x3 + 5x2 6.
Next
More
Numerical Methods