You are on page 1of 69

Interpolation

.in

s
sp

s@

The word interpolation denotes the method


of computing the value of the function
y = f(x)
f( ) for an
any gi
given
en value
al e of x when
hen
(x0, y0), (x1, y1),(xn, yn) are given.
Note:
Since in most of the cases the exact form of
the function is not known. In such cases the
function f(x)
( ) is replaced
p
by
y a simpler
p
function or polynomials (x) which has
the same values as f(x) have for
x0, x1, x2.,xn.
a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

er

v
ni

m
Co

c
.a

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

Interpolation with unequal intervals


If x0, x1,,,x
, n are unequally
q y spaced
p
then
we use the following two interpolation
formulae :
1. Lagranges Interpolation formula
2 N
2.
Newtons
t Divided
Di id d diff
difference fformula.
l
One advantage of these formulas is that
they can also be used in case of equal
q intervals
intervals but the formulae for equal
cannot be used in case of unequal intervals.
n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

sh

a
;y

i) Lagranges formula for unequal


intervals:
If y = f(x)
f( ) takes
t k the
th values
l
y0, y1, y2,.,yn corresponding to
x = x0, x1, x2,,xn then
ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

(x x1 ) (x x 2 )...(x x n )
f ( x) =
f (x 0 )
(x 0 x1 ) (x 0 x 2 )...( x 0 x n )
ha

a
vy
.
n

sp

ac
u.

.in

s@

d
er

o
sh

