Assignment Numerical Analysis: Topic
Assignment Numerical Analysis: Topic
Topic:
NEWTON'S DIVIDED DIFFERENCE FORMULA
Group Members:
Muhammad Talha Saeed (MCF 1900271)
Faisal Abbas (MCF 1900101)
Muhammad Behzad (MCF 1900228)
Laiba (MCF 1900356)
Rabia Nawaz (MCF 1800530)
Submitted By:
Group# 2(MSC 3rd Morning)
Submitted to:
DR. Umer Saleem sb
Outlines
• Divided Difference Operator
• Example
Divided Difference Operator:
Let 𝑓(𝑥𝑜 ),f(𝑥1), f(𝑥2), 𝑓(𝑥 3), …
f(𝑥 𝑛 ) be the entry of values of the function y= f(𝑥 𝑛 )
at argument 𝑥0, 𝑥1,𝑥2,𝑥3,...., 𝑥 𝑛 which are not
equally spaced.
Divided difference can now be
defined as
the difference between two successive value
of the
entry divided by the difference between the
corresponding value of the argument.
𝑓 (𝑥 1 )− 𝑓 ( 𝑥 0 )
Therefore, the first
and is denoted by f(𝑥divided
0, 𝑥1 ) or [𝑥0, 𝑥1 ]
𝑥 1− 𝑥 𝑜
difference of 𝑓(𝑥 1 )− 𝑓 (𝑥 0 )
𝑜, 1 𝑜 1
f(𝑥) for f(𝑥 𝑥 ) = [𝑥 ,𝑥𝑥0 and
the arguments ] 𝑥𝑥 1−
1 is
𝑥 0defined as
Similarly,
=
𝑓(𝑥 2 )− 𝑓 (𝑥 1 )
f(𝑥 , 𝑥 ) = [𝑥 , 𝑥 ] = and so on.
1 2 1 2 𝑥 2 −𝑥 1
The second divided difference of f ( 𝑥 ) for three
arguments 𝑥𝑜,𝑥1𝑎𝑛𝑑 𝑥2 is defined as
𝑓(𝑥 1 ,𝑥 2 )−𝑓(𝑥 1 ,𝑥 𝑜 )
f(𝑥𝑜, 𝑥 1, 𝑥 2)= [𝑥 ,𝑜𝑥 ,1𝑥2]=
𝑥 2 −𝑥 0
𝑏𝑜 = 𝑓(𝑥 𝑜 ) = 𝑓 ( 𝑥 𝑜 ) + 𝑏1(𝑥 − 𝑥 𝑜 )
Giving
𝑏1 = 𝑓(𝑥 1 )− 𝑓 (𝑥 0 )
𝑥 1− 𝑥 𝑜
Giving the linear interpolant as
𝑓1(𝑥) = 𝑏𝑜 + 𝑏 1(𝑥 − 𝑥 𝑜 )
𝑓 ( 𝑥 1)− 𝑓 ( 𝑥 0)
1
𝑓 ( 𝑥) = 𝑓 ( 𝑥 ) + 𝑥 𝑥 ( 𝑥 − 𝑥𝑜 )
𝑜 1− 𝑜
Quadratic interpolation:
Given (𝑥𝑜 , 𝑦𝑜 ), (𝑥1, 𝑦 1) and (𝑥2, 𝑦2), fit a quadratic
interpolation through the data. Nothing y=f(𝑥), 𝑦𝑜 =
𝑓 (𝑥 𝑜 ) , 𝑦1 = 𝑓(𝑥 1) and 𝑦2 = 𝑓(𝑥 2), assume the
quadratic interpolant 𝑓2(𝑥) is given by
𝑓2(𝑥) = 𝑏𝑜 + 𝑏1(𝑥 − 𝑥 𝑜 ) + 𝑏2(𝑥 − 𝑥 𝑜 )( 𝑥 − 𝑥 1)
At ( 𝑥 = 𝑥 𝑜 )
𝑓 2(𝑥 𝑜 ) = 𝑓(𝑥 𝑜 ) = 𝑏𝑜 + 𝑏1(𝑥 − 𝑥 𝑜 ) + 𝑏 2(𝑥 − 𝑥 𝑜 )( 𝑥
− 𝑥1)
= 𝑏𝑜
𝑏𝑜 = 𝑓 ( 𝑥 𝑜 )
At ( 𝑥 = 𝑥 1 )
𝑓2(𝑥1) = 𝑓(𝑥𝑓(𝑥
1 ) 1=)−𝑏𝑜𝑓 (𝑥
+ 0𝑏)1(𝑥1 − 𝑥 𝑜 ) + 𝑏2(𝑥1 − 𝑥 𝑜 )( 𝑥 1
− 𝑥 1) 𝑏1 =
𝑓(𝑥 1 ) 𝑥=1−𝑓(𝑥
𝑥 𝑜 𝑜 ) + 𝑏1(𝑥1 − 𝑥 𝑜 )
At ( 𝑥 = 𝑥 2 )
giving
𝑓2(𝑥2) = 𝑓(𝑥 2 ) =𝑓 (𝑥𝑏1)−
𝑜 +𝑓 (𝑥𝑏)01(𝑥2 − 𝑥 𝑜 ) + 𝑏2(𝑥 2 − 𝑥 𝑜 )( 𝑥 2 − 𝑥 1 )
𝑓(𝑥 2) = 𝑓 ( 𝑥 ) + 𝑥 1− 𝑥 𝑜
( 𝑥2 − 𝑥 𝑜 ) + 𝑏2(𝑥2 − 𝑥 𝑜 )( 𝑥 2 − 𝑥 1 )
𝑜
giving 𝑓 (𝑥 2 )− 𝑓 (𝑥 1 ) − 𝑓(𝑥 1 )− 𝑓 (𝑥 0 )
𝑏2 𝑥 2− 𝑥 1
𝑥 1− 𝑥 𝑜 𝑥 2 −𝑥 𝑜
=
Hence the quadratic interpolant is given by
𝑓2(𝑥) = 𝑏𝑜 +𝑓 (𝑥𝑏1)−
1( 𝑥
𝑓 (𝑥−)0 𝑥 𝑜 ) + 𝑏 2 ( 𝑥 − 𝑥 𝑜 )( 𝑥 − 𝑥 1 )
= 𝑓 ( 𝑥 𝑜) + 𝑥 1− 𝑥 𝑜
(𝑥2 − 𝑥 𝑜 ) +
𝑓 (𝑥 2 )− 𝑓 (𝑥 1 ) −𝑓 (𝑥 1 )− 𝑓 (𝑥 0 )
𝑥 2− 𝑥 1 𝑥 1− 𝑥 𝑜
𝑥 2 −𝑥 𝑜 ( 𝑥 − 𝑥 𝑜 )( 𝑥 − 𝑥 1 )
𝑥 1− 𝑥 𝑜 𝑥 2 −𝑥 𝑜
=
Note that 𝑏𝑜, 𝑏1, 𝑎𝑛𝑑 𝑏2 are finite divided
differences. 𝑏𝑜, 𝑏1, 𝑎𝑛𝑑 𝑏2 are the first, second and
third finite divided differences respectively. We
denote the first divided difference by
f[𝑥𝑜] = 𝑓 ( 𝑥 𝑜 )
the second divided difference by
f[𝑥 , 𝑥 ] = 𝑓 ( 𝑥 1 ) − 𝑓 ( 𝑥 0 )
1
𝑜 𝑥 1− 𝑥 𝑜
and the third divided difference by
𝑓 (𝑥 2 )− 𝑓 (𝑥 1 ) 𝑓(𝑥 1 )− 𝑓 (𝑥 0 )
−
f[𝑥2 , 𝑥1 , 𝑥 ] 𝑥 2− 𝑥 1
𝑥 1− 𝑥 𝑜 𝑥 2 −𝑥 𝑜
= 𝑜
where f[𝑥𝑜], f[𝑥1, 𝑥 𝑜 ] and f[𝑥2, 𝑥1, 𝑥 𝑜 ] are called
bracketed functions of their variables enclosed in
square brackets.
Rewriting,
𝑓2(𝑥) =f[𝑥𝑜 ] + f[𝑥1, 𝑥 𝑜 ](𝑥 − 𝑥 𝑜 ) + f[𝑥2, 𝑥1, 𝑥 𝑜 ]( 𝑥 − 𝑥 𝑜 )( 𝑥 −
𝑥1)
This leads up to writing the general form of the
Newton's divided difference polynomial for n+1
data pints, (𝑥𝑜 , 𝑦𝑜), (𝑥1, 𝑦1), … . ( 𝑥 𝑛 , 𝑦 𝑛−1),(𝑥 𝑛 ,
𝑦 𝑛 ),as
𝑓 𝑛 (𝑥) = 𝑏𝑜 + 𝑏1(𝑥 − 𝑥 𝑜 ) … + 𝑏 𝑛 ( 𝑥 − 𝑥 𝑜 )( 𝑥 − 𝑥 1 ) … (𝑥 −
𝑥 𝑛 −1 )
where
𝑏𝑜 = 𝑓 [ 𝑥 𝑜 ]
𝑏1 = f[𝑥1, 𝑥 𝑜 ]
𝑏2 = f[𝑥2, 𝑥1, 𝑥 𝑜 ]
.
.
.
𝑏𝑛−1 = f[𝑥𝑛−1, 𝑥𝑛−2, … . . , 𝑥 𝑜 ]
𝑏𝑛 = f[𝑥𝑛, 𝑥𝑛−1, … . . , 𝑥 𝑜 ]
where the definition of the 𝑚 𝑡 ℎ divided
difference is
𝑏 𝑚 = f[𝑥 𝑚 , … . . … . . , 𝑥 𝑜 ]
𝑓[𝑥 ,…..…..,𝑥1]−𝑓[𝑥𝑚−1,…..…..,𝑥𝑜]
= 𝑚
𝑥 𝑚 −𝑥 𝑜
From the above definition, it can be seen that the
divided differences are calculated recursively.
For example of a third order polynomial given
( 𝑥 𝑜 , 𝑦𝑜), (𝑥1, 𝑦1), (𝑥2, 𝑦 2 ) and (𝑥 3𝑦 3).
𝑓3(𝑥) =f[𝑥𝑜 ] + f[𝑥1, 𝑥 𝑜 ](𝑥 − 𝑥 𝑜 ) + f[𝑥2, 𝑥1, 𝑥 𝑜 ]( 𝑥
− 𝑥 𝑜 )( 𝑥 − 𝑥 1 ) +
𝑓[𝑥3, 𝑥2, 𝑥1, 𝑥 𝑜 ]( 𝑥 − 𝑥 𝑜 )( 𝑥 − 𝑥 1 )
(𝑥 − 𝑥 2 )
Example:
Use Newton's divided difference formula to find f ( 𝑥 ) and f(4).Given
that
𝑥 0 2 3 6
f( 𝑥 ) 648 704 729 792
Solution:
Divided Difference Table:
𝑥 f( 𝑥 ) ∆ f( 𝑥 ) ∆ 2 f( 𝑥 ) ∆3f( 𝑥 )
0 648
28
2 704 −1
25 0
3 729 −1
21
6 792
By using Newton's Divided Difference Formula:
𝑓 ( 𝑥 ) =f[𝑥𝑜 ] + f[𝑥1, 𝑥 𝑜 ](𝑥 − 𝑥 𝑜 ) + f[𝑥2, 𝑥1, 𝑥 𝑜 ](𝑥 − 𝑥 𝑜 )( 𝑥 − 𝑥 1 )
+
𝑓[𝑥3𝑥2𝑥 1𝑥𝑜 ](𝑥 − 𝑥 𝑜 )( 𝑥 − 𝑥 1 )(𝑥 − 𝑥 2 )
=648+(𝑥 − 0)(28)+ (𝑥 − 0)(𝑥 − 1)(−1) + 0
𝑓 ( 𝑥 ) = −𝑥2 + 30𝑥 + 648
When 𝑥 = 4
𝑓 ( 4 ) = −(4)2 + 30(4) + 648
𝑓 ( 4 ) = 752