You are on page 1of 4

P R O G R A M M I N G

IN C
CONCEPIS

BASIC
wIIH
METHODs
NUAMERICAL
40
FORMULA
INTERPOLATION such thatx
3.7
NEWTON-GREGORY
FORWARD
poBnts Xg» X *
interpolating
distinct
known for (n + 1) length.
x) be h is the step p(x,) x)
Let 0, 1, 2, n,
where
at most
such that
and , R,). i
= polynomial of degree
n
.(1)
interpolating
p(x) be the
Let written as
1. 2, .. n.
at most,
it may be
n
polynomial of degree (x
ince p(x) is a
A,(x x) (x - x) -x)
A,(x r) (x - x)
+
.. (2)
-x)
-

+
Pl) =
A+ A,(x
(x -Xn-1
.+A,(x * ) (x -x).. (1)
determined by
to be are constants
where
Ag A Az A, .

Substituting x =

x in (2), we get
A P l x g ) = Yo

Substituting x = *, in (2), we get

A+ Ax *) =p{x1) =Y
T%d
or A =

1!h
Substituting x = *2 in (2), we get
Agt A(x2 - ) + Azla2 - X) (*2 - x) = p(z2) = Y2

o (2h)+ A,(2h) (h) =y2


A =
%=2ay,y2-%-2(y -ya
(2h) (h) 2!h
2-2+Y
2!h

Substituting x = *3 in (2), we get


2!h
A+ A(x3 - *o) + A^(X3- Xo) (x3 - *) + A^lxy -*) (xg - x) (x - x,) = Px) **

Yo AY (3h)13h)
%+ 1!h (2h) + A,(3h) (2h)
2!h2 (h) =
y
A = %-34yo-34
(3h) (2h) (h)
= 3|y -Y,)-3(%-2y, +y,)
3!h
-3, +3y-%
3!h
3!h
Proceding in this way, we obtained

4, 5,
A, !h. = r= ... n.
INTERPOLATION I 29

Hence p(a) =
+ (x Ayo +(x
yo -

Ng) -X) (*- *1? 21h?


(-o ( -x) a -x) 3!h

- x). (x -Xn-1 A"Y


+(x x) (x -

x1) (x .. (3)
Now we
n!h"
Then
introducing a dimensionless quantity u, called phase, given by u Xo or
hOr x
x =
Xo +
"hu.
x-x, (* + =
hu) - (x+ ih) (u - i)h, i 0, 1, 2,
Then (3) becomes = .
=

P(X) =Yo + y,+Ay, +" ay, + 3! y , +..


u(u-1)(u-2)-(u-(n-1))-A'y% . (4)
Ihe above n!
polynomial is known as
Newton-Gregory forward interpolating polynomia.
Error term :
The error term in
Newton-Gregory forward interpolation is given by
R+1() =
(x -

xo) (x -

x1).. (x -x)
+1)
(n+1)!
u(u 1 ) (u - 2) ... (u - n)
where (n+1)!
minf*o, x x} < g <
max{x, X x).
NOTE 1 : The above formula is used for
interpolating at the starting of interpolating points with
0 < u < 1 to
minimize the error.
NOTE 2: Coefficients yo» Ayo AYo» A"y% are given by the upper diagonal of the forward
difference table.

NoTE 3: We note
that f+l) (x) can be approximated as f+) (x,)=A+ fx
. Tn
In fact, if if fr+)
fn*1)
() does not vary dramatically over the interval [xo X1, An+1) (E) A J%)_A
. R. (x) u(u -

1) (u -

2) .
(4 -

n) T+1
NoTE 4 The reason for the name "forward" interpolation formula lies in the fact that this formula
contains values of the function from flx) onward to the right.

FORMULA
3.8 NEwTON-GREGORY BACKWARD INTERPOLATION
ih
1) distinct interpolating points xo» Xp X, such that x, x +
=

fx) be known for (n + .

Let
step-length. is the
and y, =
fx), i 0, 1, 2, n where h
= ..,

i 0,
n at most such that p(x) fa) =
yp
=

p(x) be the interpolating poilynomial degree


of =

Let
.(1)
1, 2, n
is polynomial of degree n at most, it may be written as
Since p(x) a

- X-1) + Bylx x) x x-1) (x -n-2 B,(x - x,) (x


-

px) Bo B,(x
=
x) + -

. (2)
+

(x -x,-1)... (x -x1)
.+B,x- x,)
IN C PROGRAMMING
NUMERICAL METHODS wITH BASIC CONCEPTS