(x x 0 ) (x x 2 ) (x x 3 ))...((x x n )
f ( x1 )
+
(x1 x 0 ) (x1 x 2 ) (x1 x 3 )...( x1 x n )
n
ha

ia

Un

si
er

da
U
,

;
ur

ya

ip

ty

iv

(x x 0 ) (x x1 ) (x x3 )...(x x n )
+
f (x 2 )
(x 2 x 0 ) (x 2 x1 ) (x 2 x3 )...(x
) (x 2 x n )
i
tS

ad

;
AS

+....

RD
E
OV
H
S

AN

am

ng

pa

P
ir

VY

(x x 0 ) (x x1 ) (x x 2 )...(x x n 1 )
+
f (x n )
(x n x 0 ) (x n x1 ) (x n x 2 )...(
) (x n x n 1 )
A

m
Co

d
ile

&

d
re
a
ep
Pr

:Y
by

.in

c
.a

s
sp

is known as the Lagrange's interpolation


formula.
s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

Ex.1. Find u5 by Lagranges Method if


u0 =1,
1 u3 = 19,
19 u4 = 49,
49 u6 = 181.
181
Solution:
a

i
an

Ud

er

v
ni

,
ity

gh

pa

n
Si

a
ad

rP

i
;S

x N VY0AS
HA
D
ER
u
1
V
HO

3
19

A
:Y

by

At x = 5, u is given by
ed

ar

p
re

Co

le
pi

&

4
49

6
181

(5 3) (5-4)(5-6)
u=
( 1)
(0-3)(0-4)(0-6)
(5-0)(5-4)(5-6)
(5 0)(5 4)(5 6)
+
(19)
((3 0)(3
)( 4)(3
)( 6))
(5-0)(5-3)(5-6)
+
( 49)
(4 0)(4 3)(4 6)
(5-0)(5-3)(5-4)
+
(181)
(6 0)(6 3)(6 4)
= 101
r

e
ov

sh

ur

er

ng

n
ha

i
tS

am

;
AS

AN
H
D

m
Co

d
le
i
p

&

d
re
a
ep
Pr

:
by

VE
O
SH
A
Y

VY

P
ir

ad

pa

ia

iv
Un

,
ity

Ud

p
ai

a
;y

s
sp

s@

a
vy

n.

a
dh

.in

c
.a

.in

Example-2

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

Prove that Lagranges formula for


polynomial approximation Pn (x) of (n+1)
points
(xi, yi = f(xi )) i = 0, 1, 2, , n can be
expressed in the form:
sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

Pn ( x )
f ( x0 )
f ( x1 )
L
f ( xn )

1
1
1
L
1
H

S
YA

A
VY

x
2
x0
2
x1
L
2
xn
t

pa

rP

a
ad

n
Si

L
L
L
L
L

i
an

,
ity

er

v
ni

gh

i
;S

A
DH

E
OV

x
x0
x1
L
xn

L
L
L
L
L
ur

Ud

p
ai

x
n
x0
n
x1 = 0
L
n
xn
n.

a
dh

e
ov

sh

a
;y

s@

a
vy

And also verify this result for n = 2.


A partial solution of Ex-2
Ex 2 is as follows :
:

ed

r
pa

m
Co

d
ile

&

Pr

by

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

Ex.3.
Ex
3 If y(1) = -3,
3 y(3) = 99, y(4) =30
=30,
y(6) = 132 then find the Lagranges
i
interpolating
l i polynomial
l
i l that
h takes
k the
h
same values as y at the ggiven ppoints.
Given:
s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

Ud

er

v
ni

,
ity

gh

pa

n
Si

a
ad

x
y
R

1 ; Sir P
AS
Y
V
N -3
A
DH

Solution:
:

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

E
OV

3
9

4
30

6
132

((x 3)) ((x 4)) ((x 6))


f (x)
. (3)
( )=
(1 3)(1 4)(1 6)
(x
( 1)(x
1)( 4)(x
4)( 6)
+
.9
(3 1)(3 4)(3 6)
(x 1)(x 3)(x 6)
+
.30
(4 1)(4 3)(4 6)
(x 1)(x 3)(x 4)
+
.132
(6 1)(6 3)(6 4)
3
2
= x - 3x + 5x - 6

.in

o
sh

ng

n
ha

i
tS

pa

ad

AN

m
Co

d
le
i
p

&

d
re
a
ep
Pr

:
by

OV
H
S
YA

DH
R
E

VY

;
AS

P
ir

am

ia

iv
Un

er

ty
si

a
Ud

ip

;
ur

ya

ya

v
n.

ha

d
er

ac
u.

sp
s@

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

sh

Try this

a
;y

ur

p
ai

,
ity

Ud

Q.1
Using Lagranges interpolation
formula find a polynomial which passes
through
g the points
p
((0,, -12),
), (1,
( , 0)) ((3,, 6).
)
(4, 12)
3
2
Answer: x - 7x +18x - 12
s

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

as
To calculate the error from (7), the function y(x) and its (n+1)
th
;y
r

u
ip x is used in
derivative must be known. The point of interpolation
a
d
,U
y
place of x to determine the error at x.
t
si
er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

21 daipu
,U

er

ty
si

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

Ud

er

v
ni

,
ity

gh

pa

n
Si

a
ad

rP

i
;S

A
VY

A
DH

E
OV

ed

r
pa

Co

le
pi

&

Pr

by

S
YA

.in

c
.a

s
sp

as@5
y
v

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

si

r
ve

ia

ng

n
ha

i
tS

pa

am

ad

;
AS

AN

D
ER

O
SH

d
re

pa

m
Co

d
ile

&

e
Pr

Y
y:

VY

P
ir

Un

U
y,

.in

s
sp

a
vy

ii) Divided
i i
differences
iff
(d)
y1 y0
d f (x
= [x
( 0 ) = d y0 =
[ 0 , x1 ]
x1 x 0
y2 y1
d y1 =
= [x 2 , x1 ]
x 2 x1
yn yn 1
d yn 1 =
= [x n 1 , x n ]
x n x n 1
n.

a
;y

p
ai

er

v
ni

gh

pa

rP

E
OV

d
re
a
ep

m
Co

le
pi

&

Pr

by

SH
A
Y

A
DH

A
VY

i
;S

a
ad

n
Si

i
an

,
ity

Ud

ur

sh

e
ov

a
dh

s@

c
.a

.in

ac
u.

sp

S
Second
d Di
Divided
id d Diff
Difference
d y1 d y0
2
2
d f (x 0 ) = d y0 =
x2 x0

s@

a
vy

n.

a
dh

e
ov

sh

a
;y

pu
ai

ia

ng

i
tS

Ud

er

iv
Un

,
ity

n
ha

[ x 2 , x 1 ] [ x1 , x 0 ]
= [ x 0 , x1 , x 2 ]
=
x2 x0
pa

ad

;
AS

AN
H
RD

A
:Y

ed

r
pa
e
r

m
Co

le
pi

&

by

V
HO

VY

P
ir

am

.in

c
.a

s
sp

d y2 d y1
|| d y1 =
x3 x1
ly

n.

e
ov

sh

a
;y

pu
ai

,
ity

Ud

[x3 , x 2 ] [x 2 , x1 ]
=
x3 x1
s

er

gh

rP

a
ad

pa

i
an

v
ni

n
Si

= [x1 , x 2 , x3 ]
S

A
DH

A
VY

i
;S

similarly
i il l d y0 ,.... can be
b ddefined
fi d
R

AS
Y
:

d
re

m
Co

d
ile

&

a
ep
r
P

by

VE
O
H

a
vy

a
dh

s@

.in

Divided Difference Table


x y d y

y 2 y1
=
dy 1 x 2 x 1

s@

d3 y

a
vy

n.

a
dh

e
ov

d4 y

a
;y

ur

p
ai

d2y0=

pa

y3 y2 N
=
dy2 x3 xR2DHA
E
V

x3 y3

O
SH

y4 y3
=
a y

ep d 3 x 4 x 3
r
P
d
re

&

Y
y:

d y1 d y 0 U
ia
n
a
x 2 xg0h
am

ad y
P
r
2 S=i d 2
dAS; 1 x 3
VY

d2y=2

d y1
x1

dy3 dy2
x4 x2

,
ity

Ud

er

v
ni

i
tS

x2 y2

Co

d2 y

y1 y 0
=
dy 0 x 1 x 0

x1 y1

x4 myp 4

s
sp

sh

x0 y0

d
ile

c
.a

2
2

y0
d
1
d
3
=
d y0 x x
3
0

d2 y 2 d2 y 1
d3y=1 x x
4
1

d4 y 0

.in

sp
s@

vy
n.

In general

d
er

ha

o
sh

m1
d
k+1

;
ur

ya

m1
d
k

y y
m
d yk =
xk+m xk
a

ip

er

v
ni

i
an

ty
si

a
Ud

gh

in
tS

pa

am

ad

P
ir
S
;
AS

AN

VY

Provided all the involved


quantities exist.
H

m
Co

d
ile

&

d
re
a
ep
Pr

:Y
by

OV
H
S

D
ER

ac
u.

.in

c
.a

s
sp

s@

a
vy

n.

Newton's
divided
difference
interpolation formula
y = f(x) = y0 + (x x0 ) d y0
a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

gh

Ud

er

v
ni

,
ity

+(x x0 ) (x x1) d y0
t
pa

n
Si

a
ad

rP

i
;S

+ (x x0 ) (x x1)(x x2 ) y
S

A
DH

A
VY

3
d 0

E
OV

+... + (x x0 ) (x x1) ...(x xn1) d y0


H

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

Ex.1

e
ov

sh

Given the values

x:
f( ) :
f(x)

5
150

a
;y

ur

p
ai

,
ity

7
392

Ud

rs
11
13
ve
i
Un
a
ni
a
1452
2366
h
ng
t
pa

Si

17
5202

a
ad

Evaluate f(9) using


(i) Lagrange's formula
(ii) Newton's
N
' divided
di id d difference
diff
formula.
f
l
rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

.in

s
sp

i) Lagranges formula
f (9)

a
vy

c
.a

s@

n.

a
;y

sh

e
ov

a
dh

(9 7) (9 11) (9 13) (9 17)


=
(150)
(5 7) (5 11) (5 13) (5 17)
(9 5) (9 11) (9 13) (9 17)
+
(392)
(7 5) (7 11) (7 13) (7 17)
(9 5) (9 7) (9 13) (9 17)
(1452)
+
(11 5) (11 7) (11 13) (11 17)
p
ai

er

v
ni

gh

pa

rP

E
OV

d
re
a
ep

m
Co

le
pi

&

Pr

by

SH
A
Y

A
DH

A
VY

i
;S

a
ad

n
Si

i
an

,
ity

Ud

ur

.in

ac
u.

sp

s@

a
vy

n.

a
dh

e
ov

sh

(9 5) (9 7) (9 11) (9 17)
+
(2366)
((13 5)) (13
( 7)(13
)( 11)(13
)( 17))
(9 5) (9 7) (9 11) (9 13)
+
((5202))
(17 5)(17 7) (17 11)(17 13)
f (9) = 810
r

a
;y

pu
ai

er

ia

ng

i
tS

pa

ad

;
AS

AN
H
RD

A
:Y

ed

r
pa
e
r

m
Co

le
pi

&

by

V
HO

VY

P
ir

am

n
ha

iv
Un

,
ity

Ud

.in

ii)) Newton Divided Difference formula

