You are on page 1of 37

Department of mathematics AKS UNIVERSITY SATNA

A Project Report on

TO STIDY OF INTERPOLATION WITH


COMPUTATION
A Project report submitted in partial fulfilment of the requirements for the award of the degree of

Bachelor of Science ( MATHEMATICS )

AKS University Satna


SESSION 2021-24
FACULTY OF BASIC SCIENCE

Submitted By: Satish Jaiswal


5B.SC.(mathematics)
Under the guidance Mr NEELKANT NAPIT
1
AKS University, Satna
Department of mathematics AKS UNIVERSITY SATNA

CERTIFICATE

This is to certify that the report of the project submitted


is the outcome of the project work entitled “STUDY OF
INTERPOLATION WITH COMPUTATION ”,
carried out By SATISH JAISWAL bearing Student
Code: (B2120R10574010), from 2021- 2024, under the
supervision Mr. NEELKANT NAPIT has been
completed successfully.

Project guide HEAD OF DEPARTMENT

Mr. NEELKANT NAPIT DR. SUDHA AGRAWAL

Project viva-voce held on …………………………..

2
Department of mathematics AKS UNIVERSITY SATNA

DECLARATION

I hereby declare that project entitled “project titled” submitted to the AKS
UNIVERSITY, is a record of an original work done By me under the guidance
of Mr. NEELKANT NAPIT AKS University Satna .This project towards the
partially fulfillment of requirement for the awards of degree bachelor of
science in mathematics during the period of 2021-2024 AKS UNIVERSITY
SATNA .

I confirm that the work committed in their own and the approach rate credit
has been given we are reference has been made to the work of others.

I understand to attribute material which is obtained from another source may


be considered as plagiarism.

SATISH JAISWAL

B2120R10574010

BSc. ( MATHEMATICS ) V Semester

3
Department of mathematics AKS UNIVERSITY SATNA

Internal Teacher External Teacher:

Name of Candidate:

SATISH JAISWAL
( B2120R10574010 )

4
TABLE OF CONTENT
Page no.

1) Newton’s forward interpolation formula 6-8


2) Newton’s backward interpolation formula 8-10
3) Central difference interpolation formula 11
4) Gauss’s forward interpolation formula 12-13
5) Gauss’s backward interpolation formula 14-15
6) Stirling’s formula 16-17
7) Bessel’s formula 18-19
8) Laplace Everett’s formula 20
9) Choice of an interpolation formula 21-22
10) Interpolation with unequal intervals 23
11) Lagrange’s interpolation formula 23-24
13) Divided differences 25-26
14) Newton’s divided difference formula 26-27
15) Relation between divided and forward differences 27-28
16) Hermite’s interpolation formula 29-31
17) Spline interpolation 32-34
18) Double Interpolation 35
19) Inverse interpolation 35

5
20) Lagrange’s method 35-36
Introduction
Suppose we are given the following values of y  f(x) for a set of
values of x:
x: x0 x1
x2  xn
y: Y0 y1
y2  yn.

Then the process of finding the value of y corresponding to any value of


x  xi between x0 and xn is called interpolation. Thus interpolation is the
technique of estimating the value of a function for any intermediate
value of the independent variable while the process of computing the value
of the function outside the given range is called extrapolation. The term
interpola- tion however, is taken to include extrapolation.
If the function f(x) is known explicitly, then the value of y correspond-
ing to any value of x can easily be found. Conversely, if the form of f(x) is
not known (as is the case in most of the applications), it is very difficult
to de- termine the exact form of f(x) with the help of tabulated set of values
(xi, yi). In such cases, f(x) is replaced by a simpler function ø(x) which
assumes the same values as those of f(x) at the tabulated set of points.
Any other value may be calculated from ø(x) which is known as the
interpolating function or smoothing function. If ø(x) is a polynomial, then
it called the interpolating polynomial and the process is called the
polynomial interpolation. Similarly when ø(x) is a finite trigonometric
series, we have trigonometric interpola- tion. But we shall confine
ourselves to polynomial interpolation only.
The study of interpolation is based on the calculus of finite
differences. We begin by deriving two important interpolation formulae
by means of forward and backward differences of a function. These
formulae are often employed in engineering and scientific investigations.

Newton’s Forward Interpolation Formula


Let the function y  f(x) take the values y , y ,  , y corresponding to
the values x0, x1,  , x of x. Let these values of x be equispaced such that
x  x  ih (i  0, 1, ). Assuming y(x) to be a polynomial of the nth
degree
in x such that y(x0 )= y0 , y(x1 )= y1 ,, y(xn )= y n . We can write

6
y(x)= a0 + a1 (x – x0 )+ a2 (x – x0 )(x – x1 ) + a3 (x – x0 )(x – x1 )(x – x2 )
++ an (x – x0 )(x – x1 )(x – xn–1 ) (1)

Putting x  x0, x1,  , xn successively in (1), we get


y0 = a0 , y1 = a0 + a1 (x1 – x0 ), y2 = a0 + a1 (x2 – x0 )+ a2 (x2 – x0 )(x2 –
x1 )
and so on.
 From
a1 = these,
Δy0 we find that a0 = y0 ,Δy 0 = y1 – y0 = a1 (x1 – x0 ) =
a 1h h
Als Δy1 = y2 — y1 = a1 (x2 — x1 )+ a2 (x2 — x0 )(x2 —
o 1x )
1

= 1a1h+ a2hh =Δy 0 +2h 2


1 a22
 a2 = 2 (Δy1 — Δy )= 2 Δ y0
0 2h 2!h
1 3
Similarly a30 = 3!h3 Δ y and so on.
Substituting these values in (1), we
obtain
Δy0 Δ2 y0 Δ3 y0
y(x)= y0 + h (x— x0 )+ (x— x0 )(x— x1 )+ (x— x0 )(x— x1 )(x— x2 )
2!h2 3!h3
+ (2
Now if it is required to evaluate y for x  x0  ph, then )
( x— x0) = ph, x— x1 = x— x0 —( x— x0) = ph— h =( p
—1) h,

(x— x0 )= x— x0 —(x— x0 )=(p—1)h— h =(p—2)h etc.