where B. B,. B , are constants to be determined by (


Substituting x = x, in (2), we get

BPX) Yn
Substituting x = x,. in (2), we get
B+ B,(x-1 *)= p(x,-1) =Yn-
or. B -
1!h
Substituting x =
x,-, in (2), we get
Bo+ B,X-2 - Xp) + B,x,-2 - X) - 2 - X-1) = plxn-2) Yn-2

Yn
Y,+ 1!h (-2h) +B,(-2h) (-h) =Yn-2
B, = Y, +2Ay,n-1 _Yn-+20y,-Yr-
(2h)(h) 2!h
Y2-tY1-2
2!h*

2!h
Substituting x =
x-3 in (2), we
get
B+ B,(x-3-X)+ B,",-3
- *,) (,-3- Xn-1) + B,n-3-*,) n-3 -
(-3-2)= Pl*n-3) = Yn-3 X-1)
y.
1!h (-3h)+
-
Y. +
-3h) (-2h) +
B,(-3h) (-2h) (-h) =
yn-3
B, = n-2
(3h) (2h) (h
Yn-3y,+3y,-yn-)-3y,-2y,-ty,)
3!h*
-3+3y-
3!h
An-3
3!h
Proceeding in this way, we obtained

B, =
,r =4, 5, ..., n
r!h
Hence plx) =Y, + (x -

+ (* - *n) (x -

x,) 2
2!h2
+
(x-x) (x -

Xn-1) (*- X-2)


3!h
+(x -

x,) (x -

-1) x -

xn-2) .(x x,) -

A% . (3)
n!h"
Now we introducing a dimensionless quantity v, called phase, given bu
= or x = x, + vh = *y +(n +v)h.
h
Then x xn-i =X0 + (n + v)h - o * (7 - i)h) = (v + i)h, i = 0, 1, 2 . .
INTERPOLATION I 31

Then (3) becomes

p(x) =

+A ay. +v(v+1)(v
3!
,
+2)
A'y..
v(v+1) (v +2).. (v+ (1-1)) A"
n
. (4)
c Oe
polynomial is known as
Newton-Gregory backward interpolating polynomial.
Error term
The error term in
Newton-Gregory backward interpolation is given by
+1)=(x -x) (x -x)...(x -x,) (n+1)!
=
v(v + 1) (v + 2).. (v + n) f+(E) h"
where (n+1)!
min{xo» x x} < 5 < max{xo» *n x.
NOTE 1 : The above formula is used for
interpolating
-1 < v < 0 to minimize the error.
at the ending of interpolating points wiu
NOTE 2: Coefficients y Ay,n-p Ay,-2 ,
A"y, are given by the lower diagonal of the forward
difference table.
NOTE 3 We note that fn+l) (x) be
can
approximated as+ (E) =* h+1
In fact, if f*1) () does not very dramatically over the interval [x_, x,l. fn*1) (E)
AS h " + 1
1 where x_ =
Xo
-

h and
y- jx.1
=

n+l
'Rn+1x) * v(v + 1) (v + 2) .. (v+ n)
(n+1)!
NoTE 4: The reason for the name "backward" interpolation formula lies in the fact that this
formula contains values of the function from fx,) backward to the left.

3.9 GAUSss's CENTRAL DIFFERENCE FORMULA

(a) Gauss's forward formula with odd interpolating points


Let lx) be known for (2n + 1) distinct interpolating points Xo X1 *42 n Such that xi

*0tih and yai =J ) , i = 0, 1, 2,..,


n.

Let p(x) be the interpolating polynomial of degree 2n at most such that plx) =flx) =
y, i
=

. (1)
0, t1, t2, ..., tn

A,(x xo) + A2x -x) (x x1) + Az(x x1) (x x) (x - x)+


-
-

Letp(x) =
Ap t
(x -x-)
+A2n-1 x-(n-1) (x -x-(1-2)...(x - x_1) -x) (x-x)..
-
(x
. (2)
Xn-) (x -x,)
+A2X-*(n-1) (x -X(n-2}) (x -*1) (* -o) -x1)..(x
(x .

Substituting x =
* in (2), we get
Ap Px)=Yo
Substituting x =
X1» in (2), we get
A+ A4- *= plx1) =y1
A x- 1!h

You might also like