s@

s
sp

x
5

y
150

d2

,U

1452
V

D
ER

S
YA

r
Si

Pa

13 : YA 2366
ed

by

le
pi

om

&

17

5202

24

1
32

0
1

42
709

ar

p
re

g
in

457

O
SH

i
an

265
m
da

ty
si

er

v
ni

t
pa

N
HA

as

y
r;

pu

392

11

d3 hodve4r
i
da

121
7

a
dh

n.

a
vy

c
.a

.in

c
.a

s
sp

s@

a
vy

f(9) = 150
1 0 + 121 (9 - 5))
+ 24 ((9 - 5)) (9
( - 7))
+ 1(9 - 5) (9 - 7) (9 - 11) = 810
Ex 2 Using i) Lagranges
Ex.2.
Lagrange s interpolation
and ii) divided difference formula. Find
the
h value
l off y when
h x = 10.
10
n.

a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

Ud

er

v
ni

,
ity

gh

pa

n
Si

a
ad

rP

i
;S

A
DH

x : OVER 5
SH
A
:Y:
y
12
by
d

re

a
ep

Co

le
pi

&

Pr

A
VY

6
13

9
14

11
16

Lagranges formula:
(10 6) (10 9) (10 11)
y = f (10) =
12
(5 6) (5 9) (5 11)
(10 5)(10 9)(10 11)
+
13
(6 5)(6 9)(6 11)
(10 5)(10 6)(10 11)
+
14
((9 5)(9
)( 6)(9
)( 11))
(10 5)(10 6)(10 9)
+
16
(11 5)(11 6)(11 9)

