NM - Unit 3
NM - Unit 3
NM - Unit 3
Finite Differences
y Yo Yt Y2 Yn- t . Yn
If we subtract from each value of y (except y0 ) the preceding value
of y, we get
Y1 Y:r!..} 1, Y3 - Yi, ···,Yn - Yn- l
These results are ~alled the first differences of y. The first differences
1
of y are denoted by Ay.
f. '.:~ ( I
That is, Ay0 = Yt - Yo
Ayl = Y2 -yl
Ay2 = Y3 -y2
Ayn - l = Yn - Yn- l
Here, the symbol Li-denotes an operation, called forward. difference
operator. -
- Higher differences 0'fh~SeGOnd and higher differences are defined as
C
below : , '
·····························································
2 ' '
Ji Yn - I= A(Ayn - 1) = A(yn -yn - 1) =Ayn ..... Ayn :....1
2
Here, t:.. 1s an operator---c alled, second order forward difference
170
Finite Differences 171
operator. .In the· same way, the third order forward difference operator
A3 is as follows :
A3Yo = A2Y1 -A2Yo
A3yl = A2y2 ""'." A2y1
................................... etc.
In generaI An An-I , An-1
u Y; = Ll Yi'+1 - Ll Y;
Though the arguments x0, x 1, x2, ... need not, in general, be equally
spaced, for purposes of practical work, we take them equally spaced.
Usually, the arguments are taken as
x0 , x0 + h, x0 + 2h, x0 + 3h, .... ,
so that x1 - x0 = x2 - x1 = x3 - x2 = .......= h
'
~ere, h is called the .interval of differencing.
Therefore, ~(x) = f(x h)-f(x)
A2f (x) = A (Af (x))
= tif (x+ h)- ~f(x) ' .
= [f (x + 2h) - f(x + h)] - [f (x+ h) - f (x)]
' '
= f (x + 2h)-'2f (x + h) +f (x)
~.3J(x) = .6.2[4{(x)] = .1.[A-1/ (x)]
. \
= Af{x+ 2h)- 2tif(x + h) + 4f(x) _
=f(x + 3h) -J.(x + 2h)-2 [f(x + 2h) -f(x + h)]
+ f(x+ h)-f(x)
= f (x + 3h) - 3/ (x + 2h) + 3f (x + h) - f (x)
and so on.
Operators. We have already defined the forward difference operator
A." We will now see some more operators and the relations connecting
them.
Backward difference operatd.r..:_(V) :
Backward difference oper:ator (V) is defined as .
Vf(x) = f(x)-f(x- h)
By definition Vi1 = Yt ·-Yo
(
Vy 2 = y2 - y 1 etc.
' '
2
Hence Y (x) = V[f (x) ·-f (x- h)]
/
=V/(x)- Vf(x-h)
= f (x)- f (x- h);.., (f (x- h)- f (x- 2h)]
= f (x) .... 2f'(x- h) +f (x- 2h)
Central difference opera;to~ (6) :
The central difference operator 6 is defined by
172 Numerical Methods-IV
µyx=;(Yx+1+Yx-1)
i.e., µ/(x) =; [t(x+; )+t( x- )]
Differential operator D : The differential operator·D is defined by
--·· d
D f (x) = dxf (x)
This is called
Note. Two operators 01 and 02 are equal if 0t.f(x) = 0 2.j(x) for all f(x) .
... (1)
or ... (2)
Here, 1 is not the numeral 1 but it is the unit operator 1 which means
1 f (x) =f (x).
Relation between E- and V :
VJ (x) ; f (x) -f (x - h)
= 1f (x) - E- 1! (x)
::: (1 - E- 1) / (x)
lll(x) = 1( )-1( x+ x- ~)
= E I12 f (x) -E- 112 f (x)
/ = (Eu2 E-112)/(x)
I12 2
.-:-tlo=E112 -E- 112 I =E- [E-1]=E-v 8 ... (5)
J(x+h)=f(x)+
h I (x)+2!
h f 1l(x)
. • ,
2
-t: ,. ....
·
to oo
11 2
h h D2f (x) + ...... to oo
... Ef(x) = f(x) + 1! Df(x) + Z,!
= [ l+l!+ 2!
hD
2
0!}) + f:,hD) + ...... to oo
3!
3
]f (x)
L . =iv f (x)
t/ / E=iD 1 ... (8)
E=l+Li=e"D
hD = log E =log (I + A)
. Li 2 ~3
hD = Li - -·- +-- - ...
... D=-
h
ll 2
L\ . 11
a--+--
2 3 ...
]
2
3
3
... (9)
I 4
11
2 15
,
25
3 40
45
4 85 0
71.
5 156 32
103
6 259
_ In the table, each difference is ·written midway between the values
subtracted from the previous column. In this example, the third
differences are constants and the fourth differences are zeros.
2
[!o find Yk in terms of Yo, Ay0 ; A yo, ......
k
Yk ==E Yo
=(1 +~lYo
176 Numerical Methods-IV
3 2
= 2 + 7n + 6n2 - 6n + n - 3n + 2n
= n3 + 3n2 + 3n + 2
,;:-\ =(n+1)3+1
I ?'-' . _ · 3 .
\__;I ·• Y6 - ( 6 + 1) + 1 = 344 .
~r v Example 2. Find-f (x) from the table ,below. Also find f (7).
lJ x: o 1 2 3 4 s 6
f(x): -I 3 - 19 53 111 199 323
Finite Diff(!rences 177
2 19
34
3 53 24 0
58 6
4 111 30 0
88 6
5 199 36
124
6 323
s
d4'f(x),df(x), ...... are all zeros.
Yx=E"yo=(l+dtYo
=Yo+ xcI dyo +XC2 d2Yo + XC3 d3Yo +XC4 d4Yo + ······
f (x) = x3 + 3x
2
- 1
_ /1 ' /(7..)=7 3 +3(49)-1=489
~ ample 3. Find the first term of the series whose second and
subsequent terms are 8, 3, 0, - 1, 0, ...
Solution. Let y0 be the first term.
:. y 1 = 8, y2 = 3, y 3 = 0, etc.
The difference table is
y 1v d2y d3y d4y
u YO
I [ y1=8
-5 2
2
3
3
0 , ,l,,
-3
..-1-
2
0
0
J
2
4 -1
,., l
5 0 0 ,,'
The differences of Y1 are y 1 = 8, d y1 = - 5, t:/y I =2. > t:/yl = 0,
t:/y 1 = 0 etc.
-1
Yo= E Y1
1
= (1 +df Y1
=(l-d+d2-d3+_~4-······)y1
2 3
= Yt - dyt '+ ~ Yt - il. Y1 + ······
'
178 Numerical Methods-IV
= 8 - (- 5) + (2) - 0 + ......
= 15
A"((Exa~ple 4. Fin~ the sixth term of the sequence 8, 12, 19, 29, 4 2,, ....
tK,~ 0Solution. The difference table is
3
X y /J.y /J.2y /J. y
0 8
1 3 0
2 3 0
10
3 29 3
13
4 42
6th term= y5 =lfy0 =(1 t.L\}5y0
3
=Yo+ 5dy0 + 10L\2y0 + 10.!! .Yo + ......
= 8 + 5(4) + 10(3) + 10(0) + :..
!/.' =58
Express any value of y in term of y n and the backward
differences of y n·
We know Vyn = Yn - Yn-1
.. Yn-1=Yn-Vyn=(l-V)Yn
Similarly Yn-2 =Yn-1 - VYn-1
) = (I - V) Yn - I
= ( I -- V) ( I - V) yn
.....
180 Numerical Methods-IV
3. The above proof is not rigorous. For a rigorous
proof, apply
mathematical induction.
5-4. Factorial polynomial
A factorial polynomial x(n) is defined as
x'n) =x( x-h )(x- 2h) ....(x- n-1 h)
where n is a positive integer.
(Read in) as x raised to the power n factorial)
Thus, x(I) = x, x( 2) = x (x - h), i 3>=- x (x - h)(x - 2h), .....•
etc.
Differences of x(n)
(i) tu,(n) = (x + h)'n) - X(n)
= (x + h)(x)(x - h) .... !x - (n - 2) h]
-x( x-h )(x -2h ) ...... [x- (n- I)h ]
= x (x - h)(x - 2h) .... [x - (n - 2). h] { (x + h) - (x - n
- I h)}
=x< n-1) . ;;h
= nh x(n- l)
Similarly tix(n ) = 11 [nh x<n- I)]
= (nh)(n- 1) h x<n- Z)
= n (n -1) h2 x(n-Z )
Proceeding like this, 11' in)= n (n - 1)(n - 2) ..... (n -
r + I) h' x<n - r),
where r is a positive integer and r < n.
Note 1. In particular !).n x<n> = n ! hn.
2. If h = 1, i.e., the interval of differencing
is unity, then
!).'in) = n (n - 1)(n - 2) ..... (n - r + 1) in - r) whic
h is analogous to
the differentiation of xn.
3. If h=-1, !).nx(n)=n !, and !).'in)=O if r > n. .
4; Wherever we require!).' xn, it is difficult to find !).'xn
and hence we
express x" in terms of factorial polynomial and henc
e we calculate
!).'xn.
Reciprocal factorial
The reciprocal factorial function x<- n) is
defi ned as
1
xt-n) =
(x+ h)(x+ 2h) .... (x + nh) where n is a positive integer.
Differences of a reciprocal factorial function
(i) Af(- n)= -(x+ hi-n )_X( -n)
1
= (x + 2h)(x + 3h) ...... [t + (n + l) h] - (x + h)(x + 2h) ..
....(x + nh)
Finite Differences 181
1 - .
1
= (x+h)(x+2h) ...... [x+(n+ l)h] [(x+h)-(x+n+ h)]
-nh
=----- ------
(x + h)(x + 2h) ...... [x + (n + l)h]
=(-n) hx<-<n+I))
2
(ii) A x<-n)=A(Ax-n)
= A (- nh x<- (n + 1}))
= (- nh) [- (n + 1) h] x<- (n + 2»
= (- 1)2 h2 n (n + ~) x<-(n+2))
Similarly
s·x(-IIJ=(-1),.n(n+ I)(n.+2) . ......(.ll + I·-1) X (n+r) ,,. _
.'l
cj>{x) = i
3
> + 4x'2) + 3x' 1) + J
183
Finite Differences
2 1
Llcj>(x) = 3i >+ 8i ) + 3
1
Ll 2cj>(x) = 6i ) + 8
3
.1 cj>(x) = 6
Llr<j>(x) = 0 for r > 3
4 3 2
Aliter. (i) y = x + 3x - 5x + 6x- 7 can be written as
3 2
y=x +3x -5x +6x-7 =Ax( x- l)(x-2 )(x-3) +Bx(x - l)(x-2 )
4
+ Cx(x- 1) +Dx+ E
1
= Ai4) + Bi3) + Ci2) + Dx' ) + E
Put x =0 ; E =- 7
Put x = 1 ; D + E = - 2 :. D = ~
Put x= 2 ; 2C+ 2D+E = 16+ 24-20 + 12-7; C= 11
Put x = 3 ; 6B + 6C + 3D + E = 81 + 8 I - 45 + 18 ~ 7
6B=:5 4; B=9
3
Equate · coefficient of x on both sides; A = 1
:. y = X(4) + 9}3) + 1li ) + 5x' ) - 7
2 1
3 2 1
(ii) 4>(x) = 3x - 2x + 7x- 6 = A} ) + Bi ) + ci >+ D
3 2
(ii) ( l 1
f x)= (3x+ 1)(3x+ 4)(3x+ 8)' if h=
184 Numerical Methods-IV
= 3l(x+n(x+; (x+;J
=;7(x-n-l)
t,f(x)= ; r
(-3)( x- ~ since h= l
x-; r
1
2/(x)= (-3~~-4) (
=9
108
--
= - - - - - - - - - -x+ 13)
(3x+ 1)(3x+4)(3x+7)(3x+ 10)(3
Example 8. Find !!..3 f (x) if
\ , (i) f (x) = (3x + I )(3x + 4)(3x + 7) ... ...(3x + 19)
(ii) f (x) = x (3x + J)(3JQ + 4) ......(3x + 19)
(i) Solution. f (x) = (3x + 1)(3x + 4)(3x + 7) ......(3x + 19)
(contains 7 factors)
=3
7
( x+ !)( x+¾ }···{x+ ~ J
7
19J( )
=37( x+-
3
r~
6( I: r
df(x) =37(7 )(x+
2 7
r
8 /(x) = 3 X7X x+
3 7
8 f(x) =3 x7 ,x 6 x5 x( x+ ~
3
= 3 x 7 x 6 x'5 (3x+ 19)(3x+ 16)(3x+ 13)(3x+ 10)
(ii) f (x) = x (3x + J)(3x + 4) ..•·...(3x + 19)
=-1·3 s ( x- -
3 , . 32 )(
x+ -1
3 J( -.+ -43 J..... .( + 319 J·.
X X . . '.
' =37x
(
+: ) +2 -3 6x +: )
7 6
19 )( ) , ( )( )
4{(x)-3
1
x8 x ( x+ 3 +2-36-7 .x +:
6
7 .( 19 J( ) 6 ( 19 J(S)
etc.
,
2
Af (x) =3 ·8·7 x1 +2 ·3 ·7·6 x+
3 3
7 in terms of factorial
xample 9. Express f (x) = x - 31 + 5x +,
3
~
erences. -
pol yno mia l taking h = 2 and find its diff
Solution. . . . . . '
3
Le tf( x) =x - 3x +,s x·+ 7 =A
2
. x(x
.:. h)( x- 2h) + Bx (x- h) + Cx + D .
Put x = 2 ; 2C + D 8 - 12 + =
10 + 7 ; :. 2C = 6. Hence, C = 3 I
l
Standard Results
Prove: _(i) A[ / (x) g (x)] =f(x + h) Ag (x)
+ g (x) t,/( x)
186
Numerical Methods-JV
=2cos ax+b+ ah sm ah J.
( 1 2
. ah. (1t
= 2 sm-sm -+ax+ bah]
+-
2 2 2
. ( ax+ b + 1t
. ah · sm
= 2 sm
2
+ah J
2
,i.
2
sin (ax+ b) = 2 sin~ il. [ sin ( ax+ b + 1t ~ah J]
=( 2 sin a; J- sin [ ax+b +2 ( 1t ~ah)]
Finite Diffe.r..ences 187
Similarly proceeding,
An
L.l
• (
sm ax+ b) = ( 2 srn
. 2ah'.Jn,•sm
. ( ~ + b + n(1t+ah)
2 J. ·
(iii) fl [cos (ax+ b)] = cos (ax+ ah+ b) - cos (ax+ b) ·
l;
I •
n . \'
= lo [
-g
1+/l(ax+
· ax +·b
b)'.] . -
• I
(v) /l(ahx+c)=ah(x+h)+c_ahx+c: ·
' .
/
=a
hx + c ( hh .
a -
1)
/J,.2 (ahx+ c) = ahx+ c ( ahh _ 1)2 .
flf(x)]
= log [ I_+ f (x)
h . 1[
= tan- ]
. l+x~ +~
3
__ .Aam ple 11. Evaluate (i) fl (e x log _2x), (ii) fl (x sin x) (iii) fl (xe-') 11
=e'
3 3
[ e h log ( I+ ~ )+ (e3h - I) Jog (2.x)]
lesser degreel
2'
= 10 ! 10 ! + 0 = (10 !)
· (iii) A [(1 - x){l ~ 2x2)(1 - 3x3)(1- 4x4)]
10
=[(E- 1)2 E- 1] ux
=[f-2+E - 1] ux
(vi)
• . , I - ?+~ . I l 2
\ X!I) ~l -- 2- r. = '\/ l + - 8
\II+~ 4
Note ff o prove above results, el{pr~ss each in terms of E I ,
' . . i
=Eux- E ux-h
. I
. ·=~uX-
:.~ ~\
Also (VE) ux = V (Eux) = Vu;+h
' '
= !!J.uX
VE= !!J.
Hence EV =/!J. =VE
( ll.. ),_ u
~E112 - ~
Ux = uU h
x+-
2
= (E 112 - E- 112) U h
x+-2
=fluX
:. 8E112 = fl
Note. Hereafter, the operand ux may be dropped and algebra of operators
may be used.
( iii) We have proved already, E = i0
: . iD = E = 1+ fl
Taking logarithm, ·
hD log e = log· (l + fl)
. 'hD = log (1 + fl)
--
Also, V = 1 - E- 1
· : •• IT 1 = I - V
... (i)
I •
'
.
ke., e-hD = 1 - n
v
.' - 1
Talcihg logarithm, '' -_hD = log (1 - V)
hD=-l og(l-V ) ____ _
sinh (hD) =e - e
hD -hD 'E
= -
E !...) , (
=
El/2
~ +E
-1/2 J(E 112 - IT 112)
2 , 2 2
; I =µ8
hD = sinh- 1 (µ8)
I
1/2 2
._ 1/2 ] . , , . . l
-(iv) 1 + µ~02 = t" + E +2E (E112 _ E•- tl2)2
(
Finite Differences 191
•
=E-l=A
(ix) VA=(l-E - 1)(E-,l')=E +E- 1 -2=(E 112 -E- 112)2=r/-
A- V = (E- 1) - (1 - E- 1) = E + E- 1 - 2 = 62
(x) (1 + A)(l - V) =E.E -t =1 l '
(xii)
2 + A 1+ E 1 [E L'112 + El/2] - µ
· =-=- - .
2✓ 1 +,A 21£ 2 · 1
Y6 = E'Yo5 (1 + d)6Yo ·
1
_ 6
= ( 1+ C1b.+ 6C2 b.-2-~ ·-Cj
6 3 6
t .+ C4 u_+
A4 6c A5 A6 )
5u +u Yo .
= (1 + 6/!!. + 15/!!.2 + 201!!.3) y0 ~ince· other terms vanish.
= [1 + 6(£ -1) + 15( £- 1)2+ 20 (E- 1)3] Yo .,
= (1 +·oE- 6+ 15E - 30£ + ·1s +·20£3...:. 60E' + 60E
- 20) Yo
= [-1 0+ 36E .- 45£2+ 20E] Yo .
= - ·10y0 + 36y1 -45 y2 + 20y
3
=-1 0(9 ) + 36(18) ~ 45(20) + 20(24). ..
=-9 0+ 648 -90 0+ 480
= 112 8-9 90= 138 'I
i.e., A y0 =0
4
:. (E- 1)4y0 =O
2
i.e., (£4-4F :+6E ...;.4E+1)y0 =0
, Y4 -4y3 + 6y2 -4y1+Y o70 where Yo= 45·0
67·4-4y 3 + 6(54-1) -4(49•2 ) t 45-0 = 0
4y3 = 2402 :. y3 = 60-05
Missing term is 60-05. '
. Exampl~ timate the productiq_n for 1964 and 1966from the
following data :
Year 1961 1962
., 1963 · 1964 1965 1966 1967
Production 200 220 260 350 430
Solution. Since five values are given, collacation polynomial is of
5 ·
degree four. ~ence tl y K = 0
i.e., . (E- l)5yK = 0
(Jf-5£4 + l0F:-1 0E2+5 E--1)yK =0
Ys -5y4 + l0y3 - 10y2 + 5y 1 - Yo= 0, taking K = 0
-Ys - 5(350) + 10y3 - 10(260) + 5(220) - 2003 0 .
i.e., y 5 + l0y3 = 3450 ...(I)'
Taking K= 1,
Y6 - 5y5·+ 'lOy4 - lOy3 + Sy2 ~Yi= 0
430 - 5y5 + 10(350) - 10y3 + 5(260) ~ 220 ~'O
5y5 + .i0y3 = 5010 ... (2)
6-1. ·1utroduction
• I •
in both ·proce~ses. , .,
Let y=f(x) be the function taking the values y0,y 1, ••• , Yn
corresponding to x =Xo, x1, ... , xn. 'In other words, Y; = f (x;), i = 0, I, 2, ... ,. n.
J
If f (x) is known, the value of y can be c~lculated for any x. But in many
cases we have to find y = f (x) such that Y; = f (x;), from the given table.
This is-not easy because there are infinity· of functions y = <j>(x) such that
Y; = <j>(x;), Hence, from the table, we cannot find a unique (j>(x) such that
y = ~(x) satisfies the set of values given in the table above. Of the
sequence of functions {(j>(x)}, there is a unique nth degree .polynomi~l
PnCx) such that Y; =PnCx;), i = 0, I, 2, ... , n. (Refer Fig. 1).
. .
y
y=cl> (x)
, Yn)
- y=P n
y= f (x)
X
0
Fig. _I . - .
different purposes. In this chapter, we will be mostly concerned with the
polynomial interpolations only.
Polynomial interpolation 1s mostly preferred bec;ause l of the
foll~wing reasons: ,
1. They are simple fqnns of functions which can be easily manipulated.
2. Computations for definite values of the argument, integ_ration and
differentiation of such functions, are easy.
3. Polynomials are free from singularities whereas rational
functions ·or other types, do have singularities. '
The basis of finding such collocation polynomial is the fact that
there is exactly only one collocation polynomial PnCx) of degree n such
that the values of P,i(x) at x0 , Xi, x2, ... , xn coincide with the given
functional values y0 , Yi, y 2, ... , Yn· He;e, · i'nCx) is ~alled polynomial
approximation to f (x) . We shall see below a few of the methods of finding
1
such interpolating -polynomials. ' • •
y Yo - YI Y2 Y3 ... , Yn
Now we requ~re the value of y corresponding to Xk which lies
between Xr and x,+ J•
. . .
We will assume the polynomial to be linear. (i.e. st. line)
.h . . . y-y, Y,+1-Y,
T e 1rne equat10n 1s - -
x - x, x,+ 1 -.x,
Y,+1-Y,J -
:. Yk=y,+ x,+
( ,-x,
1
.
(xk-x,) gives the
, , vaIue _o f y at x=xk,
Xr<xk<X,+ 1•
In'tirpolation 211
(Xr+1'-'r+1
V ) • '•
This method may be y
sucGessful · if the difference
between s-t1cceeding pairs of
values of the variables are I
small
i'
and regular. But, if the
intervals between the two pairs
of values
I
are
•
large, and I
l t.
SOUIOn. ·· Yk=y,+ (yr+ ,I -:- Y') (Xk-X,J·
., ,
x,+ 1 -x, . .
y (O·St= 2 + ( -
3 2) (0-·5 - 0) = 2-5
_ . (1-0) _ .·. I, __ .
:, . Let ,y =J,(x\ denote a function which takes the values Yo, y 1, . .. , y11
' I. ' ' I .J J J..,
,, ) ', - . ' . '
corresponding to the values x0 , x 1, ... , x11 respectively of x. \ ·
I ' I
Let us suppose that -!he value~.,pf) x viz. x0 , x1, ••. , x11 are ·equidistant.
\ .
. X; - X; _ I -- h , for l. -- I , 2 , ...·, n.
Th at lS, '" "'
Therefore, r X; = Xo + h, X2 = Xo + 2h, etc.
X; =x0 + ih, i .= 1·, 2, ... , n.
Let P n(x) be a po~ynoriia1 of the_ r,th de~r~e m x such that
Y; ,=J(x()=.PnCx;), i=q, l,}., ... ,,n. 1
•
Setting x = x0 in (2),
. h ther terms in (2) vanish)
fl.r pn (xo) =arr ! h' (Smee t eo
l.e., Li' y0 = a, r ! hr
... (3)
1 Ar
Hence a, = --, L.l Yo
rlh
. . we et the values of a1' az, ... , an·
Putting r ::; 1, 2, 3, ... , n m (3), g
Therefore,
... (4)
---=
J
(1) (2) (r)
u 0 0 tl .
(x) =P0 (Xo +uh)= Yo _
2
+ l! Li Yo+ 2! A Yo+···+ r ! Yo+
·_ . u<n) n
+ ... +-, A Yo· ... (5)
n.
where u<r:> = u (u - 1)(u- 2) .. ,,(u -r-- 1)
(If X is given, u is found out).
~quation 1(5) is known .as Gregory-Newton forward interpola6on
formula. ·
Aliter. We can a1so__pr-ove1he above formula using symbolic operat01
methods.
PnCx) = PnCx0 +uh)= Eu PnCx0 ).;; Euy0
= (1 + AtYo
Interpolation 213
where u = - ~ ·
x-.xo
h
. .I -
1
If y (x) is a polynomial of nth d ~ An+ y0 , ... are ~ero. Hence
· ·· •
0
(1) · . .p>- . 1 • (n) ·
Let I .
PnCx) = a0 + a1 (x- xn) +a2 (x-xJ(x -xn_ 1) + ;..
. + a, (x - xn)(x - Xn _ 1) ... · (x :- Xn -:- , + 1) + .. ·
+an (x-~n)(x-xn_ 1) ... (x-x1) ... (1)
Since Xn-t =xn-h, x~_ 2 =xn ~ 2h; ... ,xn-r+l =xn-(r- l)h
x1 = xn - (n t) h, wehave
PnCx) = ao-+.-a 1 (x-:- xn)+ ai (x ·".'" xn)(x - xn + h)
+ ll:J (x-xn)(x-xn + h)(x-xn + 2h) + ···
214 Numerical Methods-11;
-
+a,(x-xn+r-1 -h)<n>•
hf>+· .. +an(x-xn+n-1 ·- -(2)
We shall find a0, a,, ... , an such that Pn (x;) = Y;•
Since V =E- 1 ~.
V' (x - a)(m) = E - '~, (x - aim>
. r( )(m - r)]
=r' [ m (m- l)(m-2) •·· (m-r+ I) h x-a
r h )(m -r) •
= m (m- l)(m-2)···(m- r+ 1) h (x- r -a if rs; 111 _
.. .(3)
x - xn is a factor in all terms of RHS of (2) except in a0 .
Putting x=xn in (2),
Pn (xn) = Yn = Go
operating (2) by V', using (3),
V' Pn (x) = 0 + O+ •·· + O+ a, r ! h' + (r + l).r.(r- 1) ··· 2h' a,+ )'(x- xn/ 1>
+ terms involving (x - xn) as a factor.
Setting x = xn in this,
V' Pn (xn) = V' Yn = a, r ! h'. since other terms vanish.
1
1 = --V'y ... (4)
r r .I h' n
where r= 1, 2, ... , n.
Putting the values of a0, a,, ... an in (2), we get
(x-x P) (x-x +h)'2>
Pn(x)=yn+ n Vy+ n V2y +····
I! h n 2! h2 n
(x - xn + r- 1 h)'') (x - x + n - 1 h)(n)
+ - - - -r- - V ' Yn + ... + ll
n , vn .Yn ... (5)
r. h
I n!h
x-x
Let h n = v ; hence x = xn + vh
_ _ ..!. v(v+l) 2
. . P0 (x}- Pn (xn + v~)-Yn; 1! Vy,n+ ! V Yn
2
•
1
Aliter. We. can also derive the above formula by symbolic Qperator
me'thods. ' · ,·
• I ' I '
Pn(x)=Pn(xn+vh)=Ev Pn(xn)
v.r
' ' ' I
1
= (1- VfvYn since E = (1 -
' '
n v (v+ 1) n2 v (v+ l)(v+2) n3
= [ 1 + V V + - 21 ,• - V• '+ V + ·•' ] yn
'
I
. ,131. . "
•
. _ q- . _ V (v ·+ 1) 2 l"
Pn(x)-~)-Yn+vVyn+ . 2! · ,. '
,, • . + v (v 3!' + 1) VJYn.+ ... ' .. .(7)
, + l)(v
x-x0
where V;::
. h '•
Note 1. Since the formula involves the backward difference operator, it is
named as backward interpolation formula. '
2. )ltis i,s used to interpolate the values of y nearer to the end of a set
tabular values. This may-also be'·used to extrapolate closer 'to the
rightofyn. · ,- - - - ·- - - --
6·4. Error in polynomial interpolation -·- -
If y = f (x) is the exact curve and y = Pn (x) 1s the interpolating
polynomial curve, the error in polynomial · interpolation is
(x -.x:o)(x-x 1) ··: (x - xn)j<n+ l)(c)
Error =f (~)-Pn (x) = · · (n + l)! ·.
10. Find the pressure of steam at 142°C using Newton's general formula
Temp °C: 140 1'50 , 160, 1• ,, 170 180
Pressure kgf/cm2 : 3·685 1 4-854 6-302 8-076 · 10-225
(B.Sc. BR. Nov. 94)
\ \ f '
11. Obtain the ".a,lue of log 10 656 giv~n. log 10 654 = 2-8156, log10 658 = 2-8182,
1
I r 1'
1og10 659 = 2·8189 and log 10 666 = 2-~202.
12. Ftnd y (x = 5-60275) from the table.
X: 5•600 ' I 5•602 - 5•605 1 · 5-607 '
1 5-608
y :- ·0 ~77556588 0-77682686 1 0-77871.250 0-77996571 0-78059114
13. Grven the data, find f (x) as a polynomial of degree ·2. · , ,
x: 1 2 . , 4 1 ,
1
,
f(x): 3 · I' !· I
-5•· . 4
14. Find a pol.,nomial f (x) of lowest degree which takes the values 3, 7, 9_and
19 when x = 2, 4, 5, 10.
15. Find log 10 323-5 given _. I
321·0
X: , 322·8~ 32412 1 ' , 11
. I325•0
log10 x: 2-50651 2·50893 2-51081 2•51188
16. From the following table find f (5).
x: 0 I 3 ,'J, ' 6.
f(x): I 4 88 · 1309
17. Using divided difference table, ·fipd f (x)" w,hich ~a1<-fs the values 1, 4, 40, 85
as x = 0, 1, 3, 4.
18. Find
4
! f(x) if f (x) =x (x + l)(x + 2)(x +.3).
19. Find the function y (x) 'in powers of (x·- f) given
y(0)=8,y(l)=ll,y(4)=68:y(5)=123. , ,, . JL
·························································
Yn
a=
n. (xn - Xo) (xn - X1) ... (xn - xn - 1)
Substituting these values of a's in 0), we have
(x-x 1) (x-x2) ••· (x-xn)
Y =f (x) =(xo - X1) (Xo - xz) ... (xo - x,J . Yo
(x - x0) (x - x2) ... (x - xn)
+ (x1 - xo) (x1 - xz) ... (x1 - xn) . Y1
+ ............................... .
(x - x0) (x - x 1) ... (x - X; _ )
1 (x - x- ·1) ... (x -x)
+ i+ , n . Yi
(x;-x0) (x;-x 1) ··· (x;-X;_ 1)(x;-X;+i) •·· (x;-xn)
+ .............................. .
(i-x0) (x-x 1) ··: (x-x )
+( , )( ) ( n- 1 Y ... (2)
Xn -Xo Xn -X1 ... Xn-Xn- 1} n
/W 1
(x-x 0) (x-x I )
'
··· (x-x,J = (x0 -x1) (x0 -x2) ··· (x0 -xn) · x-x0
'
Y1 1
+ ' ·- -
(X1 - x0) (x 1 - x2) ... (x 1 - xn) x - x 1
+ ....................................... .
1
\
8-8. Different form of Lagrange's interpolation formula ·.
The Lagrangian interpolation form~la can also be written as
. d
TinCx) =(x - x0) (x - x 1) ·•• (x - x,J and TI'n (x) = dx [~ (x )]
, .
Solution. Tin (x) = (x - x0) (x - x 1) ··· (x - xn)
Differentiating this and substituting x = xi, we get
TI'n (x;) =(xi - x0) (xi - x 1) ·•· (xi - xi- 1) (xi - xi+ 1) ··· (x - xn)
Substituting this in equation (2),
nn (x) ·
Yo
f(x) = X-Xo . TI'n (xo)
=u(-25x +453·5x-2052·3)
To get the mode, f' (x) = 0 and f" (x}= ve
1 .
· f'(x)=0 (-50x+453·5) .=0
12 I r
i.e., = 9·07X
1
f" (9·07) = (-50) =- ve
12
Hence f(x) is _maxim~lm at x = 9·07
Therefore, mode is 9·07.
E x ~ -~ Using Lagrange's for~ula of interpolation find
y (9·5) given
X 7 :c,\ 8 9 - -- _10
y: 3 I ' I 9
Solution. By Lagr~nge's formula,
(x - 8) (x - 9} (x - 10) · (x - 7) (x - 9) (x - 10)
3
y = f (x) = (7 - 8) (7 - 9) (7-; 10) X + (8- 7) (8- 9) (8 - 10) X l
(x - 7) (x .;._ 8) (x - 10) I (x - 7) (x - 8) •ex - 9)
9
+ (9- 7) (9 - 8) (9 - 10) X l + (10- 7) (10- 8) (10- 9) X
· (l ·5) co-5)·(- o-5)' (2·5) (0·5) (:- 015) _
f (9·5) = · (- '1) (- 2) (- 3) X 3 + (1) (~ ·1) (- 2)
(2·5) (1 ·5) (- 0·5) (2·5) (l ·5) (0·5)
+ . (2) (1) (- 1) ' + (3) (2) (1) x 9
1
= 3·625.
~mple 18. Use Lagrange's formula to fit apolynomial to the data
. · X : -'J . 0 2 . , 3 . '
. y : - 8 3 1 . 12
and hence find '! (x = 1).
Solu~on. By Lagrange's formula,
(x-0) (x - 2) (x- 3) (x + 1) (x- 2) (x- 3)
y = f(x) = _(...: 1-0) (-1 - 2) (-1 - .3) X (-S) + (0 + 1) (0- 2) (0- 3) X 3
276 Numerical Meth
oas,,
(x + 1) (x - 0) (x - 3) (x + 1) (x - 0) (x _ ')) 1
+ - - - - - - x 1+ ~ <-J
(2 + 1) (2 - 0)(2 - 3) (3 + 1) (3 - 0) (3
= 2x3 - 6x2 + 3x + 3, on simplification. l
. .
This formula (1) is called formul~ of inverse interpolation.
I
Example 19. From the data given below, find the value of x when
y = 13·5 (B.Sc. BR. Nov. 94)
X : 93·0 96·2 100·0 104·2 J08,7
y : JJ,38 12·80 14-70 17·07 19-9]
Solution. By Lagrange's formula for inverse interpolation
_ (y- 12·80)(y - 14·70) (y - 17·U/) (y- 19·91)
-1. -
X (93-0)
(y-11·38) (y-14·70) (y-17·07) (y..:.19·91)
+
(12·80-11·38) (12·80-14-70) (12·80-17-07) (12-80-19·91)
X (96·2)
(y- 11 ·38) (y- 12·80) (y-
+-:-:-:--=::-----:-:::-:-::-:-:-:-~----.:..._17·07) (y-
_....:_::_19·91)
_....:....__ _
(14-70- 11·38) (14·70- 12·80) (14·70- 17-07) (14-70- 19·91)
X (100·0)
(y-11·38) (y-12·80) (y-14·70) (y-19-91)
+ .
(17-07 -11·38) (17-07-12-80) (17-07-14·70) (17·07 -19-91)
X ( 104•2)
38
(y- l 1· ) (y-12·80) (y- 14·70) (y- 17-07)
+ (19·91 11 ·38) 0 9·91 -12-80) (19·91 -14'. 70) (19·91 -17•07)
X (108•7)
rnterpolation With Unequal Intervals 277
'
0: 21° -"f 23° V)- 25° -{
/(0): 0·3706 0-4068 0-4433
Solution. Now take f (0) as independent and 0 as dependent
y =f(0) : , 0-.3706 0-4068 0-4433
0: 21 25
(y- 0-4068) (y- 0·4433)
tr S = (0·3706- 0·4068) (0·3706-0·4433) X (ll)
0· 3706) (y - 0·4433)
(y
23
+ (0·4068-0-3706) (0·4068-0-4433) X ( )
(y- 0·3706) (y-0·4068)
25
+ (0-4433 -0-3706) (0·4433 -:- 0-4068) X
l ,
(0·3887 -0·4068) (0·3887 -0·4433)
0 3887 2
e (y = ' ) = (0·3706- 0-4068)_(0·3706- 0·443J) X ( l)
(0·3887 -0·3706) (0.'388"7-·0·4433)
23
+ (0·4068-0·3706) (0·4068- 0·4433) X ( ) -"-
(0·3887, - 0·3706) (0·~887 - 0-4068)_ X '\ \)
2
(0_.4433 - 0-3706) (0·4433 - 0·4068)~
= 7·885832+ 17-202739- 3-0~6525 = 22·0020°
Example 21. Find the age r.orrespc>ndin.g to the annuity value
13·6 given the table
Age (x) 30 35 40 45 50
Annuity value (y) 15·9 14·9 14-1 13.3 12·5
. (B.Sc. BR. Nov. 94)
Solution.
t (13-6- 14·9) (13·6 - 14· 1) (13·6- 13-3) (13-6- 12·5)
x = - - - - - - - - - - - - - - - x 30
(15-9 - 14·9) (15·9-14· l) (15-9 - 13·3) (15·9 - 12-5)
(13·6 - -15·9) (13-6 - 14·1) (13·6 - 13·3) (13·6 - 12·5)
+ · x35
(14·9 - 15·9) (14·9 - 14· 1) (14·9 - 13·3) (14·9 - 12·5)
(13·6 -15·9) (13·6- 14·9) (13·6-13·3) (13·6- 12·5)
+---__:__-----------x40
(14· 1 - 15·9) (14· 1 - 14·9) (14· 1 - 13·3) (14· 1 - 12·5)
278 Numerical Meth
Oq8
.,6 14·9) (13-6-14· 1) {13-6- 12~
+ (13-6 15·9) (13
3.3 -15·9) (13-3 14·9) (13-3 ' 14·.1) (13-3-' 12.5/< 45
(1
(13-6 15·9) (136· - 14·9)(13-6-14·1){13-6-'13-3) -xso
+ (12·5-15·9) (12·5 14·9) (12·5 14·1) (12-5-13-3)
:. X (y 13·6) = 43.
EXERCISE 8.2
y .. 5 6 50 ' 4
2. Given u1 =22, u2 == 30, u4 = 82, U7 =106, ug_== 206 , fio d ~- 105
3. Find f (27) given . .
X . 14 17
31 35
f (x) ~8-7 . 64-0
44•0 39,J
4. Using Lagrange's formula, find /(6, given
X i 5 ·1 7
IO
f(x) 18 180 448 12
1210 2028
5. If Yi= 4, Y3 = 120, y4 =340, Y6 = 2544., find ,Ys·
6. Find y (6) giveO y (I)= 4, y (2) = 5, y (7) = 5, y (8) = 4. Also find x for whicl
y (x) is maximum or ·minimum. · ' ·
7. Find y (10) given y (5) = 12, y (6) = 13, y (9) = 14 and y (11) = 16.
8. Interpolate y at x == 5 given
X 1
y
2
J 3
4 4 7
8
9. If Yo= l,y3 = 19,y4 =49 and Y6 = 181 find Ys- , 16 128
. .
10. The following table gives the values of the probability integr,J
2 Jx 2 ·
X 0·46 0·47
f (x) 0-4846555 0·4Q37452 0-48
11. Find f(O) given 0-49
0-5027498
0-5116683
x -I -2 2 4
f (x) - l - 9 11 69
12. The following are the measurements I made on a curve recorded by the
oscillograph
conditions of representing a change of current ; due to a change in the
an electric current.
t 1-2 2·0
i 1-36 . 0-58 2·5
Using Lagrange's formula, find i at t == 1·6. . Q.34 3·0
0-20
(MS. J96iJ