NA (Lec-11 12)
NA (Lec-11 12)
NA (Lec-11 12)
Lecture -11+12
Page 1 of 16
INTERPOLATION:
Suppose we are given a data:
x: 𝑥0 𝑥1 𝑥2 ……… 𝑥𝑛
f(x): f(𝑥0 ) f(𝑥1 ) f( 𝑥2 ) ……….f(𝑥𝑛 )
Then process of finding the values of f(x) corresponding to any value of ‘x’ between 𝑥0 and 𝑥𝑛 is
called interpolation.
Extrapolation:
The process of finding the values of f(x) corresponding to any value of ‘x’ outside the given range is
called extrapolation.
= (1 + ∆) 𝑥 f(a)
Page 2 of 16
𝑥(𝑥−1) 𝑥(𝑥−1)(𝑥−2)
= [1+ x∆ + ∆2 + ∆3 +………….]f(a)
2! 3!
In summation form
∞
𝑥
𝑓(𝑎 + 𝑥ℎ) = ∑ ( ) ∆𝑟 𝑓(𝑎)
𝑟
𝑟=0
Example: 1
Construct a polynomial for the data point (0, 5), (1, 3), (2, 3) and (3, 5).
Solution: x: 0 1 2 3
f(x): 5 3 3 5
𝑡−𝑎 𝑡−0
Here a=0; h=1; a+xh=t x= = =t
ℎ 1
Page 3 of 16
Forward Difference Table
x f(x) ∆f(x) ∆2 f(x) ∆3 f(x)
0 5
−2
1 3 2
0 0
2 3 2
2
3 5
As we know that
𝑥(𝑥 − 1) 2 𝑥 (𝑥 − 1)(𝑥 − 2) 3
𝑓(𝑎 + 𝑥ℎ) = 𝑓(𝑎) + 𝑥∆𝑓(𝑎) + ∆ 𝑓(𝑎) + ∆ 𝑓(𝑎) + ⋯
2! 3!
𝑡(𝑡−1) 𝑡(𝑡−1)(𝑡−2)
f(t)=5+t(-2)+ (2)+ (0)
2! 3!
f(t)=5-2t+𝑡 2 -t = 𝑡 2 − 3𝑡 + 5 Ans
Page 4 of 16
Example: 2 Given the data
x: 0.5 0.6 0.7 0.8
f(x)=coshx 1.127626 1.185465 1.255169 1.337425
then estimate cosh (0.56) =?
Page 5 of 16
(0.011865) (0.6)(0.6−1)(0.6−2)
f(0.56)=1.127626+(0.6)(0.057839)+(0.6)(0.6-1) + (0.000697)
2! 3!
=1.160944632 Ans
Example: 3 The amount ‘A’ of a substance remaining in the reacting system after an interval of
line ‘t’ in a certain chemical experiment is tabulated below:
t(sec): 2 5 8 11
A(gram): 94.8 87.9 81.3 75.1
Estimate the value of ‘A’ at t=3
3−2 1
Solution: Here a=2; h=3; a+xh=3; x=
3
=
3
Page 7 of 16
Forward Difference Table
x f(x) ∆ f(x) ∆2 f(x) ∆3 (x) ∆4 f(x)
1 3
11
3 14 −6
5 3
5 19 -3 0
2 3
7 21 0 0
2 3
9 23 3
5
11 28
𝑥(𝑥−1) 𝑥(𝑥−1)(𝑥−2)
As we know that 𝑓(𝑎 + 𝑥ℎ) = 𝑓(𝑎) + 𝑥∆𝑓(𝑎) + ∆2 𝑓(𝑎) + ∆3 𝑓(𝑎) + ⋯
2! 3!
11 𝑡 2 −3𝑡−𝑡+3 (𝑡 2 −3𝑡−𝑡+3)(𝑡−5)
f(t)=3+F(a + xh) = − + (−6)+ (3)
2 2!∗4 3!∗8
Page 8 of 16
11𝑡 11 9 1
f(t)=3+ − -3𝑡 2 + 3𝑡 − + [𝑡 3 − 4𝑡 2 + 23𝑡 − 15]
2 2 4 16
1 9 23 11𝑡 11 9 15
f(t)= 𝑡 3 − 𝑡2 + 𝑡 + 3𝑡 + − +3− −
16 16 16 2 2 4 16
1
By solving it we get f(t)= [𝑡 3 − 21𝑡 2 + 159𝑡 − 91] Ans.
16
Example: 5 Find a cubic polynomial which takes the following values (0,1),(1,2),(2,1),(3,10)
Solution: x: 0 1 2 3
f(x): 1 2 1 10
Here a=0, h=1; a+xh=t →x=(t-0)/1=t
Forward Difference Table
x f(x) ∆ f(x) ∆2 f(x) ∆3 f(x)
0 1
1
1 2 −2
-1 12
2 1 10
9
3 10
Page 9 of 16
𝑥(𝑥−1) 𝑥(𝑥−1)(𝑥−2)
As we know that 𝑓(𝑎 + 𝑥ℎ) = 𝑓(𝑎) + 𝑥∆𝑓(𝑎) + ∆2 𝑓(𝑎) + ∆3 𝑓(𝑎) + ⋯
2! 3!
(𝑡)(𝑡−1) (𝑡)(𝑡−1)(𝑡−2)
f(t)=1+(t)(1)+ (−2) + (12)
2! 3!
𝑡 2 −𝑡 (𝑡 2 −𝑡)(𝑡−2)
f(t)=1+t+ (-2)+ (12)
2! 3!
𝑡 3 −2𝑡 2 −𝑡 2 +2𝑡
f(t)=1+t+(𝑡 2 − 𝑡)(−1) + (12)
3!
f(t)=1+t-𝑡 2 + 𝑡 + 2𝑡 3 − 4𝑡 2 − 2𝑡 2 + 4𝑡
f(t)=2𝑡 3 − 7𝑡 2 + 6𝑡 + 1 Ans.
Example: 6 The following table gives the values of density of saturated water for various
temperatures of standard steam
temp:t(c°) 100 150 200 250 300
density:d(g/cm) 958 917 865 799 712
Find by interpolating density where t=130℃
Page 10 of 16
Here a=100, h=50, t=130℃ a+xh=t →x=(t-a)/h
x= (130-100)/50→x=30/50 or x=3/5
Forward Difference Table
x f(x) ∆ f(x) ∆2 f(x) ∆3 f(x) ∆4 f(x)
100 958
-41
150 917 -11
-52 -3
200 865 -14 -4
-66 -7
250 799 -21
-87
300 712
As we know that
𝑥(𝑥 − 1) 2 𝑥 (𝑥 − 1)(𝑥 − 2) 3
𝑓(𝑎 + 𝑥ℎ) = 𝑓(𝑎) + 𝑥∆𝑓(𝑎) + ∆ 𝑓(𝑎) + ∆ 𝑓(𝑎) + ⋯
2! 3!
by putting the values, we get
3 3 3 3 3 3 3 3 3
3 (5) (5−1) (5) (5−1)(5−2) (5) (5−1)(5−2)(5−3)
f(130)=958+ (−41) + (−11) + (−3) + (−4)
5 2! 3! 4!
Page 11 of 16
3 3−5 3 3−5 3−10 3 3−5 3−10 3−15
123 ( ) ( ) ( ) ( )( 5 ) ( ) ( )( 5 )( 5 )
f(130)=958- + 5 5 (−11) + 5 5 (−3) + 5 5 (−4)
5 2! 3! 4!
3 −2 3 −2 −7 3 −2 −7 −12
123 (5) ( 5 ) (5) ( 5 )( 5 ) (5) ( 5 )( 5 )( 5 )
f(130)=958- + ( )
−11 + ( )
−3 + (−4)
5 2! 3! 4!
6 42 504
123 ( ) ( ) ( )
f(130)=958- + 25 (11) + 125 (−3) + 625 (4)
5 2! 3! 4!
123 6 42 504
f(130)=958- + (11) − (3 ) + (4 )
5 2!∗25 3!∗125 4!∗625
f(130)=958-24.6+1.32-0.160+0.1344
f(130)=934.6944≈935
Page 12 of 16
(−𝑥)(−𝑥−1) (−𝑥)(−𝑥−1)(−𝑥−2)
= [1+ (−𝑥 )(−∇) + (−∇)2+ ∇3 +…]𝑓(𝑎)
2! 3!
Note: Newton’s forward difference formula is used mainly to interpolate the values of
the function near the beginning of a set of tabulated values while Newton’s backward
difference formula is used to interpolate the values of the function near the end of a set
of tabulated values.
Page 14 of 16
Exercise
Q1. Find the polynomial which takes the following values.
x: 1 3 5 7 9 11
f(x): 2 15 23 27 30 32
Q2. The following table gives the values of density of saturated water for various temperatures of
standard steam
temp:t(c°) 100 150 200 250 300
density:d(g/cm) 942 907 860 739 710
Find by interpolating density where t=120℃
Q3. Find a cubic polynomial which takes the following values
(0,0),(1,1),(2,8),(3,27)
Q4.The following are data points from steam table
Temp(𝑐 0 ): 140 150 160 170 180
𝑁
Presssure ( ): 3.685 4.804 6.302 8.067 10.225
𝑚3
Page 16 of 16