ya

v
n.

ha

d
er

o
sh

ng

n
ha

i
tS

pa

ad

AN

m
Co

d
le
i
p

&

d
re
a
ep
Pr

:
by

OV
H
S
YA

DH
R
E

VY

;
AS

P
ir

am

ia

iv
Un

er

ty
si

a
Ud

ip

;
ur

ya

sp
s@

.in

ac
u.

.in

s
sp

Divided difference

s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

gh

pa

a
ad

rP

i
;S

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

er

v
ni

A
DH

c
.a

Ud

.in

s
sp

f (10)

a
vy

n.

a
;y

sh

e
ov

a
dh

1
= 12 + (10 5) + (10 5)(10 6).
6
1
+ (10 5)(10 6)(10 9)
20
44
=
3
p
ai

d
,U

ity

ia

ng

n
ha

i
tS

pa

am

;
AS

AN

D
ER

d
re
a
ep

m
Co

le
pi

&

Pr

by

HO
S
YA

VY

P
ir

ad

Un

iv

s
er

ur

s@

c
.a

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

sh

Ex.3.
Ex
3 Find the interpolating polynomial
using Newton divided difference
formula for the following data:
x
0
1
2
5
y
2
3
12
147
a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

n.

a
vy

x
0

y
2

d2
,U

i
an

gh

t
pa

n
Si

a
ad

rP

12 AN

i
;S

A
VY

Y
y:

5 ed b
ar

p
re

Co

le
pi

&

O
SH

147

1
9

D
ER

45

ty
si

er

v
ni

3h
as

y
r; d