p(p—1) p(p—1)(p—2)
Hence, writting + 0 + ph)Δ=2 yy0p,+(2) becomes Δ 3y 0
pΔy=0 y(x
yp = y0 +y(x)
2! 3!

p(p—1)(p— n -
++ Δ n y0 (3)
1) 3!
It is called Newton’s forward interpolation formula as (3) contains y0
and the forward differences of y0

Otherwise: Let the function y  f(x) take the values y0, y 1, y ,  corre-
2
sponding to the values x0 , x0  h, x  2h,  of x. Suppose it is required to
evaluate f(x) for x  x0  0ph, where p is any real number.

7
For any real number p, we have defined E such that
Ep f (x)= f (x + ph)

yp = f (x0 + ph) = Ep f (x0 ) =(1+Δ) p y0 [ E  1  ]


 p(p—1) 2 p(p—1)(p—2) 3
Δ + (4)
=
 1+ pΔ+ 2! 
Δ y0 +
J y0
[Using binomial theorem] 3!
p(p—1) 2 p(p—1)(p—2) 3
Δ y0 + Δ y0 + 
i.e., y = y + pΔy
p 0
2! 3!
0
+
If y  f(x) is a polynomial of the nth degree, then n1y0 and higher dif-
ferences will be zero.
Hence (4) will become
p(p—1) 2 p(p—1)(p—2) 3
yp = y0 + pΔy0 + Δ y0 + Δ y0 + 
2! 3!
p(p—1)(p— n—
+ Δ n y0
1) 3!

Newton’s Backward Interpolation Formula


Let the function y  f(x) take the values y0, y1, y2,  corresponding to

the values x0, x 0  h, x  2h,  of x. Suppose it is required to evaluate f(x)


for x  xn  ph,
0 where p is any real number. Then we have
yp  f(xn  ph)  Ep f(xn)  (1 – )-p yn [ E1  1
– ] p(p+1) 2 p(p+1)(p+2) 3

=L1+ 2! +   y0 +yn
p+ 3!

8
p(p+1) 2 p(p+1)(p+2) 3
i.e., yp = yn + pyn  yn  yn 
2! + 3! + (1)
+
It is called Newton’s backward interpolation formula as (1) contains yn
and backward differences of yn

EXAMPLE
The table gives the distance in nautical miles of the visible horizon
for the given heights in feet above the earth’s surface:
x  height: 100 150 200 250 300 350 400
y  distance: 10.63 13.03 15.04 16.81 18.42 19.90 21.27
Find the values of y when
(i) x  160 ft. (ii) x  410.
Solution:
The difference table is as
under:
x y 2 3 4

100 10.63
2.40
150 13.03 – 0.39
2.01 0.15
200 15.04 – 0.24 – 0.07
1.77 0.08
250 16.81 – 0.16 – 0.05
1.61 0.03
300 18.42 – 0.13 – 0.01
1.48 0.02
350 19.90 – 0.11
1.37
400 21.27
(i) If we take x0  160, then y0 13.03, y0  2.01, 2y0  – 0.24,
  0.08, 4 y0  – 0.05
3

9
Since x  160 and h  50, x — x0 10
 p=h = = 0.2
 50 formula, we get
Using Newton’s forward interpolation
p(p—1) 2 p(p—1)(p—2) 3
y218 = yp = y0 + pΔy0 + Δ y0 + Δ y0
2! 3!
p(p—1)(p—2)(p—3) 4
+ Δ y0 + 
4!
y160  13.03  0.402  0.192  0.0384  0.00168  13.46 nautical miles
(ii) Since x  410 is near the end of the table, we use Newton’s back-
ward interpolation formula.
x— xn
 Taking xn  400, p= 10h = =
0.2
50
Using the line of backward difference
yn 21.27,  yn 1.37, 2 yn – 0.11, 3 yn 0.02 etc.
 Newton’s backward formula gives
p(p+1) 2
+ 400 +  400
y410 = y400 2!y
py
p(p+1)(p+2) 3 p(p+1)(p+2)(p+3) 4
+ Δ y 400 +  400 +
3! 4! y
0.2(1.2)
= 21.27 +0.2(1.37)+ 2! (—0.11)

0.2(1.2)(2.2) 0.2(1.2)(2.2)(3.2)
+ (0.02)+ (—0.01)
3! 4!
= 21.27 +0.274 — 0.0132 +0.0018
— 0.0007
 21.53 nautical miles

10
Central Difference Interpolation Formula

In the preceding sections, we derived Newton’s forward and backward


interpolation formulae which are applicable for interpolation near the be-
ginning and end of tabulated values. Now we shall develop central differ-
ence formulae which are best suited for interpolation near the middle of
the table.
If x takes the values x0 – 2h, x0 – h, x0, x0  h, x0  2h and the
correspond- ing values of y  f(x) are y–2, y–1, y0, y1, y2, then we can write
the difference table in the two notations as follows:

x y 1st diff. 2nd diff. 3rd diff. 4th diff.


x0 – 2h y2

y2 ( y3/2)

x0 – h y1 2y2( 2y1)

y1 ( y1/2) 3y2 ( 3y1/2)

x0 y0 2y1 ( 2y0) 3y2( 4y0)

y0 ( y1/2) 3y1 ( 3y1/2)

x0  h y1 2y0( 2y1)

y1( y3/2)

x0  2h y2

11
Gauss’s Forward Interpolation Formula
The Newton’s forward interpolation formula is
p(p—1) 2 p(p—1)(p—2) 3
y0 = y0 + pΔy0 + Δ y0 + Δ y0 + 
1.2 1.2.3 (1)
We have 2y0 – 2y1  3 y1
i.e., 2 y0  2 y1 3 y1 (2)
Similarly 3y0  3y1 4y1 (3)
4 y0  4 y1 5 y1 etc. (4)
Also 3 y1– 3y2  4 y2
i.e., 3 y1  3 y2 4y2
Similarly 4 y1  4 y2 5 y2etc. (5)
Substituting for 2 y0, 3 y0, 4 y0 from (2), (3), (4)..in (1), we get
p(p—1) 2 p(p—1)(p—2) 3
yp = y0 + pΔy0 +
1.2
(Δ y—1 +Δ 3 y— )+
1.2.3
(Δ y—1 +Δ 4 —1
y )
1

p(p—1)(p— 2)(p—
+ (Δ4 y—1 +Δ 5 —1
3)
y )
p(p—1) 2 1.2.3.4
p(p—1)(p—2) 3
Hence yp = y0 + pΔy0 + Δ y—1 + Δ y—1
2! 3!
(p+1)(p—2)(p—3)
+ Δ4 y—2 + [using (5)]
4!

12
EXAMPLE 7.8
Find f(22) from the Gauss forward
formula:
x: 20 25 30 35 40 45
f (x): 354 332 291 260 231 204

Solution : Taking x0  25, h  5, we have to find the value


of f(x) for x  22.
x— x0 22—25
i.e., for p = = = – 0.6
h 5
The difference table is as
follows:
x p yp  yp 2yp 3yp 4yp 5yp
20 – 1 354 ( y ) – 22
1

25 0 332 ( y ) – 41 – 19 29
0

30 1 291 ( y ) – 31 10 –8 – 37 45
1

35 2 260 ( y ) – 29 2 0 8
2

40 3 231 ( y ) – 27 2
3

45 4 204 ( y )
4

Gauss forward formula


is 2
3
p(p—1) Δ y — + (p+1)p(p—1) Δ y
yp = y0 + pΔy0 + 1
—1
2! 3!

4
+ (p+1)p(p—1)(p— Δ y —2
2) 4!
5
+ (p+1)(p—1)p(p— 2) Δ y—2 +.....
(p+2) 5!

(—0.6)(—0.6—1)
f (22) = 332 +(0.6)(–41)+ 2! (—19)

(—0.6 +1)(—0.6)(—0.6—1)
+ (—8)
3!
(—0.6 +1)(—0.6)(—0.6—1)(—0.6— 2)
+ (—37)
4!
(—0.6 +1)(—0.6)(—0.6—1)(—0.6— 2)(—0.6 +2)
+

(45)
5!
 332  24.6 – 9.12 – 0.512 
1.5392 – 0.5241
13
Hence
Gauss’s Backward Interpolation Formula

The Newton’s forward interpolation formula is

p(p—1) 2 p(p—1)(p—2) 3
yp = y0 + pΔy0 + Δ y0 + Δ y0 + 
1.2 1.2.3
(1)
We have  y0 –  y1  2 y1
i.e.,  y0   y1  2 y1 (2)
Similarly  2y0  2 y1  3 y1 (3)
3 y0  3 y1  4 y1 etc. (4)
Also 3 y1 – 3 y2  4 y2
i.e., 3 y1  3 y2 4 y2 (5)
Similarly 4 y1  4 y2 5 y2etc. (6)

Substituting for  y0, 2 y 0, 3 y ,  from (2), (3), (4) in (1), we get


0
p(p—1) 2
yp = y0 + p(Δy—1 +Δ 2 y—1 )+
1.2
(Δ y—1 +Δ 3 —
y )
1
p(p—1)(p—2) 3 p(p—1)(p—2)(p—3)
+
1.2.3
(Δ y—1 +Δ — +4
1.2.3.4
×(Δ 4y—1 +Δ 5 y—1 )+
y )
1

p(p+1) 2 (p+1)p(p—1) 3
= y0 + pΔy—1 + Δ y—1 + Δ y—1
1.2 1.2.3
(p+1)p(p—1)(p—2) 4 p(p—1)(p—2)(p—3) 5
+ Δ y—1+ Δ y—1 +
1.2.3.4 1.2.3.4
(p+1)p 2 (p+1)p(p—1) 3
= y0 + pΔy—1 +
1.2
Δ y—1 +
1.2.3
(Δ y—2 +Δ 4 —
y ) 4
2
(p+1)p(p—1)(p—2)
+
1.2.3.4
(Δ y—2 +Δ 5 y— )+
2
[using (5) and
p(p+1) 2 (p+1)p(p—1)(6)3
Hence yp= y0 + pΔy— + Δ y—1 + Δ y—2
1
2! 3!
(p+1)p(p+1)(p—1) 4
+ Δ y—2 +
4!
which is called Gauss’s backward interpolation
formula.

14
EXAMPLE
Using Gauss backward difference formula, find y (8) from the
following table.
x 0 5 10 15 20 25

y 7 11 14 18 24 32

Solution:
Taking x0  10, h  5, we have to find y for x  8, i.e., for
x— x0 8—10
p= = =–0.4.
h 5

Gauss backward formula


is (p+1)p 2 (p+1)p(p—1) 3
yp = y0 + pΔy—1 + Δ y—1 + Δ y—2
2! 3!
(p+2)p(p+1)p(p—1) 4
+ Δ y—2 +
4!
The difference table is as
follows:
x p yp yp 2yp 3yp 4yp 5yp
0 2 7
4
5 1 11 –1
3 2
10 0 14 1 –1
4 1 0
15 1 18 2 –1
6 0
20 2 24 2
8
25 3 32

(—0.4 +1)(—0.4) (—0.4 +1)(—0.4)(—0.4—1)


y(8) =14 +(–0.4)(3)+ (1)+ (2)
2!

3!
(—0.4 +2)(—0.4 +1)(—0.4)(—0.4—1)
+ (—1)
15
.

Stirling’s Formula
Cor. In the central differences notation, this formula will be
(p+1)p 2 (p+1)p(p—1) 3
yp = y0 + pay—1 2 + a y0 + a y—1
2! 3! 2
(p+2)(p+1)p(p—1) 4
+ a y0 + 
4!

(p+1) 2 (p+1)p(p—1) 3
yp = y0 + pΔy0 + Δ y—1 + Δ y—1
2! 3!
(1)
(p+1)p(p—1)(p—2) 4
+ Δ y—2 +
4!
Gauss’s backward interpolation formula is
(p+1)p 2 (p+1)p(p—1) 3
yp = y0 + pΔy—1 + Δ y—1 + Δ y—2 (2)
2! 3!
(p+2)(p+1)p(p—1) 4
+ Δ y—2 +
4!
Taking the mean of (1) and (2), we
obtained
2 p(p2 —1)
yp = y0 +  Δy0 +Δy—1  p 2
 2 +2! Δ y—1 +
p  (3)
3!
× Δ y—1 +Δ y—2 p (p — Δ 4y—2 +
3 3 2 2
 2  4!
1)

Which is called Stirling’s +
formula.

16
EXAMPLE
Employ Stirling’s formula to compute y12.2 from the following table (yx  1  log10sinx):

105 y : 23,967 28,060 31,788 35,209 38,368


x
x°: 10 11 12 13 14

Taking the origin at x0  12°, h  1 and p  x – 12, we have the following central difference table:

p yx yx 2yx 3yx 4yx


– 2  x2 0.23967  y2
0.04093  y2
– 1  x1 0.28060  y1 – 0.00365  2y2
0.03728  y1 0.00058  3y2
0  x0 0.31788  y0 – 0.00307   y1
2
– 0.00013  4y2
0.03421  y0 – 0.00045   y1
2

1  x1 0.35209  y1 – 0.00062  2y0


0.03159  y1
2  x2 0.38368  y 2 1
1
At x  12.2, p  0.2. (As p lies between — and , the use of String’s
formula will be Quite suitable.) 4 4

Stirling’s formula is
p Δy—1 +Δy—0 p2 2 p(p2 —1) Δ3 y—2 +Δ 3 y—1
yp = y0 + + Δ y—1 + .
1 2 2! 3!
p2 (p2 —1) 4 2
+ Δ y—2 +
4!
When p  0.2, we
have
 0.03728 +0.03421
y = 0.3178 +0.2 (—0.00307)
 0.2 
(0.2) 2 2 
+
2 L 2
2
(0.2)2L(0.2)2 —1  0.00058 +0.00054+(0.2) (0.2) — (—0.00013)
+
6  2  1

24
 0.31788  0.00715 – 0.00006 – 0.000002 
0.0000002
 0.32497.

17
Bessel’s Formula

Cor. In the central difference notation, (3) takes the form


2 p(p2 —12 ) 3 p2 (p2 —
y p = y0 + pµay0 +p a2 y + 12 ) µa4y0 + a y0 +
0 2! 3! 4!

For
1
2
(Δy0 +Δy — )= 12(ay 1 2 +ay —1 2)= µay 0
1
1 3
1
(Δ y—1 +Δ 3 y— )= ( a3 y1 2 +a 3 y —1 2 = µa3 y
2 0 etc.
2 )
2

p(p—1) 2 (p+1)p(p—1) 3
yp = y0 + pΔy0 + Δ y—1 + Δ y—1
2! 3!
(p+1)p(p—1)(p+1) 4
+ Δ y—2 +
4!
We have 2y0 – 2y–1  3y–1 (1)
i.e., 2y–1  2y 0 – 3y –1 (2)
Similarly 4y–2  4y–1 – 4y–2 etc.
Now (1) can be written as
1 2  p(p2 — 3
yp = y0 + pΔy0 + p(p—1) 1 2 1) + Δ y—1
 Δ y—1 + 2 Δ y—1 
2!  
2 3! 1 
2
+ p(p —1)(p—2 ) 1 4
4!  Δ4 y—2 + Δ y—2 +
2

= y0 + pΔy0 +1 p(p+1) Δ 2 y—1 + 1 p(p—1) (Δ223 y0 + Δ —


2 2!
2 2! y )
1
p(p —1) 3
2
Δ y—1 + 1 p(p —1)(p—2) Δ 4 y—2 + 1 p(p —1)(p—2)
2 2
+
3! 2 4!
2 4!
×(Δ y—1 — Δ y—1 )+
4 5

[Using (2), (3)


etc.]

18
EXAMPLE
Apply Bessel’s formula to obtain y25, given y20  2854, y24  3162,
y28  3544, y32  3992.

Solution:
Taking the origin at x0  24, h  4, we have p  (x – 24).
 The central difference table is
p y y 2y 3y
–1 2854
308
0 3162 74
382 –8
1 3544 66
448
2 3992

(25 – 24) 1 1 3
At x = 25, p = 4 = 4 . . (As p lies between 4 and , the use
of 4
Bessel’s formula will yield accurate
results) Bessel’s formula is
 1
p— p(p— 3
2
yp = y0 + pΔy0 + p(p—1) Δ y —1 +Δ2 y +  2  Δ y—1 +
2! 0 
1) 2! (1)
When p  0.25, we2have

0.25(—0.75)74
 +66  (0.25)0.25(—0.75) — 8
y p = 3162 +0.25×382+ 2! 
+ 2 2!

 3162  95.5 – 6.5625 –
0.0625
 3250.875 approx.

19
Laplace-Everett’s Formula

 1
p—2 p(p—
p(p—1) Δ2 y —1 + Δ 2 y +    Δ 3y—1 (4)
Hence yp = y0 + pΔy0 + 2! 0 1) 3!
2
Which is known as Bessel’s formula.

Cor. In the central difference notation, (4) becomes


 1
p(p—1) 2 
p— p(p— 3
yp = y0 + pay1 2 + µa y1 2 +  2
2! 
1) 2! a y1 2

(p+1)p(p—1)(p—2) 4 1 2 +
+ 4! µa y

1 2 1
for (Δ y + Δ 2 y
2 2 —1
)= µa y , (Δ4 y +Δ 4 y—1 )= µa4 y1 2 etc.,
12 —
0 2
2

(p—1)p 2 (p+1)p(p—1) 3
yp = y0 + pΔy0 + Δ y—1 + Δ y—1
2! 3!
(1)
(p+1)p(p—1)(p—2) 4 (p+2)(p+1)p(p—1)(p—2)
+ Δ y—2 + × Δ 5y—2 +
4! 5!
We eliminate the odd differences in (1) by using the relations
Δy0 = y1 – y0 , Δ 3 y–1 = Δ 2 y0 – Δ2 y–1 , Δ 5 y–2 = Δ 4 y–1 – Δ4 y–2 etc.
Then (1) becomes
p(p—1) 2 (p+1)p(p—1) 2
yp = y0 + p(y1 — y0 )
2!
Δ y—1 +
3!
(Δ2 y0 — Δ —
+ y )
1
(p+1)p(p—1)(p—2) 4
+ Δ y—2 +(p+2)(p+1)p(p—1)(p—2)
4! 5!
×(Δ4 y—1 — Δ4 y—2 )+

20
Choice of an Interpolation Formula

So far we have derived several interpolation formulae such


as Newton’s forward, Newton’s backward, Gauss’s
forward, Gauss’s backward, Stirling’s, Bessel’s and
Everett’s formulae for calculating yp from equipages
values which are called classical formulae.
Now, we have to see which formula yields most accurate
results in a particular problem.
The coefficients in the central difference formulae are
smaller and converge faster than those in Newton’s
formulae. After a few terms, the coefficients in the
Stirling’s formula decrease more rapidly than those of

21
the Bessel’s formula and the coefficients of Bessel’s formula decrease
more rapidly than those of Newton’s formula. As such, whenever possible,
central difference formulae should be used in preference to Newton’s
formulae.
The right choice of an interpolation formula however, depends on the
position of the interpolated value in the given data.
The following rules will be found useful:

1. To find a tabulated value near the beginning of the table, use Newton’s
forward formula.
2. To find a value near the end of the table, use Newton’s backward
for- mula.
3. To find an interpolated value near the center of the table, use
1
either
If interpolation Stirling’sfor
is required or pBessel’s or Everett’s
lying between and 1 , prefer
— formula.
Stirling’s
formula 4
3
1
If interpolation is desired for p lying between 4 4 and , use Bessel’s
or Everett’s formula. 4

22
Interpolation with Unequal Intervals
The various interpolation formulae derived so far possess the
disadvan- tage of being applicable only to equally spaced values of the
argument. It is, therefore, desirable to develop interpolation formulae for
unequally spaced values of x. Now we shall study two such formulae:
(i) Lagrange’s interpolation formula
(ii) Newton’s general interpolation formula with divided differences.

Lagrange’s Interpolation Formula


If y  f(x) takes the value y0 , y1,......, yn corresponding to x  x0,x1 ,, x n,
then
(x — x1 )(x — x2 )(x — xn ) (x — x0 )(x — x2 )(x —
f (x) y0 + y
x )
(x0n— x1 )(x0 — x2 )(x0 — xn ) (x1 — x0 )(x1 — x2 )(x1 — xn )
= 1 (1)
(x— x0 )(x— x1 )(x— x 1—n
++ yn
)
(xn — x0 )(xformula
This is known as Lagrange’s interpolation n — x1 )(x — xn— inter-
for nunequal
vals. 1)

Proof: Let y  f(x) be a function which takes the values (x0 , y 0), (x1, y ),,
(xn, yn). Since there are n  1 pairs of values of x and y, we can
1 represent
f(x) by a polynomial in x of degree n. Let this polynomial be of the form
y = f (x)= a0 (x – x1 )(x – x2 )…(x – xn )+ a1 (x – x0 )(x – x2 )(x – xn )

+a2 (x – x0 )(x – x1 )(x – x )(x – xn )++ an (x – x0 )(x – x1 )(x – xn–1 )


3 (2)
Putting x  x0, y  y0, in (2), we get
y0 = a0 (x0 – x1 )(x – x2 )(x – xn )
a0 = y0 / [(x – x1 )(x – x2 )(x – xn )]
Similarly putting x  x1, y  y1 in (2), we have
a1 = y1 / [(x1 – x0 )(x1 – x2 )(x1 – xn )]
Proceeding
Substitutingthe
thesame
valuesway,
of awe
, a find
,  , aa2, in
a3...... n.
(2),awe get (1)
0
1
n

23
Obs. Lagrange’s interpolation formula (1) for n points is a
NOTE
polynomial of degree (n – 1) which is known as the Lagrangian
polynomial and is very simple to implement on a computer.
This formula can also be used to split the given function into
partial fractions.
For on dividing both sides of (1) by (x – x0 )(x – x1 )(x – xn ),
we get
f (x)
=

y0 y1 1
+  1
(x1 — x0 )(x1 — x2 )(x1 — xn. ) (x — +
(x — x0 )(x —x1 x) 1 )(x — xn )
+
(x0 — x1 )(x0 — x2 )(x0 — yxnn ) (x — x0 )

EXAMPLE .

Given the values 1


x: 57 11 13 17
f(x): 150
392— x )(x
(x 1452— x 2366 5202
n 0 n 1 )(xn — xn—1 ) (x —
xn ) formula
evaluate f(9), using Lagrange’s
Solution:
(i) Here x0  5, x1  7, x2  11, x3 13, x4  17
and y0  150, y1  392, y2  1452, y3  2366, y4  5202.
Putting x  9 and substituting the above values in Lagrange’s formula,
we get
(9—7)(9—11)(9—13)(9—17) (9— 5)(9—11)(9—13)(9—
f (9) = ×150 +
17)
×392
(5—7)(5—11)(5—13)(5—17) (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)
(9— 5)(9—7)(9—11)(9—17)
+

×2366

24 (13— 5)(13—7)(13—11)(13—17)
Divided Differences
The Lagrange’s formula has the drawback that if another interpola-
tion value were inserted, then the interpolation coefficients are required
to be recalculated. This labor of recomputing the interpolation
coefficients is saved by using Newton’s general interpolation formula
which employs what are called “divided differences.” Before deriving
this formula, we shall first define these differences.
If (x0 , y0 ),(x1 , y1 ),(x2 , y2 ), be given points, then the first divided dif-
ference for the arguments x0, x1 is defined by the relation [x0, x1]
or
y —
Δ y0 = y10
x1 x1 — x0
y — y —
Similarly [x1, x ] or Δ y0 = y21 and [x2 , x ] or Δ y0 y32
2
x x2 — x1 =
2
3
x x3 — x2
3

The second divided difference for x0, x1, x2 is defined as

[x1 , x2 ]—[x0 , x1 ]
[x 02, x 1, x ] or xΔ1 2,x2 = x2 — x0

The third divided difference for x0, x1, x2, x3 is defined as


[x1 , x2, x3 ]—[x0 , x1 , 2
[x0, x 1, x 2, x ] or Δ3 y0 = x ]
3
x2 — x0
x1 ,x2 ,x3
Properties of Divided Differences
I. The divided differences are symmetrical in their arguments, i.e,. inde-
pendent of the order of the arguments. For it is easy to write
y0 y1
[x0 , x1 ]= + =[x , x ],[x0 , x1 , 2
x0 — x1x ] x1 — x0 1 0
y0 y1
= + +
(x0 — x1 )(x0 — x2 ) (x1 — x0 )(x1 — yx22 ) (x2 — x0 )(x2 —
x )
 [x11, x2, x0] or [x2, x0, x1] and so on
II. The nth divided differences of a polynomial of the nth degree are con-
stant.
Let the arguments be equally spaced so that

x1 – x0  x2 – x1    xn – xn1 h. Then

25
y1 — y Δy
0 1 = 0
L x ,x 0
x1 — x0 h
=
1 Δy1 Δy0 
[x1 , x2 ]—L x0 —
L x0 , x1 , x2 x2 — x0 = 2h 
 h— h J
= x 1   
1 1
= 2y 0 and in general, [x0 , x1 , x2 ,......, n Δ n y0
2!h x ]=
2 n!h n
If the tabulated function is a nth degree polynomial, then ny0 will be
constant. Hence the nth divided differences will also be constant
III. The divided difference operator Δ is linear
i.e., Δ{aux + bvx }= aΔux + bΔvx

(aux + bvx )—(aux + bvx )


x (au + bv )=
We have Δ
1 1 0 0
x
1
0
x1 — x0
x0

 ux 1 — ux 0   vx 1 — vx 0
= a 1 + b
0 J 1x — 0x J
 x —
 u x 0 + b Δ vx 0
=x a Δ
x1 x
0

In general This property is also true for


Δ(aux + bvx )= aΔux + bΔvx
higher order differences.

Newton’s Divided Difference Formula


Let y 0, y 1,  ,y nbe the values of y  f(x) corresponding to the arguments
x0, x ,  , xn. Then from the definition of divided differences, we
have
1
y— y0
 0
L x, x x—
= x0
So that
y = y0 +(x — x0 )L x, x0

 L x, x0 —
Again L 0x, x , x1 x—1
L x 0 , x 1 
= x
which gives [x, x0 ]=[x0 , x1 ]+(x – x1 )[x, x0 , x1 ]

26
Substituting this value of [x, x0] in (1), we get
y = y0 +(x — x0 )[x0 , x1 ]+(x — x0 )(x — x1 )[x, (2)
x0 , x[x.x
1 ] x ]—[x.x x ]
0, 1 0, 2
Also [x, x0 , x1 , x2 ]=
x — x2

which gives [x, x0 , x1 ]=[x0 , x1 , x2 ]+(x – x2 )[x, x0 , x1 , x2 ]


Substituting this value of [x, x0, x1] in (2), we obtain
y = y0 +(x – x0 )[x0 , x1 ]+(x – x0 )(x – x1 )[x0 , x1 , x2 ]
+(x – x0 )(x – x1 )(x – x2 )[x, x0 , x1 , x2 ]
Proceeding in this manner, we get
y = y0 +(x – x0 )[x0 , x1 ] +(x – x0 )(x – x1 )[x0 , x1 , x2 ]

+(x – x0 )(x – x1 )(x – xn )[x, x0 , x1 , xn ]


(3)
+(x – x0 )(x – x1 )(x – x2 )[x, x0 , x1 , x2 ]+
which is called Newton’s general interpolation formula with divided
differences.

Relation Between Divided and Forward Differences


If (x0 , y0 ),(x1 , y1 ),(x2 , y2 ), be the given points, then
y —
[x0 , x1 ]= y10
x1 — x0
Also y0  y1 – y0
If x 0, x 1, x 2,  are equispaced, then x 1– x  h, so that
0
Δy
[x0 , x1 ]= 0
h
Δy1
Similarly [x1, x2 ]=
h
[x1 , x2 ]—[x0 ,
Now [x0 , x1 , 2
x 1] x2 — x0
x ]=
Δy1 h— Δy0 L x2 — x0 =
= 2h
h
2h
Δy1 —
=
2h2
Δy0 2
Δ y0
Thus [x0 , x1 , x2 ]= 2
2!h

27
Δ2 y1
Similarly [x0 , x1 , x2 ]= 2
2!h
2 2
Δ2 y 2h — Δ2 y 2h Δ2 y 1 — Δ2 y
1 0
=
[x0 , x1 , x2 , x3 ]= x3 — x0 2h0
(3) L x3 — x0 =
 2

Δ 3 y0 3h
Thus [x0 , x1 , x2 , x3 ]= 3
3!h
Δny0
In general, [x0 , x1 , xn ]= n
n!h
This is the relation between divided and forward differences.

EXAMPLE
Given the values
x: 5 7 11 13 17
f(x): 150 392 1452 2366 5202
evaluate f(9), using Newton’s divided difference
formula
Solution:
The divided differences table is
x y Δy Δ2 y Δ3 y
5 150 392 —150
=121
7—5
7 392 265—121
= 24
11— 5

1452 — 392 32 — 24
= 265 =1
11—7 13— 5
11 1452 457 — 265
= 32
13—7

2366 —1452 42 — 32
= 457 =1
13—11 17 —7
13 2366 709 — 457
= 42
17 —11

Taking x  9 in the5202 — 2366divided difference formula, we obtain


Newton’s = 709

f(9)  150  (9 – 5) ×17121


—13 (9 – 5)(9 – 7) × 24  (9 – 5)(9 – 7)(9 – 11) ×
17 5202
1
28
Hermite’s Interpolation Formula

This formula is similar to the Lagrange’s interpolation formula. In La-


grange’s method, the interpolating polynomial P(x) agrees with y(x) at the
points x0, x1,......, xn, whereas in
Hermite’s method P(x) and y(x) as well as P(x) and y(x) coincide at
the (n  1) points, i.e.,
P(xi)  y(xi) and P(xi)  y(xi); i  0, 1,......, n (1)
As there are 2(n  1) conditions in (1), (2n  2) coefficients are to be
determined.
Therefore P(x) is a polynomial of degree (2n
 1). We assume
n that P(x) is expressible
n in the

form p(x) = Σ U i x y xi + Σ V i x y'(xi )


( ) ( ) ( )
i=0 i=0

where Ui (x) and Vi (x) are polynomials in x of degree (2n  1). These are
(2)
to be determined. Using the conditions (1), we get

29
0 when i * j; Vi (x j )= 0 for all
Ui (x j )= 
i1 when i =
 0 when i * j
 (3)
j ;
U(x
i j )= 0 for all i;i V
j
(x )= 1 when i = Jj
We now write 
i L (x)i ; V (x)i = BL (xi )
2
U i (x) = A i ( x)L

L (x) (x— x0 )(x— x1 )(x— xi—1 )(x— xi+1 )(x— xn
2

where L (x)= (x) — x )(x — x )(x — x )(x — x )(x — x


i
i 0 i 1 i i—1 i i+1 i n

Since [Li(x)]2 is)of degree 2n and Ui(x), Vi(x) are of degree (2n  1),
therefore Ai(x) and Bi(x) are both linear functions

and
 We can write Ui(x)  (ai  bix) [Li(x)]2
Vi(x)  (ci  dix)[Li (x)]2
} (4)

}
Using conditions (3) in (4), we get ai  bix  1, ci  di x 
(5)
and 0 b  2L (x )  0, d  1
i i i i

