Uploaded by Raiwat Kansakar

Chap 4 Interpolation

advertisement
Numerical Methods
Saraswati Acharya, PhD
Department of Mathematics
School of Science, Kathmandu University
Kavre, Dhulikhel
Chapter 3: Finite differences and Interpolation
Contents to Study
1
Finite differences
forward difference
backward difference
central difference
2
3
4
5
6
Differences of a polynomial
Introduction for interpolation
Linear and quadratic interpolation and its extension for Newton
interpolation formulae (Forward and backward)
Lagrange interpolation formula and its inverse interpolation formula
Divided differences
Newton’s general interpolation formula
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 2of
/ 48S
Interpolation
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 3of
/ 48S
...Interpolation
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 4of
/ 48S
...Interpolation
Let the analytic formula of f (x) is not known but the values of f (x) are
known for (n + 1) distinct values of x, say, x0 , x1 , x2 , · · · , xn (node points)
and the corresponding entries are given by
y0 = f (x0 ), y1 = f (x1 ), · · · , yn = f (xn ). Our problem is to compute f (x)
such that f (x) agree at a set of values [xn , yn ]. The process by which we
can find the required value of f (x) for any other value of x in the interval
[x0 , xn ] is called Interpolation. When x lies slightly outside the interval
[x0 , xn ] then the process is called Extrapolation. If f (x) is a polynomial,
then the process is called polynomial interpolation.
1 Finite Differences
Assume that we have a table values (xi , yi ), i = 0, 1, 2, · · · , n of any
function y = f (x), the values of x being equally spaced, That is,
xi = x0 + ih. Suppose that we are required to recover the values of f (x)
for some intermediate values of x or to obtain the derivative of f (x) for
some x in the range x0 ≤ x ≤ xn . The methods for the solution to these
problems are based on the concept of the differences of a function.
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 5of
/ 48S
Forward Differences
If y0 , y1 , y2 , · · · , yn denote a set of values of y then
∆y0 = y1 − y0 , ∆y1 = y2 − y1
∆y2 = y3 − y2 , · · · , ∆yn−1 = yn − yn−1
(1)
where ∆ is called the forward difference operator and ∆y0 , ∆y1 · · · are called the
first forward differences
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 6of
/ 48S
The second, third, fourth · · · forward differences are:
∆2 y0 = ∆y1 − ∆y0
= y2 − y1 − (y1 − y0 ) = y2 − 2y1 + y0
Similarly ,
∆3 y0 = ∆2 y1 − ∆2 y0 = y3 − 3y2 + 3y1 − y0
∆4 y0 = y4 − 4y3 + 6y2 − 4y1 + y0
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 7of
/ 48S
Backward Differences
If y0 , y1 , y2 , · · · , yn denote a set of values of y then
∇y1 = y1 − y0 , ∇y2 = y2 − y1
.
∇y3 = y3 − y1 , .., ∇yn = yn − yn−1
(2)
where ∇ is called the backward difference operator and ∇y1 , ∇y2 · · · are called
the first backward differences
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 8of
/ 48S
The second, third, · · · backward differences are:
∇2 y2 = ∇y2 − ∇y1 = y2 − y1 − (y1 − y0 ) = y2 − 2y1 + y0
Similarly , ∇3 y3 = ∇2 y3 − ∇2 y2 = y3 − 3y2 + 3y1 − y0
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School 9of
/ 48S
Central Differences
If y0 , y1 , y2 , · · · , yn denote a set of values of y then
δy5/2
δy1/2 = y1 − y0 , δy3/2 = y2 − y1
.
= y3 − y1 , .., δyn−1/2 = yn − yn−1
(3)
where δ is called the central difference operator and δy1/2 , δy3/2 · · · are called
the first central differences
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School10of
/ 48S
can we write this?
∆y0 = ∇y1 = δy1/2
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School11of
/ 48S
Newton Forward Interpolation Formula
Given that (n + 1) data points: Say (x0 , y0 ), (x1 , y1 ),(x2 , y2 ),· · · ,(xn , yn ),
Let say, xi = x0 + ih.i = 0, 1, 2, · · · , n
As n = 1, we have a data points (x0 , y0 ), (x1 , y1 ),
Now, We have a Linear interpolation polynomial Newton formula
y = a0 + a1 (x − x0 )
(4)
Substitute data points in 4
As (x0 , y0 ) then y0 = a0
as (x1 , y1 ) then
y1 = a0 + a1 (x1 − x0 )
y1 = y0 + a1 · h
y1 − y0
∆y0
a1 =
=
h
h
∴ y = y0 +
∆y0
h (x
Saraswati Acharya
− x0 )
(
Department
MCSC202 of Mathematics[2mm]School12of
/ 48S
As n = 2, we have a data points (x0 , y0 ), (x1 , y1 ),(x2 , y2 )
Now, We have interpolation polynomial Newton formula
y = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 )
Substitute data points in 5
As (x0 , y0 ) then y0 = a0
0
=
as (x1 , y1 ) then a1 = y1 −y
h
as (x2 , y2 ) then
(5)
∆y0
h
y2 = a0 + a1 (x2 − x0 ) + a2 (x2 − x0 )(x2 − x1 )
∆y0
y2 = y0 +
· 2h + a2 · 2h · h
h
y2 − y0 − 2∆y0 = a2 · 2h2
y2 − y0 − 2(y1 − y0 )
a2 =
2h2
y2 − 2y1 + y0
∆2 y 0
a2 =
=
2
2h
2h2
∴ y = y0 +
∆y0
h (x
Saraswati Acharya
− x0 ) +
2
1 ∆ y0
2 h2 (x
(
− x0 )(x − x1 )
Department
MCSC202 of Mathematics[2mm]School13of
/ 48S
As n = 3, we have a data points (x0 , y0 ), (x1 , y1 ),(x2 , y2 ),
(x3 , y3 )
Now, We have interpolation polynomial Newton formula
y = a0 + a1 (x − x0 ) + a2 (x − x0 )(x − x1 ) + a3 (x − x0 )(x − x1 )(x − x2 )
Substitute data points in 6
As (x0 , y0 ) then y0 = a0
0
=
as (x1 , y1 ) then a1 = y1 −y
h
as (x2 , y2 ) then a2 =
as (x3 , y3 ) then a3 =
2
(6)
∆y0
h
∆ y0
2h2
∆3 y0
3!h3
y3 = a0 + a1 (x3 − x0 ) + a2 (x3 − x0 )(x3 − x1 ) + a3 (x3 − x0 )(x3 − x1 )(x3 − x2 )
···
substituting the values of a0 , a1 , a2 , a3 in equation 6, then we get,
2
3
1 ∆ y0
1 ∆ y0
0
∴ y = y0 + ∆y
h (x − x0 ) + 2! h2 (x − x0 )(x − x1 ) + 3! h3 (x − x0 )(x − x1 )(x − x2 )
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School14of
/ 48S
Similarly, y = yn (x) is a polynomial of nth degree, it can be
written as:
∆y0
1 ∆2 y 0
(x − x0 ) +
(x − x0 )(x − x1 )
h
2! h2
1 ∆3 y0
+
(x − x0 )(x − x1 )(x − x2 )
3! h3
1 ∆ n y0
+··· +
(x − x0 )(x − x1 ) · · · (x − xn−1 )
n! hn
y =y0 +
setting, p =
x−x0
h
(7)
then equation 7 become
p(p − 1) 2
∆ y0
2!
p(p − 1)(p − 2) 3
+
∆ y0
3!
p(p − 1)(p − 2) · · · (p − n + 1) n
+··· +
∆ y0
n!
y =y0 + p∆y0 +
(8)
Which is Newton forward difference interpolation formula and is useful for
interpolation near the beginning of a set of tabular values
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School15of
/ 48S
The tables given below gives the values of tanx for
0.10 ≤ x ≤ 0.30:
x
0.10
0.15
0.20
0.25
0.30
y = tanx
0.1003
0.1511
0.2027
0.2553
0.3093
Find, (a)tan(0.12), (b)tan(0.26).
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School16of
/ 48S
Tabulating as a forward difference table
To find tan(0.12).That is at x = 0.12, tanx =?, we have
p = (x − x0 )/h = 0.4, where h = 0.05
we have the Newton forward formula,
p(p − 1) 2
∆ y0
2!
p(p − 1)(p − 2) 3
p(p − 1)(p − 2)(p − 3) 4
∆ y0 +
∆ y0
+
3!
4!
y =y0 + p∆y0 +
substituting the value and then simplify, we get tan(0.12) = 0.1205
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School17of
/ 48S
Exercise
Find the cubic polynomial which takes the following
values:y (1) = 24, y (3) = 120, y (5) = 336, y (7) = 720. Obtain the value of
x−1
0
y(4). Hints: h = 2, x0 = 1, p = x−x
h = 2
p(p − 1) 2
∆ y0
2!
p(p − 1)(p − 2) 3
+
∆ y0
3!
y =y0 + p∆y0 +
Ans: y (x) = x 3 + 6x 2 + 11x + 6 then find y(4)
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School18of
/ 48S
Newton backward interpolation formulation
Given that (n + 1) data points: Say (x0 , y0 ), (x1 , y1 ),(x2 , y2 ),· · · ,(xn , yn ),
Let say, xi = x0 + ih.
As n = 1, we have a data points (x0 , y0 ), (x1 , y1 ),
Now, We have a Linear interpolation polynomial Newton formula
y = a0 + a1 (x − x1 )
(9)
Substitute data points in 9
As (x1 , y1 ) then y1 = a0
as (x0 , y0 ) then
y0 = a0 + a1 (x0 − x1 )
y0 = y1 + a1 · (−h)
y1 − y0
∇y1
a1 =
=
h
h
∴ y = y1 +
∇y1
h (x
Saraswati Acharya
− x1 )
(
Department
MCSC202 of Mathematics[2mm]School19of
/ 48S
As n = 2, we have a data points (x0 , y0 ), (x1 , y1 ),(x2 , y2 )
Now, We have interpolation polynomial Newton formula
y = a0 + a1 (x − x2 ) + a2 (x − x2 )(x − x1 )
(10)
Substitute data points in 10
As (x2 , y2 ) then y2 = a0
as (x1 , y1 ) then
y1 = a0 + a1 (x1 − x2 ) = y2 + a1 (−h)
1
2
∴ a1 = y2 −y
= ∇y
h
h
as (x0 , y0 ) then
y0 = a0 + a1 (x0 − x2 ) + a2 (x0 − x2 )(x0 − x1 )
y2 − y1
y0 = y2 +
· (−2h) + a2 · (−2h) · (−h)
h
y2 − 2y1 + y0
a2 =
2h2
2
∇ y2
a2 =
2h2
∴ y = y2 +
∇y2
h (x
Saraswati Acharya
− x2 ) +
2
1 ∇ y2
2 h2 (x
(
− x2 )(x − x1 )
Department
MCSC202 of Mathematics[2mm]School20of
/ 48S
As n = 3, we have a data points (x0 , y0 ), (x1 , y1 ),(x2 , y2 ),
(x3 , y3 )
Now, We have interpolation polynomial Newton formula
y = a0 + a1 (x − x3 ) + a2 (x − x3 )(x − x2 ) + a3 (x − x3 )(x − x2 )(x − x1 )
(11)
Substitute data points in 11, we get
2
3
1 ∇ y3
1 ∇ y3
3
∴ y = y3 + ∇y
h (x − x3 ) + 2! h2 (x − x3 )(x − x2 ) + 3! h3 (x − x3 )(x − x2 )(x − x1 )
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School21of
/ 48S
Similarly, y = yn (x) is a polynomial of nth degree, it can be
written as:
∇yn
1 ∇2 yn
(x − xn ) +
(x − xn )(x − xn−1 )
h
2! h2
1 ∇3 yn
+
(x − xn )(x − xn−1 )(x − xn−2 )
3! h3
1 ∇n yn
(x − xn )(x − xn−1 ) · · · (x − x1 )
+··· +
n! hn
n
then equation 12 become
setting, p = x−x
h
y =yn +
(12)
p(p + 1) 2
∇ yn
2!
p(p + 1)(p + 2) 3
(13)
+
∇ yn
3!
p(p + 1)(p + 2) · · · (p + n − 1) n
+··· +
∇ yn
n!
Which is Newton backward difference interpolation formula and is useful for
interpolation near the end of a set of tabular values.
y =yn + p∇yn +
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School22of
/ 48S
Find the cubic polynomial which takes the following values
y (0) = 1, y (1) = 0, y (2) = 1 and y (3) = 10.Obtain y (4)
since x = 4 lies near after end point therefore we use Newton’s backward
interpolation formula. The difference table is
The backward difference table is
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School23of
/ 48S
...Solution
Here, we have xn = 3, h = 1, p =
interpolation formula, we get
x−xn
h
= (x − 3) by Newton backward
p(p + 1) 2
∇ yn
2!
p(p + 1)(p + 2) 3
+
∇ yn
3!
y (x) =yn + p∇yn +
now, y (x) = 10 + (x − 3)9 +
∴ f (4) = 43 − 2 · 42 + 1 = 33
Saraswati Acharya
(
(x−3)(x−2)
2
·8+
(x−3)(x−2)(x−1)
6
(14)
· 6 = x 3 − 2x 2 + 1
Department
MCSC202 of Mathematics[2mm]School24of
/ 48S
Exercise
The population of a country in decennial census were as under. Find the
population for 1975 year.
year x:
population y
1941
46
1951
67
1961
83
1971
95
1981
102
Find the population for 1975 year.
Ans: 98.31
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School25of
/ 48S
Lagrange interpolation formulation
Given that (n + 1) data points: Say (x0 , y0 ), (x1 , y1 ),(x2 , y2 ),· · · ,(xn , yn ),
where the values of x need not necessarily be equally spaced, we wish to
find a polynomial of degree n,
As n = 1, we have a data points (x0 , y0 ), (x1 , y1 ),
Now, We have a Linear interpolation polynomial Lagrange’s formula
y = a0 (x − x1 ) + a1 (x − x0 )
Substitute data points in 15
0
As (x0 , y0 ) then a0 = x0y−x
, as (x1 , y1 ) then a1 =
1
x−x1
x−x0
∴ y = x0 −x1 y0 + x1 −x0 y1
(15)
y1
x1 −x0
y = L1 (x) = l0 (x)y0 + l1 (x)y1
= Σ1i=0 li (x)yi
x − x1
where, l0 (x) =
x0 − x1
x − x0
and l1 (x) =
x1 − x0
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School26of
/ 48S
...Lagrange interpolation formulation
As n = 2, we have a data points (x0 , y0 ), (x1 , y1 ),(x2 , y2 )
Now, We have a Linear interpolation polynomial Lagrange’s formula
y = a0 (x − x1 )(x − x2 ) + a1 (x − x0 )(x − x2 ) + a2 (x − x0 )(x − x1 )
(16)
Substitute data points in 16
0
As (x0 , y0 ) then a0 = (x0 −x1y)(x
0 −x2 )
y1
as (x1 , y1 ) then a1 = (x1 −x0 )(x1 −x2 )
2
as (x2 , y2 ) then a2 = (x2 −x0y)(x
2 −x1 )
∴ y=
(x−x1 )(x−x2 )
(x0 −x1 )(x0 −x2 ) y0
+
(x−x0 )(x−x2 )
(x1 −x0 )(x1 −x2 ) y1
+
(x−x0 )(x−x1 )
(x2 −x0 )(x2 −x1 ) y2
y = L2 (x) = l0 (x)y0 + l1 (x)y1 + l2 (x)y2
= Σ2i=0 li (x)yi
(x − x1 )(x − x2 )
where, l0 (x) =
(x0 − x1 )(x0 − x2 )
(x − x0 )(x − x2 )
and l1 (x) =
(x1 − x0 )(x1 − x2 )
(x − x0 )(x − x1 )
and l2 (x) =
(x2 − x0 )(x2 − x1 )
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School27of
/ 48S
...Lagrange interpolation formulation
As n = 3, we have a data points (x0 , y0 ), (x1 , y1 ),(x2 , y2 ),(x3 , y3 )
Now, We have a Linear interpolation polynomial Lagrange’s formula
y = a0 (x − x1 )(x − x2 )(x − x3 ) + a1 (x − x0 )(x − x2 )(x − x3 )
+ a2 (x − x0 )(x − x1 )(x − x3 ) + a3 (x − x0 )(x − x1 )(x − x2 )
(17)
Substitute data points in 17
0
As (x0 , y0 ) then a0 = (x0 −x1 )(x0 y−x
2 )(x0 −x3 )
y1
as (x1 , y1 ) then a1 = (x1 −x0 )(x1 −x2 )(x1 −x3 )
2
as (x2 , y2 ) then a2 = (x2 −x0 )(x2 y−x
1 )(x2 −x3 )
y3
as (x3 , y3 ) then a3 = (x3 −x0 )(x3 −x1 )(x3 −x2 )
(x − x1 )(x − x2 )(x − x3 )
(x − x0 )(x − x2 )(x − x3 )
y0 +
y1
(x0 − x1 )(x0 − x2 )(x0 − x3 )
(x1 − x0 )(x1 − x2 )(x1 − x3 )
(x − x0 )(x − x1 )(x − x3 )
(x − x0 )(x − x1 )(x − x2 )
+
y2 +
y3
(x2 − x0 )(x2 − x1 )(x2 − x3 )
(x3 − x0 )(x3 − x1 )(x3 − x2 )
∴ y=
(18)
y = L3 (x) = l0 (x)y0 + l1 (x)y1 + l2 (x)y2 + l3 (x)y3
= Σ3i=0 li (x)yi
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School28of
/ 48S
General Lagrange’s Interpolation Formula is
(x − x1 )(x − x2 ) · · · (x − xn )
y0
(x0 − x1 )(x0 − x2 ) · · · (x0 − xn )
(x − x0 )(x − x2 ) · · · (x − xn )
+
y1
(x1 − x0 )(x1 − x2 ) · · · (x1 − xn )
(x − x0 )(x − x1 )(x − x3 ) · · · (x − xn )
+
y2
(x2 − x0 )(x2 − x1 )(x2 − x3 ) · · · (x2 − xn )
(x − x0 )(x − x1 )(x − x2 ) · · · (x − xn−1 )
+ ··· +
yn
(xn − x0 )(xn − x1 )(xn − x2 ) · · · (xn − xn−1 )
y=
(19)
y = Ln (x) = Σni=0 li (x)yi
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School29of
/ 48S
Remark
li (xj ) = 1; if i = j and 0 if i 6= j
Justification: We have a Lagrange interpolation of degree one,
1
0
y = xx−x
y0 + xx−x
y1
0 −x1
1 −x0
y = L1 (x) = l0 (x)y0 + l1 (x)y1
= Σ1i=0 li (x)yi
x − x1
where, l0 (x) =
x0 − x1
x − x0
and l1 (x) =
x1 − x0
−x1
−x1
now, l0 (x0 ) = xx00 −x
= 1 and l0 (x1 ) = xx01 −x
=0
1
1
x0 −x0
x1 −x0
l1 (x0 ) = x1 −x0 = 0 and l1 (x1 ) = x1 −x0 = 1
1
0
Σ1i=0 li (x) = l0 (x) + l1 (x) = xx−x
+ xx−x
0 −x1
1 −x0
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School30of
/ 48S
Using Lagrange’s interpolation formula, find the form of
the function y (x) from the following table:
x:
y
0
12
3
6
4
8
Given that
x:
y
x0 = 0
y0 = 12
x1 = 3
y1 = 6
x2 = 4
y2 = 8
Applying Lagrange’s formula to the above table, we find
1 )(x−x2 )
0 )(x−x2 )
0 )(x−x1 )
y == (x(x−x
y0 + (x(x−x
y1 + (x(x−x
y2
0 −x1 )(x0 −x2 )
1 −x0 )(x1 −x2 )
2 −x0 )(x2 −x1 )
y = (x−3)(x−4)
(−3)(−4) 12 +
y = x 2 − 5x + 12
Saraswati Acharya
(x−0)(x−4)
(3−0)(3−4) 6
(
+
(x−0)(x−3)
(4−0)(4−3) 8
Department
MCSC202 of Mathematics[2mm]School31of
/ 48S
exercise
Certain corresponding values of x and log10 are (300, 2.4771),
(304, 2.4829),(305, 2.4843) and (307, 2.4871).Find log10 (301).
Ans:2.4786
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School32of
/ 48S
Lagrange Inverse Interpolation Formula
y = f (x), its Lagrange Inverse Interpolation Formula is x = f (y ).
(y − y1 )(y − y2 ) · · · (y − yn )
x0
(y0 − y1 )(y0 − y2 ) · · · (y0 − yn )
(y − y0 )(y − y2 ) · · · (y − yn )
x1
+
(y1 − y0 )(y1 − y2 ) · · · (y1 − yn )
(y − y0 )(y − y1 )(y − y3 ) · · · (y − yn )
+
x2
(y2 − y0 )(y2 − y1 )(y2 − y3 ) · · · (y2 − yn )
(y − y0 )(y − y1 )(y − y2 ) · · · (y − yn−1 )
+ ··· +
xn
(yn − y0 )(yn − y1 )(yn − y2 ) · · · (yn − yn−1 )
x=
Saraswati Acharya
(
(20)
Department
MCSC202 of Mathematics[2mm]School33of
/ 48S
Divided Differences and their properties
Given that (n + 1) data points: Say (x0 , y0 ), (x1 , y1 ),(x2 , y2 ),· · · ,(xn , yn ),
where the values of x need not necessarily be equally spaced, we wish to
find a polynomial of degree n,
The divided difference table is
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School34of
/ 48S
Remark
Let the argument be equally spaced so that
x1 − x0 = x2 − x1 = · · · = xn − xn−1 = h. Then we obtain
(y1 −y0 )
[x0 , x1 ] = (x
= h1 ∆y0
1 −x0 )
Similarly,
0 ,x1 ])
[x0 , x1 , x2 ] = ([x1 ,x(x22]−[x
= h212! ∆2 y0 and in general,
−x0 )
[x0 , x1 , x2 · · · xn ] =
Saraswati Acharya
1
n
hn n! ∆ y0
(
Department
MCSC202 of Mathematics[2mm]School35of
/ 48S
Newton’s General Interpolation Formula
By Definition of Divided Difference
[x, x0 ] =
y − y0
x − x0
So that, y = y0 + (x − x0 )[x, x0 ]
[x, x0 , x1 ] =
(21)
[x, x0 ] − [x0 , x1 ]
x − x0
[x, x0 ] = [x0 , x1 ] + (x − x1 )[x, x0 , x1 ]
(22)
substitute [x, x0 ] into equation 21.Then we get
y = y0 + (x − x0 )[x0 , x1 ] + (x − x0 )(x − x1 )[x, x0 , x1 ]
[x, x0 , x1 , x2 ] =
(23)
[x, x0 , x1 ] − [x0 , x1 , x2 ]
x − x2
[x, x0 , x1 ] = [x0 , x1 , x2 ] + (x − x2 )[x, x0 , x1 , x2 ]
(24)
substitute [x, x0 , x1 ] into equation 24.Then we get
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School36of
/ 48S
...Contd.
substitute [x, x0 , x1 ] into equation 24.Then we get
y = y0 + (x − x0 )[x0 , x1 ] + (x − x0 )(x − x1 )[x0 , x1 , x2 ]
+ (x − x0 )(x − x1 )(x − x2 )[x, x0 , x1 , x2 ]
(25)
Proceeding in this way, we obtain
y = y0 + (x − x0 )[x0 , x1 ] + (x − x0 )(x − x1 )[x0 , x1 , x2 ]
+ (x − x0 )(x − x1 )(x − x2 )[x0 , x1 , x2 , x3 ] + · · ·
+ (x − x0 )(x − x1 )(x − x2 ) · · · (x − xn )[x, x0 , x1 , · · · , xn ]
(26)
This formula is called Newton’s general interpolation formula with divided
differences
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School37of
/ 48S
Using the following table find f (x) as a polynomial in x
x:
f(x)
-1
3
0
-6
3
39
6
822
7
1611
The divided difference table is
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School38of
/ 48S
we have the divided difference formula
f (x) = y0 + (x − x0 )[x0 , x1 ] + (x − x0 )(x − x1 )[x0 , x1 , x2 ]
+ (x − x0 )(x − x1 )(x − x2 )[x0 , x1 , x2 , x3 ]
+ (x − x0 )(x − x1 )(x − x2 )(x − x3 )[x0 , x1 , x2 , x3 , x4 ]
(27)
f (x) = 3 + (x + 1)(−9) + (x + 1)(x)(6) + (x + 1)(x)(x − 3)(5)
+ (x + 1)(x)(x − 3)(x − 6)(1)
f (x) = x 4 − 3x 3 + 5x 2 − 6
exercise
Find the form of the function f (x) under suitable assumption from the
following table
x:
f(x):
0
2
1
3
2
12
5
147
Ans: x 3 + x 2 − x + 2
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School39of
/ 48S
Symbolic Relations and Separation of Symbols
We have ∆, ∇, δ
E = Shift Operation, µ = average or mean operator The shifted operator
E is defined by
Eyr = yr +1
(28)
The average operator µ is defined by the equation
1
1
1
1
µyr = (yr + 1 + yr − 1 = [f (r + ) + f (r − )])
2
2
2
2
2
2
(29)
The equation 28 is the first equation with E to yr is to shift the
functional value yr to the next highest value yr +1
Similarly, E is E 2 yr = E (Eyr ) = E (yr +1 ) = yr +2
In general, E n yr = yr +n
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School40of
/ 48S
What is the relation between ∆&E . We have
∆y0 = y1 − y0
∆y0 = Ey0 − y0
∆y0 = y0 (E − 1)
∆ = (E − 1)
∆2 y0 = ∆y1 − ∆y0
∆2 y0 = ∆y1 − ∆y0
∆2 y0 = (y2 − y1 ) − (y1 − y0 )
∆2 y0 = (y2 − 2y1 + y0 )
∆2 y0 = E 2 y0 − 2Ey0 + y0
∆2 y0 = (E 2 − 2E + 1)y0
∆2 = (E − 1)2
exercise
∆3 = (E − 1)3
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School41of
/ 48S
What is the relation between ∇&E . We have
∇yn = yn − yn−1
∇yn = yn − E −1 yn
∇yn = (1 − E −1 )yn
∇ = (1 − E −1 )
What is the relation between δ&E . We have
δy1/2 = y1 − y0
δy1/2 = y1/2+1/2 − y1/2+(−1/2)
δy1/2 = E 1/2 y1/2 − E −1/2 y1/2
δy1/2 = (E 1/2 − E −1/2 )y1/2
δ = E 1/2 − E −1/2
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School42of
/ 48S
What is the relation between µ&E . We have
1
µyx = (yx+1/2 + yx−1/2 )
2
1
µyx = (E 1/2 yx + E −1/2 yx )
2
1
µyx = (E 1/2 + E −1/2 )yx
2
1
µ = (E 1/2 + E −1/2 )
2
exercise
µ=
q
1 + 14 δ 2
µ2 = 1 + 14 δ 2
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School43of
/ 48S
..Contd.
Show that δ 2 E = ∆2
δ 2 E = (E 1/2 − E −1/2 )2 · E
1
δ 2 E = (E − 2 + ) · E
E
δ 2 E = E 2 − 2E + 1
δ 2 E = (E − 1)2
δ 2 E = ∆2
Show that µ −
δ
2
Saraswati Acharya
= E −1/2
(
Department
MCSC202 of Mathematics[2mm]School44of
/ 48S
Self Reading: Central Difference Formulas
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School45of
/ 48S
Self Reading: Central Difference Formulas
Now for x = 1.34, p =
Saraswati Acharya
1.34−1
0.05
(
= 0.8, then yn = 3.6726
Department
MCSC202 of Mathematics[2mm]School46of
/ 48S
... Central Difference Formulas
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School47of
/ 48S
...Central Difference Formulas
Saraswati Acharya
(
Department
MCSC202 of Mathematics[2mm]School48of
/ 48S
Download