pu

i
da

1
1

e
ov

a
dh

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

er

,
ity

Ud

f(x)=2+(x-0)(1)
f(x)
2 (x 0)(1) +(x-0)(x-1)(4)
(x 0) (x 1) (4)
+ (x - 0) (x - 1) (x - 2) 1
3
2
= x +x -x + 2
v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

Ex.4. Find f(4) given f(0) = -4, f(2) =


2, f(3) =14 and f(6) = 158
The divided difference table is
u

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

x
0

,
ity

y
-4

ndiv2ers
a

i
an

2
A
DH

3
ed

:
by

S
YA

m
Co

d
ile

&

158

n
Si

3
12

1
9

48

r
pa

A
VY

14

Pr

i
;S

am
3
d
Pa

E
OV

d3

gh

pa

Ud

.in

c
.a

.in

c
.a

s
sp

s@

a
vy

n.

f(4)= -4 + (4 ) (3)+ (4) (2) (3)


+(4) (2) (1) (1) = 40
a
dh

e
ov

sh

a
;y

ur

p
ai

,
ity

Ud

er

Ex.5. Fit an interpolating polynomial for


u4 = 48, u5 = 100, u6 = 180 ,
v
ni

i
an

gh

pa

n
Si

a
ad

rP

i
;S

u8 = 448, u10 =900 and u11 = 1210


S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

x
4

y
48

d2

d3

d4
a
dh

e
ov

sh

a
;y

100

14
v
ni

134
P
ir

;
AS

448
H

AN

D
ER

V
HO

ed

by

ar

Co

le
pi

1210

Si

18

0
1

23

226

0
1

28
310

11

VY

900

p
re

&

10

t
pa

a
ad

A
:Y

Ud

h
ng

180

a
ni

,
ity

er

80
6

ur

p
ai

s
sp

s@

a
vy

n.

52

.in

c
.a

.in

c
.a

s
sp

s@

By applying Newtons Divided


diff
difference
fformulae,
l we gett

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

Ud

er

v
ni

,
ity

y = 48 + ((x -4)
4) 52 + (x-4)
( 4) (x-5)
( 5) 14
3
2
+ (x
(x-4)
4) (x-5)
(x 5) (x -6)
6) = x - x
a

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

.in

c
.a

s
sp

s@

a
vy

