Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

BMA3207 Numerical Analysis

Lecturer 6 : Interpolation for Equal Intervals


Notes Prepared

Gikonyo Kiguta

Assistant Lecturer department of mathematics


Mount Kenya University
Contents

1 Interpolation for Equal Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


1.1 Gregory-Newton Interpolations 5
1.1.1 Gregory–Newton Forward Difference Formula . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.2 Gregory–Newton Forward Difference Formula . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.3 Worked Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.4 Mixed questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Interpolation for Equal Intervals

1.1 Gregory-Newton Interpolations


spaced points, for examples, the experiments with equispaced inputs. In this chapter, we will
discuss the following interpolation methods for equally spaced points:
Forward difference formula
i) Newton forward difference formula
Backward difference formula
ii) Newton backward difference formula

1.1.1 Gregory–Newton Forward Difference Formula


Let us consider a function, y = f (x) defined on the interval, [a, b]. Let x0 , x1 , x2 , . . . , xn be (n + 1)
equidistant points in the given interval. Let h be the spacing between two consecutive values of x,
i.e.,
h = xi+1 − xi
⇒ xi = x0 + ih; i = 1, 2, · · · , n
Newton divided difference interpolating polynomial is given by
p(p − 1) 2 p(p − 1)(p − 2) 3
yn (x) =y0 + p∆y0 + ∆ y0 + ∆ y0 + · · ·
2! 3!

p(p − 1)(p − 2) . . . (p − n + 1) n
+ ∆ y0
n!
where
(x − xo )
p=
h
which is Newton’s forward difference interpolation formula and is useful for interpolation near the
beginning of a set of tabular values.
6 Chapter 1. Interpolation for Equal Intervals

The table below shows the difference table used on Gregory–Newton Forward Difference Formula

1.1.2 Gregory–Newton Forward Difference Formula

For interpolations near the end of the table values, we use the Gregory–Newton Backward Difference
Formula. It is given by:

p(p + 1) 2 p(p + 1) . . . (p + n − 1) n
yn (x) = yn + p∇yn + ∇ yn + · · · + ∇ yn
2! n!

where

(x − xn )
p=
h

The following table contains the tabular points for Newton backward difference formula
1.1 Gregory-Newton Interpolations 7

x f (x) ∇ ∇2 ∇3

.. ..
. .

..
xn−3 yn−3 .
..
∇ yn−2 .
..
xn−2 yn−2 ∇2 yn−1 .
∇ yn−1 ∇3 yn
xn−1 yn−1 ∇2 yn
∇ yn
xn yn

1.1.3 Worked Examples

Q.1. Find a cubic polynomial in x which takes on the values -3,3,11,27,57 and 107 when
x = 0, 1, 2, 3, 4 and 5 respectively.

Ans
Here, the observations are given at equal intervals of unit Width. To determine the required we first
construct the difference table

Difierence table

x f (x) ∆ f (x) ∆2 f (x) ∆3 f (x)


0 -3
6
1 3 2
8 6
2 11 8
16 6
3 27 14
30 6
4 57 20
50
5 107

since the 4th and higher order difierences are zero, the required Newton’s interpolation formula
p(p−1) 2
f (x0 + ph) = f (x0 ) + p∆ f (x0 ) + 2 ∆ f (x0 ) + p(p−1)(p−2)
6 ∆3 f (x0 )

Here
p = x−x x−0
h = 1 =x
0

∆ f (x0 ) = 6
∆2 f (x0 ) = 2
∆3 f (x0 ) = 6
8 Chapter 1. Interpolation for Equal Intervals

substituting these values into the formula, we have

f (x) = −3 + 6x + x(x−1)
2 (2) +
x(x−1)(x−2)
6 (6)

f (x) = x3 − 2x2 + 7x − 3

The required cubic polynomial.

Q.2.
For the following table of Velues, estimate f (7.5)

x 1 2 3 4 5 6 7 8
y = f (x) 1 8 27 64 125 216 343 512
Ans
The value to be interpolated is at the end of the table. Hence, it is appropriate to use Newton’s
backward interpolation formula. Let us first construct the backward difference table for the given
data

x f (x) ∇ f (x) ∇2 f (x) ∇3 f (x) ∇4 f (x)