Solving these equations, we

}
obtain bi = – 2L(x
i i ),a i =1+2x
i i i
(6)

dL(x
i 1 )
and c i  – x i

Now putting the above values in (4), we get


Ui (x)=[1+2xi Li (xi ) – 2xLi (xi )][Li
(x)]2
=[1 – 2(x – xi )Li (xi )][Li (x)]2
and Vi (x) 
n (x – xi) n

p(x) = Σ L [L i(x)]i
2

[ 2
1— 2(x — )Li(x i) Li(x) y(x i)+ Σ ]2
(x — xi )[Li(x) i (7)
]
x Finally substitutingy'(x )
i=0 i=0
This
Ui(x) is theV (x)
and required
in (2), Hermite’s interpolation formula which is some-
i
times known as osculating interpolation formula.
we obtain

30
EXAMPLE

For the following data:


x: f(x) f(x)
0.5 4 – 16
1 1 –2
Find the Hermite interpolating polynomial.
Solution:
We have x0  0.5, x1  1, y(x0)  4, y(x1)  1; y(x0)  – 16, y(x1)  – 2
(x— 0 x—
Also L i (x0 )=
x )
(xi — x0 ) — =—2( x—1); L(x
= 1 i 0 )=
0.5 —2
(x— 0 x—0.5
L i (x1)= = = 2x—1;
)
(xi — x0 ) 1—0.5L(x )= 2i 1
x
Hermite’s interpolation formula in this case, is
P ( x) =[1 – 2(x – x0 )L(x0 )][L(x0 )]2 y(x0 )+(x – x0 )[L(x0 )]2 y(x0 )