Example
E
l 6.
6 Given
Gi
th
the ffollowing
ll i ttable,
bl
find f(x) as a polynomial in powers of
( 5)
(x
n.

a
dh

e
ov

sh

a
;y

ur

p
ai

x:
0 2
f(x): 4 26

3
58

i
an

a
ad

rP

4
112
gh

pa

n
Si

Ud

er

v
ni

,
ity

7
466

9
922.

i
;S

A
VY

Sol. The divided difference table is:


R

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

.in

c
.a

s
sp

s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

By Newtons divided difference formula


formula,
g
we get
f(x) = 4 + (x 0)(11) + (x 0)(x 2)7 +
( 0)(x
(x
0)( 2)(x
2)( 3) 1
3
2
= x + 2x + 3x + 4
In order to express it in power of (x 5),
we use synthetic division, as:
n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

Ud

er

v
ni

,
ity

gh

pa

n
Si

a
ad

rP

i
;S

A
VY

A
DH

E
OV

S
YA

2x + x + 3x + 4
2

ed

&

r
pa

Pr

:
by

= (x 5) + 17(x 5) + 98 (x 5) + 194.
m
Co

d
ile

.in

c
.a

s
sp

Example 7. Calculate the approximate


s@

a
vy

n.

a
dh

e
ov

value of mode of a certain frequency


sh

a
;y

ur

p
ai

Ud

Curve y = f (x). The values of frequency


s

er

v
ni

i
an

,
ity

density f(x) for x = 8.9, 9.0 and 9.3 are


gh

pa

a
ad

n
Si

respectively equal to 0.30,


0 30 0
0.35
35 and 0.25.
0 25
rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

The divided difference table for given


f
frequency
density
d
i is
i as ffollows:
ll
r

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

s
sp

s@

a
vy

n.

a
dh

.in

c
.a

in
c.
a
.

s
sp

Applying Newton
Newtons
s divided difference formula
100 f(x)
50
3500
= 30 + (x 8.9) + (x 8.9) (x 9)

9
36
2
= 97. 222x + 1745.833x 1759.7217
f(x) = 0.9722x2
0 9722x2 + 17.45833x
17 45833x 17.597217
17 597217
f ' (x) = 1.9444x + 17.45833
Putting f ' (x) = 0,
0 we get
s@

h
rd
e
v

r
pu

er

ty
si

v
ni

gh

a
ad

P
ir
S
;

VE
O
H

m
Co

d
ile

&

d
re
a
ep
Pr

YA
:
by

A
DH

A
VY

pa

n
Si

i
an

a
Ud

o
sh
a
y

an

ya
.v

.in

s
sp

17.45833
x=
= 8.9788
1.9444

s@

sh

ur

,
ity

Ud

Also, f '' (x) = 1.9444 i.e., () ve


s
er

v
ni

pa

i
an

( ) is maximum at x = 8.9788
f(x)
a
ad

rP

i
;S

A
DH

A
VY

Hence mode is 8
Hence,
8.9788.
9788
R

VE
O
SH
A
:Y

d
re
a
p

m
Co

d
le
i
p

&

e
Pr

by

a
dh

e
ov

p
ai

gh

a
vy

n.

a
;y

n
Si

c
.a

.in

c
.a

Example 7. Apply the Newton divided


difference formula for inverse interpolation
to find the real root of f ( x ) = 0 , where
u

s
sp

s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

Ud

f ( x ) = x 2 x 5 by considering the
3

er

v
ni

i
an

,
ity

values of f ( x ) at x = 1.9, 2, 2.1, 2.2.


( ) at
Solution: The values of f(x)
x = 1.9,
2,
2.1, 2.2 are
1.941,
1 941 1.000,
1 000 0
0.061,
061 1
1.248,
248 respectively.
respectively
gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

.in

c
.a

s
sp

To find the root,


root we change some notations
as follows:
s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

x:
ux :

1.941
1.9

1.000
2.0
ng

i
tS

ia

n
ha

Ud

0.061
2.1

er

v
ni

,
ity

pa

am

ad

;
AS

P
ir

So we have to find u x at x = 0.
AN

VY

D
ER

O
SH

Y
y:

The divided difference table is:


d
re

pa

m
Co

d
ile

&

e
Pr

1.248
2.2

.in

dux

ux

c
.a

3 @spsu
d.vyasux

d u x
2

an

h
rd

-1.941 1.9

v
ho

as

y
r;

pu

i
da

0.1062699

,U

er

v
ni

-1.000
1 000 2.0
20

gh

0.0942507
;
AS

0.061 2.1

AN

P
ir

VY

DH

E
OV

0.0842459
H

ed

r
pa

S
YA

1.248 2.2
e

m
Co

d
ile

&

Pr

pa

n
Si

a
ad

-0.0060035
0 0060035
a

i
an

by

ty
si

-0.0044505

0.0004869

.in

c
.a

s
sp

Applying the Newton-divided


Newton divided difference
formula,
ux = 1
1.9
9 + (x + 1
1.941)
941) 0
0.1062699
1062699
+ (x + 1.941)(x + 1)( 0.0060035)
+ (x + 1.941)(x + 1)(x 0.061) 0.0004869.
For x = 0
u 0 = 1.9 + 0.2062698 0.0116527
0.0000576
0 0000576 = 2.0945595
2 0945595
The required root is 2.0945595.
s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

Try this.

c
.a

s
sp

s@

Question.

a
vy

n.

Apply the

Newton divided
a
dh

e
ov

sh

a
;y

difference formula for inverse interpolation


ur

p
ai

,
ity

Ud

to find the real root of f ( x) = 0 , where


s

er

v
ni

i
an

gh

n
Si

f ( x) = x + x 3 by considering the values


t

pa

a
ad

rP

i
;S

A
VY

of f ( x ) at x = 1.1, 1.2, 1.3, 1.4.


N

A
DH

E
OV

S
YA

Ans. 1.2134 approx.


:

ed

r
pa

m
Co

d
ile

&

Pr

by

.in

c
.a

s
sp

Example 8
8. The following are the mean
temperatures (F) on three days, 30 days
apart round the periods of summer and
winter. Estimate the approx. dates and
values of max
max. and min
min. temperature
temperature.
s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

p
ai

i
an

Ud

er

v
ni

,
ity

gh

pa

Summer adam

n
Si

Winter

rP

Day

Date

Temp.

Date

Temp.

R
15-Jun.
VE

58.8

16-Dec.

40.7

by

:Y
15-July

63.4

15-Jan.

38.1

14-Aug
14-Aug.

62 5
62.5

14-Feb
14-Feb.

39 3
39.3

A
DH

H
AS

30

ed

60

le
pi

Co

r
pa

&

Pr

i
;S

A
VY

.in

c
.a

s
sp

Solution: The divided difference table for


summer is:
s@

a
vy

n.

a
dh

e
ov

sh

a
;y

ur

df(x)

f(x)

i
an

58.8

pa

;
AS

AN

m
Co

O
SH

2
&

P
ir

4.6

-2.7

VY

D
ER

e
Pr

pa

d
re

Y
y:

62.5

2
d f(x)

n
Si

63.4
V

d
ile

Ud

gh

a
ad

er

v
ni

,
ity

p
ai

-0.9
09

.in

c
.a

s
sp

f(x) = 58.8
58 8 + (x 0)(4.6)
0)(4 6) + (x 0)(x 1)(
1)( 2.75)
2 75)
2
= 2.75 x + 7.35 x + 58.8
F maximum
For
i
and
d minimum
i i
off f(x),
f( ) we h
have
f ' (x) = 0
5.5
5 5 x + 77.35
35 = 0 x = 11.342
342
Again, f (x) = 5.5 < 0
f(x) is maximum at x = 1.342
Since unit 1 = 30 days
1.342 = 30 1.342 = 40.26 days
p
was on
The maximum temperature
s@