1 1
7
2 8 12
19 6
3 23 18 0
37 6
4 64 24 0
61 6
5 125 30 0
91 6
6 216 36 0
127 6
7 343 42
169
8 512
since the 4 th and higher order difierences are zero, the required Newton’s backward interpo-
lation formula is
p(p+1) 2 p(p+1)(p+2) 3
yx = yn + p∇yn + 2! ∇ yn + 3! ∇ yn

x−xn 7.5−8.0
In this problem, p = h = 1 = −0.5

∇yn = 169, ∇2 yn = 42, ∇3 yn = 6

y7,5 = 512 + (−0.5)(169) + (−0.5)(0.5)


2 (42) + (−0.5)(0.5)(1.5)
6 (6)

= 512 − 84.5 − 5.25 − 0.375

=421.875
1.1 Gregory-Newton Interpolations 9

Q.3.
The sales for the last five years is given in the table below. Estimate the sales for the year 1979
Year 1974 1976 1978 1980 1982
Sales (in lakhs) 40 43 48 52 57
Ans
Newtons backward difference table is given by:

x y ∇y ∇2 y ∇3 y ∇4 y
1974 40
3
1976 43 2
5 -3
1978 48 -1 5
4 2
1980 52 1
5
1982 57
In this example,
1979 − 1982
p= = −1.5
2
and
∇yn = 5, ∇2 yn = 1
∇3 yn = 2, ∇4 yn = 5

Newton’s interpolation formula gives

y1979 = 57 + (−1.5)5 + (−1.5)(−0.5)


2 (1) + (−1.5)(−0.5)(0.5)
6 (2) + (−1.5)(−0.5)(0.5)(1.5)
24 (5)

= 57 − 7.5 + 0.375 + 0.125 + 0.1172

y1979 = 50.1172

1.1.4 Mixed questions


Q.1.
Find the cubic polynomial which takes the following values: y(1) = 24, y(3) = 120, y(5) = 336,
and y(7) = 720. Hence, or otherwise, obtain the value of y(8). We form the difference table:
X y ∆ ∆2 ∆3
1 24
96
3 120 120
216 48
5 336 168
384
7 720
10 Chapter 1. Interpolation for Equal Intervals

Here h = 2. With x0 = 1, we have p = (x − 1)/2.


Substituting this value of p in we obtain

x−1 x−1 x−1 x−1 x−1


    
x−1 2 2 −1 2 2 −1 2 −2
y(x) = 24 + (96) + (120) + (48)
2 2 6
= x3 + 6x2 + 11x + 6

To determine y(8), we observe that p = 7/2. Hence, we have:

7 (7/2)(7/2 − 1) (7/2)(7/2 − 1)(7/2 − 2)


y(8) = 24 + (96) + (120) + (48) = 990
2 2 6

Direct substitution in y(x) also yields the same value.

Q.2.
Values of x (in degrees) and sin x are given in the foll table:

x (in degrees) sin x


15 0.2588190
20 0.3420201
25 0.4226183
30 0.5
35 0.5735764
40 0.6427876
Determine the value of sin 38◦ .
Ans
The difference table is

x sin x ∆ ∆2 ∆3 ∆4 ∆5
15 0.2588190
0.0832011
20 0.3420201 -0.0026029
0.0805982 -0.0006136
25 0.4226183 -0.0032165 0.0000248
0.0773817 -0.0005888 0.0000041
30 0.5 -0.0038053 0.0000289
0.0735764 -0.0005599
35 0.5735764 -0.0043652
0.0692112
40 0.6427876
To find sin 38◦ , we use Newton’s backward difference formula with xn = 40 and x = 38. This
gives

x − xn 38 − 40 2
p= = = − = −0.4
h 5 5
1.1 Gregory-Newton Interpolations 11

Hence, we obtain
−0.4(−0.4 + 1)
y(38) =0.6427876 − 0.4(0.0692112) + (−0.0043652)
2
(−0.4)(−0.4 + 1)(−0.4 + 2)
+ (−0.0005599)
6
(−0.4)(−0.4 + 1)(−0.4 + 2)(−0.4 + 3)
+ (0.0000289)
24
(−0.4)(−0.4 + 1)(−0.4 + 2)(−0.4 + 3)(−0.4 + 4)
+ (0.0000041)
120
=0.6427876 − 0.02768448 + 0.00052382 + 0.00003583 − 0.00000120
=0.6156614

You might also like