+[1– 2(x – x1 )L(x1 )][L (x1 )]2 y(x1 )+(x – x1 )[L(x1 )]2
y(x1 )

=[1 – 2(x – 0.5)(–2)][–2(x – 1)]2 (4)+(x – 0.5)[–2(x – 1)]2 (–16)

+[1– 2(x – 1)(2)](2x – 1)2 (1)+( x – 1)(2x – 1)2 (–2)

=16[1+ 4(x – 0.5](x2 – 2x +1) – 164(x – 0.5)(x2 – 2x +1)

+[1 – 4(x – 1)](4x2 – 4x +1) – 2 ( x – 1)(4x2 – 4x +1)

Hence P(x) = –24x3 +324x2 – 130x +23

31
Spline Interpolation
In the interpolation methods so far explained, a single polynomial
has been fitted to the tabulated points. If the given set of points belong to
the polynomial, then this method works well, otherwise the results are
rough approximations only. If we draw lines through every two closest
points, the resulting graph will not be smooth. Similarly we may draw a
quadratic curve through points Ai , Ai+1 and another quadratic curve
through Ai+1, A i+2, such that the slopes of the two quadratic curves match
at A i+1 (Fig. 7.1). The resulting curve looks better but is not quite
smooth. We can ensure this by drawing a cubic curve through A i , Ai+1
and another cubic through A i+1, A i+2su ch that the slopes and curvatures
of the two curves match at A i+1. Such a curve is called a cubic spline.
We may use polynomials of higher order but the resulting graph is not
better. As such, cubic splines are com- monly used. This technique of
“spline-fitting” is of recent origin and has important applications.

A2

f1(x) A n–1
fi+1 fn–1
(x) (x)
f0(x) fi(x)
A0 Ai+2
Ai A i+1 An
A1
y0 y1 y2 yi yn
yi+1 yi+2 yn–1
x2 xi xn x
0 x0 x1 xi+1 xi+2 xn–1

FIGURE 7.1

Cubic spline
Consider the problem of interpolating between the data points (x0, y0),
(x1, y 1),(x n, y )n by means of spline fitting.
Then the cubic spline f(x) is such that
(i) f(x) is a linear polynomial outside the interval (x0, xn),
(ii) f(x) is a cubic polynomial in each of the subintervals,
(iii) f(x) and f(x) are continuous at each point.
Since f(x) is cubic in each of the subintervals f(x) shall be linear.

32
 Taking equally-spaced values of x so that xi+1 – xi  h, we can write

1 i+1 i i+1
f (x)= L  (x – x) f (x
i
) +(x – x ) f )
h 
Integrating(x
twice, we have 

1( i+1 (x – xi ) 
f (x) =  x – f (x i ) f (x ( (1)
a x – x) + bi (x – i
+ hL 3! ) i+1  i i+1
3! x
)
The constants of integration ai, bi are determined x )by substituting the
values of y  f(x) at xi and xi+1. Thus,

 
1 h2 h2
ai =
 yi f (xi )
1 and b i  y i+1 f

— hL 3! =  L
h— 3! (x )
i+1
i) 
Substituting the values of ai, bi and writing f(x Mi, (1) takes the form
3
f (x)   i1
– x x – xi
3
x
Mi 
Mi1
 6h 6h
 x – xi 
+ xi+1 – x h2 h2
 yi— M i + i+1 — Mi+1 
h  6  h 6 
y

(2)
(x – (x – xi )2 1
 f (x)= i2+1 Mi + h
( ) + (yi+1 — yi )
— x) 2h 6h Mi+1 — Mi+1 — M i h
To impose the6 condition of continuity of f (x), we get
f (x –  )  f (x   ) as   0

h 1 h 1
 6 (2M i + Mi–1 )+h (yi – yi–1 ) = –6 (2Mi + M
i+1 )+
h (yi+1 – i

y)
M i–1 + 4Mi + M = 2
6
– 2y + y ), i =1 to n  (3)
i–1 i
i+1 h
(y 1
Now since the graph isi+1linear for x < x0 and x > xn, we have
M0  0, Mn  0
(3) and (4) give (n  1) equations in (n  1) unknowns Mi (i  0, 1, n)
which can be solved. Substituting the value of Mi in (2) gives the
(4)
concerned cubic spline.

33
EXAMPLE

Obtain the cubic spline for the following


data 0 1 2 3
x:
y: 2 –6 –8 2
Solution:
Since the points are equispaced with h  1 and n  3, the cubic
spline can be determined from Mi–1  4Mi  Mi+1  6 (yi–1 – 2yi  yi+1), i  1,
2.  M  4M  M  6 (y – 2y  y )
0 1 2 0 1 2

M1  4M2  M3  6 (y1 – 2y2  y3)


i.e., 4M1  M2  36; M1  4M2  72 [ M0  0, M3  0]
Solving these, we get M1  4.8, M2  16.8.
Now the cubic spline in (xi  x  xi  1) is
1 3 
 x i1  x M i  x  xi  x  x y  1 M i 
1 3
M
f (x) 
6 6 i1 i1  6

 i




) y —1
i+1
+(x — xi  
 
M i+1

1 1 1
f (x)= (1– x)3 (0)+ (x – 0)3 (4.8)+(1 – x)(x – 0)+ 6 x[–6 –
(4.8)
Taking6 i  0 in (A) the cubic
6 spline in (0  x  1) is
6
 0.8x3 – 8.8x  2 (0  x  1)
Taking i  11in (A),3the cubic
1 spline in (1  x  2) is 1
f (x)  (2 – x) (4.8)  (x – 1)3 (16.8)  (2 – x)[– 6 – 4.8]
6 6 6
(x – 1)[– 8 – 116.8]
 2x3 – 5.84x2 – 1.68x  0.8
Taking i  2 in (A), the cubic spline in (2  x  3)
is
1 1
f (x) = (3 – x)3 (4.8)+ (x – 2)3 (0)+(3 – x)
[– 8 – 1(16.8)]
6 6
+(x – 2)[2– 1(2)]
 – 0.8x3  2.64x2  9.68x – 14.8

34
Double Interpolation
So far, we have derived interpolation formulae to approximate a func- tion of a single
variable. In the case of functions, of two variables, we inter- polate with respect to the first
variable keeping the other variable constant. Then interpolate with respect to the second
variable.

Inverse Interpolation
So far, given a set of values of x and y, we have been finding the value of y
corresponding to a certain value of x. On the other hand, the process of estimating the
value of x for a value of y (which is not in the table) is called inverse interpolation. When
the values of x are unequally spaced La- grange’s method is used and when the values of x
are equally spaced, the Iterative method should be employed.

Lagrange’s Method
This procedure is similar to Lagrange’s interpolation formula (p. 207), the only
difference being that x is assumed to be expressible as a polynomial in y.

( y  y1 )( y  y2 )( y  yn ) ( y  y0 )( y  y2 )( y 
x x0  x
y( ny)  y1 )( y  y2 )( y  yn ) ( 1y  y0 )( 1y  2y )( y1  ny )
1 (1)
( y  y0 )( y  y1 )( y  yn1 )

( yn  y0 )( yn  y1 )( yn 
yn1 )
EXAMPLE
The following table gives the values of x and y:
x: 1.2 2.1 2.8 4.1 4.9 6.2
y: 4.2 6.8 9.8 13.4 15.5 19.6

Find the value of x corresponding to y  12, using Lagrange’s tech-


nique.
Solution:
Here x0  1.2, x1  2.1, x2  2.8, x3  4.1, x4  4.9, x5  6.2 and y0 
4.2,
y1  6.8, y2  9.8, y3  13.4, y4  15.5, y5  19.6.

35
Taking y  12, the above formula (1) gives

(12  6.8)(12  9.8)(12  13.4)(12  15.5)(12  19.6)


x 1.2
(4.2  6.8)(4.2  9.8)(4.2  13.4)(4.2  15.5)(4.2  19.6)
(12  4.2)(12  9.8)(12  13.4)(12  15.5)(12  19.6)
  2.1
(6.8  4.2)(6.8  9.8)(6.8  13.4)(6.8  15.5)(6.8  19.6)
(12  4.2)(12  6.8)(12  13.4)(12  15.5)(12  19.6)
  2.8
(9.8  4.2)(9.8  6.8)(9.8  13.4)(9.8  15.5)(9.8  19.6)
(12  4.2)(12  6.8)(12  9.8)(12  15.5)(12  19.6)

 4.1
(13.4  4.2)(13.4  6.8)(13.4  9.8)(13.4  15.5)(13.4  19.6)
(12  4.2)(12  6.8)(12  9.8)(12  13.4)(12  19.6)

 4.9
(15.5  4.2)(15.5  6.8)(15.5  9.8)(15.5  13.4)(15.5  19.6)
(12  4.2)(12  6.8)(12  9.8)(12  13.4)(12  15.5)

 6.2
(19.6  4.2)(19.6  6.8)(19.6  9.8)(19.6  13.4)(19.6  15.5)

 0.022 – 0.234  1.252  3.419 – 0.964  0.055  3.55

36
BIBLIOGRAPHY

I HAVE HELP TAKEN FROM THE FOLLOWING WEBSITE


LINK :-.

* https://www.britannica.com/science/interpolation

* https://byjus.com/maths/interpolation/

* https://en.m.wikipedia.org

* https://www.google.com/

37

You might also like