n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

15 JJune + 40 d
days, i.e.,
i on 25 July,
J l and
d
the value of the maximum temperature is
[f( )]
[f(x)]max.
= [f(x)]
[f( )]1.342 = 63.711
63 711F
F. approximately.
i t l

N t Try
Note:
T the
th remaining
i i partt off the
th solution
l ti
yourself.
n.

a
vy

a
dh

e
ov

sh

a
;y

ur

p
ai

er

v
ni

i
an

gh

pa

a
ad

rP

i
;S

A
DH

E
OV

ed

r
pa

m
Co

d
ile

&

Pr

by

S
YA

A
VY

n
Si

,
ity

Ud

.in

c
.a

s
sp

s@

a
vy

n.

LAGRANGE Interpolation Formula


a
dh

e
ov

sh

a
;y

1.
2.
3.
4
4.
5.
6.
7.

ur

Read n, x
d
,U
y
it
rs
e
v
ni
for i =1 to ((n)) in stepsia Uof
1 do
an
h
g
in for
S
Read xi, fi
end
t
pa
am
d
a
rP
sum 0
i
;S
S
A
VY
for i =1 toDH(n)
in steps of 1 do
AN
ER
V
HO
prodfunc
1
S
A
Y
:
by
d
re
a
for j =1 to (n) in steps of 1 do
p
re
p
ai

Co

le
pi

&

.in

c
.a

s
sp

s@

a
vy

n.

a
dh

h
8.
if ( j i ) then
as
y
r;
u
p
ai
d
9. prodfunc prodfunc(xsity,U xj )/ (xi xj )
r
ve
i
endfor
Un
a
ni
a
h
ng
i
10. sum sum + (fi pat Sprodfunc)
am
d
a
r P endfor
i
;S
S
A
VY
11. Write x, sum
AN
H
RD
E
12 STOP ASHOV
12.
e
ov

:Y

ed

r
pa

m
Co

d
ile

&

Pr

by

You might also like