Lagrange Polynomial: y (X) A X X X X X X X X X X X X
Lagrange Polynomial: y (X) A X X X X X X X X X X X X
y(x) = a0 ( x x1 )( x x 2 ) + a1 ( x x 0 )( x x 2 ) + a2 ( x x 0 )( x x1 )
y0
a0 =
(x0 x1 )(x0 x2 )
y1
a1 =
(x1 x0 )(x1 x2 )
a2 =
y2
% xx (
j
y(x) = y i ''
**
j= 0& x i x j )
i= 0
ji
n
(x2 x0 )(x2 x1 )
polynomial approach.
required in the standard
Programming is easy.
Polynomials of degree greater than 2 or 3 generally not used.
2.
3.
x i x x i+1
x i x x i+1
F(xi)
Fi-1
Fi
g(x)
F(xi)
hi-1
x0
x1
xi-1
hi
xi
xi+1
xn
x i x x i+1
di = f i
(1)
(2)
hi = x i+1 x i
Si = 2bi
(3)
(4)
Si
bi =
2
fi+1 fi hi
ci =
(2Si + Si+1 )
hi
6
di = f i
Si and Si+1 are determined by using the condition that the slopes of
the two curves (Fi and Fi-1 ) joining at point (xi, fi ) be
the same.
Fi"( x i ) =c i
ai1 =
6hi1
S
bi1 = i1
2
ci1 =
fi fi1 hi1
(2Si1 + Si )
hi1
6
di1 = f i1
Substituting for ci, ai-1, bi-1, ci-1 ,above yields a tridiagonal system,
which can be solved to obtain Si.
( , i =1,2..,n -1
hi1 '
$ hi
( , i =1,2..,n -1
hi1 '
$ hi
S(x)
S(x0) = 0
x0
xi-2
Example
xi-1
xi
xi+1
xi+2
xn