0% found this document useful (0 votes)
29 views

Interpolation

Interpolation

Uploaded by

rajmaiti00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Interpolation

Interpolation

Uploaded by

rajmaiti00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

INTERPOLATION FORMULAS

Consider the following example

𝑥 1 2 3 4 5 6
𝑓(𝑥) 3 10 29 66 127 218

Calculate

 𝑓 (1.5), 𝑓 (2.1), 𝑓(0.9)


 𝑓 (5.7), 𝑓(6.1)

Here we are given an equispaced set of data hence we should construct the
difference table

𝑥 𝑓(𝑥) ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦

1 3 7 12 6 0 0

2 10 19 18 6 0

3 29 37 24 6

4 66 61 30

5 127 91

6 218

BACKWARD PORTION

FORWARD PORTION
 To find the value of 𝑓(𝑥) for any 𝑥 lying in the FORWARD portion of the
table we will make use of NEWTONS FORWARD FORMULA.
 To find the value of 𝑓(𝑥) for any 𝑥 lying in the BACKWARD portion of the
table we will make use of NEWTONS BACKWARD FORMULA.
 If any point lies outside the range of given set of data then also we select the
formula based on the approximate location of the point. Then this process
will be known as EXTRAPOLATION.

CASE-1: To find 𝑓 (1.5)

Here we need to find the value of 𝑓 (𝑥 )𝑓𝑜𝑟 𝑥 = 1.5. Now 𝑥 = 1.5 lies
between 𝑥 = 1 & 𝑥 = 2 or in the forward portion of the table so we select
NEWTONS FORWARD FORMULA.

NEWTONS FORWARD FORMULA


TYPE-1
(𝑥−𝑥0 ) (𝑥−𝑥0 )(𝑥−𝑥1 ) (𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥2 )
𝑦 = 𝑦0 + ∆𝑦0 + ∆2𝑦0 + ∆3 𝑦0 + ⋯ …
ℎ 2!ℎ2 3!ℎ3

This form is selected for evaluating the functional relation between 𝑥 & 𝑦.

TYPE-2
𝑢(𝑢−1) 𝑢(𝑢−1)(𝑢−2)
𝑦 = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0 + ∆3𝑦0 + ⋯ …
2! 3!

𝑥−𝑥0
Where 𝑢 = and 𝑥 =

𝑡ℎ𝑒 𝑔𝑖𝑣𝑒𝑛 𝑝𝑜𝑖𝑛𝑡 𝑎𝑡 𝑤ℎ𝑖𝑐ℎ 𝑣𝑎𝑙𝑢𝑒 𝑖𝑠 𝑡𝑜 𝑏𝑒 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑒𝑑
𝑥0 < 𝑥 𝑜𝑟 𝑥0 𝑖𝑠 𝑛𝑒𝑎𝑟𝑒𝑠𝑡 𝑡𝑜 𝑥 𝑜𝑟 𝑏𝑜𝑡ℎ 𝑎𝑛𝑑 ℎ = 𝑠𝑡𝑒𝑝 𝑙𝑒𝑛𝑔𝑡ℎ
This form is selected for evaluating the functional values.
Here we will use this form for finding 𝑓 (1.5). Here 𝑥 = 1.5 → 𝑥0 =
𝑥−𝑥0
1, ℎ = 1 hence we get 𝑢 = = 0.5.

NOTE: In interpolation in forward formula the value of u is +ve.

Now we look into the difference table for finding 𝑦0 , ∆𝑦0 , ∆2 𝑦0 , ∆3 𝑦0 . Here
𝑥0 is the first element in the column of x so we select all the first elements of
the successive columns and they will be
𝑦0 = 3, ∆𝑦0 = 7, ∆2𝑦0 = 12, ∆3𝑦0 = 6
Hence using all the values in the formula and simplifying we get,
(0.5)(0.5 − 1) (0.5)(0.5 − 1)(0.5 − 2)
𝑦 = 3 + (0.5) × 7 + × 12 + ×6
2 6
𝑦 = 3 + 3.5 − 1.5 + 0.375 = 5.375
Hence 𝑓(1.5) = 5.375

Here ∆4𝑦0 and other higher orders are zero so we consider the formula up to ∆3 𝑦0

CASE-2: To find 𝑓 (2.1)

Here we need to find the value of 𝑓(𝑥 )𝑓𝑜𝑟 𝑥 = 2.1. Now 𝑥 = 2.1 lies
between 𝑥 = 2 & 𝑥 = 3 or in the forward portion of the table so we select
NEWTONS FORWARD FORMULA.

𝑢(𝑢−1) 𝑢(𝑢−1)(𝑢−2)
𝑦 = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0 + ∆3𝑦0 + ⋯ …
2! 3!
𝑥−𝑥0
Where 𝑢 = and 𝑥 =

𝑡ℎ𝑒 𝑔𝑖𝑣𝑒𝑛 𝑝𝑜𝑖𝑛𝑡 𝑎𝑡 𝑤ℎ𝑖𝑐ℎ 𝑣𝑎𝑙𝑢𝑒 𝑖𝑠 𝑡𝑜 𝑏𝑒 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑒𝑑
𝑥0 < 𝑥 𝑜𝑟 𝑥0 𝑖𝑠 𝑛𝑒𝑎𝑟𝑒𝑠𝑡 𝑡𝑜 𝑥 𝑜𝑟 𝑏𝑜𝑡ℎ 𝑎𝑛𝑑 ℎ = 𝑠𝑡𝑒𝑝 𝑙𝑒𝑛𝑔𝑡ℎ

𝑥−𝑥0
Here 𝑥 = 2.1 → 𝑥0 = 2, ℎ = 1 hence we get 𝑢 = = 0.1

Here 𝑥0 is the second element in the column of x so we select all the second
elements of the successive columns and they will be
𝑦0 = 10, ∆𝑦0 = 19, ∆2𝑦0 = 18, ∆3𝑦0 = 6
Hence using all the values in the formula and simplifying we get,
(0.1)(0.1 − 1) (0.1)(0.1 − 1)(0.1 − 2)
𝑦 = 10 + (0.1) × 7 + × 12 + ×6
2 6
𝑦 = 10 + 0.7 − 0.54 + 0.171 = 10.331

Hence 𝑓(2.1) = 10.331

CASE-3: To find 𝑓 (0.9)

This is the problem of EXTRAPOLATION. But here the point 𝑥 = 0.9 lies
in the FORWARD part of the table and so we will make use of NEWTONS
FORWARD FORMULA.

𝑥−𝑥0
Here 𝑥 = 0.9 , 𝑥0 = 1, ℎ = 1 hence we get 𝑢 = = −0.1

Here 𝑥0 is the first element in the column of x so we select all the first
elements of the successive columns and they will be
𝑦0 = 3, ∆𝑦0 = 7, ∆2𝑦0 = 12, ∆3𝑦0 = 6

NOTE: In extrapolation in Newton’s forward formula the value of u is –ve.

Hence using all the values in the formula and simplifying we get,
(−0.1)(−0.1−1) (−0.1)(−0.1−1)(−0.1−2)
𝑦 = 3 + (−0.1) × 7 + × 12 + ×6
2 6
𝑦 = 3 − 0.7 + 0.66 − 0.231 = 2.729
Hence 𝑓(0.9) = 2.729

CASE-4: To find 𝑓 (5.7)

Here we need to find the value of 𝑓(𝑥 )𝑓𝑜𝑟 𝑥 = 5.7. Now 𝑥 = 5.7 lies
between 𝑥 = 5 & 𝑥 = 6 or in the backward portion of the table so we select
NEWTONS BACKWARD FORMULA.
NEWTONS BACKWARD FORMULA
TYPE-1

(𝑥−𝑥𝑛 ) (𝑥−𝑥0 )(𝑥−𝑥1 ) (𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥2 )


𝑦 = 𝑦𝑛 + ∇𝑦𝑛 + ∇2 𝑦𝑛 + ∇3𝑦𝑛 + ⋯ …
ℎ 2!ℎ2 3!ℎ3

This form is selected for evaluating the functional relation between 𝑥 & 𝑦.

TYPE-2

𝑢(𝑢+1) 𝑢(𝑢+1)(𝑢+2)
𝑦 = 𝑦𝑛 + 𝑢∇𝑦𝑛 + ∇2𝑦𝑛 + ∇3𝑦𝑛 + ⋯ …
2! 3!
𝑥−𝑥𝑛
Where 𝑢 = and 𝑥 =

𝑡ℎ𝑒 𝑔𝑖𝑣𝑒𝑛 𝑝𝑜𝑖𝑛𝑡 𝑎𝑡 𝑤ℎ𝑖𝑐ℎ 𝑣𝑎𝑙𝑢𝑒 𝑖𝑠 𝑡𝑜 𝑏𝑒 𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑒𝑑
𝑥𝑛 > 𝑥 𝑜𝑟 𝑥𝑛 𝑖𝑠 𝑛𝑒𝑎𝑟𝑒𝑠𝑡 𝑡𝑜 𝑥 𝑜𝑟 𝑏𝑜𝑡ℎ 𝑎𝑛𝑑 ℎ = 𝑠𝑡𝑒𝑝 𝑙𝑒𝑛𝑔𝑡ℎ
This form is selected for evaluating the functional values.

𝑥−𝑥𝑛
Here 𝑥 = 5.7 → 𝑥𝑛 = 6, ℎ = 1 hence we get 𝑢 = = −0.3.

NOTE: In interpolation in forward formula the value of u is -ve.

Now we look into the difference table for finding 𝑦𝑛 , ∇𝑦𝑛 , ∇2𝑦𝑛 , ∇3 𝑦𝑛 . Here
𝑥𝑛 is the last element in the column of x so we select all the last elements of
the successive columns and they will be
𝑦𝑛 = 218, ∇𝑦𝑛 = 91, ∇2𝑦𝑛 = 30, ∇3𝑦𝑛 = 6
Hence using all the values in the formula and simplifying we get,
(−0.3)(−0.3+1) (−0.3)(−0.3+1)(−0.3+2)
𝑦 = 218 + (−0.3) × 91 + × 30 + ×6
2 6
𝑦 = 218 − 27.3 − 3.15 − 0.357 = 187.193
Hence 𝑓(5.7) = 187.193
Here ∆4𝑦0 and other higher orders are zero so we consider the formula up to ∆3 𝑦0

CASE-5: To find 𝑓 (6.1)

This is the problem of EXTRAPOLATION. But here the point 𝑥 = 6.1 lies
in the BACKWARD part of the table and so we will make use of
NEWTONS BACKWARD FORMULA.

𝑥−𝑥𝑛
Here 𝑥 = 6.1 → 𝑥𝑛 = 6, ℎ = 1 hence we get 𝑢 = = 0.1

Here 𝑥𝑛 is the last element in the column of x so we select all the first
elements of the successive columns and they will be
𝑦𝑛 = 218, ∇𝑦𝑛 = 91, ∇2 𝑦𝑛 = 30, ∇3 𝑦𝑛 = 6

NOTE: In extrapolation in Newton’s forward formula the value of u is +ve.

Hence using all the values in the formula and simplifying we get,
(0.1)(0.1 + 1) (0.1)(0.1 + 1)(0.1 + 2)
𝑦 = 218 + (0.1) × 91 + × 30 +
2 6
×6
𝑦 = 218 + 9.1 + 1.65 + 0.231 = 228.981

Hence 𝑓(6.1) = 228.981

CASE-6: To find 𝑓 (𝑥 )

Here we can select the first type of either FORWARD or BACKWARD


formula. Let us take the FORWARD formula,

(𝑥−𝑥0 ) (𝑥−𝑥0 )(𝑥−𝑥1 ) (𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥2 )


𝑦 = 𝑦0 + ∆𝑦0 + ∆2𝑦0 + ∆3 𝑦0
ℎ 2!ℎ2 3!ℎ3

Now 𝑥0 = 1 , 𝑦0 = 3 , ∆𝑦0 = 7, ∆2 𝑦0 = 12, ∆3 𝑦0 = 6, ℎ = 1


Here ∆4𝑦0 and other higher orders are zero so we consider the formula up to ∆3 𝑦0

Now putting all the data into the formula we get

(𝑥 − 1) (𝑥 − 1)(𝑥 − 2) (𝑥 − 1)(𝑥 − 2)(𝑥 − 3)


𝑦=3+ ×7+ × 12 + ×6
1 2 6
𝑦 = 3 + 7(𝑥 − 1) + 6(𝑥 2 − 3𝑥 + 2) + (𝑥 3 − 3𝑥 2 + 2𝑥 − 3𝑥 2 − 9𝑥 − 6)

𝑦 = 3 + 7𝑥 − 7 + 6𝑥 2 − 18𝑥 + 12 + 𝑥 3 − 3𝑥 2 + 2𝑥 − 3𝑥 2 + 9𝑥 − 6

𝑦 = 𝑥3 + 2

This function exactly satisfies the given set of data

𝑥 1 2 3 4 5 6
𝑓(𝑥) 3 10 29 66 127 218

Ex-2) Calculate the value of tan(0.12) from the given set of data.

𝑥 0.10 0.15 0.20 0.25 0.30


𝑡𝑎𝑛(𝑥) 0.1003 0.1511 0.2027 0.2553 0.3093

The valued of 𝑥 are equispaced and we need to calculate the value for 𝑥 = 0.12 so
we will construct the difference table and apply the NEWONS FORWARD
FORMULA.

𝑥 𝑓(𝑥) ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦

0.10 0.1003 0.0508 0.0008 0.0002 0.0002

0.15 0.1511 0.0516 0.0010 0.0004

0.20 0.2027 0.0526 0.0014

0.25 0.2553 0.0540

0.30 0.3093
𝑢(𝑢−1) 𝑢(𝑢−1)(𝑢−2) 𝑢(𝑢−1)(𝑢−2)(𝑢−3)
𝑦 = 𝑦0 + 𝑢∆𝑦0 + ∆2 𝑦0 + ∆3𝑦0 + ∆4𝑦0
2! 3! 4!
Here we will use this form for finding 𝑓 (0.12). Here 𝑥 = 0.12 → 𝑥0 =
𝑥−𝑥0
0.10, ℎ = 0.05 hence we get 𝑢 = = 0.4.

NOTE: In interpolation in forward formula the value of u is +ve.

Now we look into the difference table for finding 𝑦0 , ∆𝑦0 , ∆2 𝑦0 , ∆3 𝑦0 , ∆4𝑦0 .
Here 𝑥0 is the first element in the column of x so we select all the first
elements of the successive columns and they will be
𝑦0 = 0.1003, ∆𝑦0 = 0.0508, ∆2 𝑦0 = 0.0008, ∆3 𝑦0 =
0.0002, ∆4𝑦0 = 0.0002
Hence using all the values in the formula and simplifying we get,
(0.4)(0.4 − 1)
𝑦 = 0.1003 + (0.4) × 0.0508 + × 0.0008
2
(0.4)(0.4 − 1)(0.4 − 2)
+ × 0.0002
6
(0.4)(0.4 − 1)(0.4 − 2)(0.4 − 3)
+ × 0.0002
24
𝑦 = 0.120529 = 0.1205
Hence 𝑓(0.12) = 0.1205

Here ∆5𝑦0 and other higher orders are absent so we consider the formula up to
∆4𝑦0

Ex-3) Calculate the value of 𝑙𝑜𝑔2.91 from the given set of data.

𝑥 2.0 2.2 2.4 2.6 2.8 3.0


𝑙𝑜𝑔(𝑥) 0.30103 0.34242 0.38021 0.41497 0.44716 0.47721

The valued of 𝑥 are equispaced and we need to calculate the value for 𝑥 = 2.91 so
we will construct the difference table and apply the NEWONS BACKWARD
FORMULA.
𝑥 𝑓(𝑥) ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦

2.0 0.30103 0.04139 −0.0036 0.0006 −0.0002

2.2 0.34242 0.03779 −0.0030 0.0004 0.0001

2.4 0.38021 0.03476 −0.0026 0.0005 THIS


DIFFERENCES
2.6 0.41497 0.03219 −0.0021 ARE NOT TO
BE TAKEN AS
2.8 0.44716 0.03005 IT IS
IRREGULAR
3.0 0.47721

𝑢(𝑢+1) 𝑢(𝑢+1)(𝑢+2)
𝑦 = 𝑦𝑛 + 𝑢∇𝑦𝑛 + ∇2𝑦𝑛 + ∇3𝑦𝑛
2! 3!

𝑥−𝑥𝑛
Here 𝑥 = 2.91 → 𝑥𝑛 = 3, ℎ = 0.2 hence we get 𝑢 = = −0.45.

NOTE: In interpolation in forward formula the value of u is -ve.

Now we look into the difference table for finding 𝑦𝑛 , ∇𝑦𝑛 , ∇2𝑦𝑛 , ∇3 𝑦𝑛 . Here
𝑥𝑛 is the last element in the column of x so we select all the last elements of
the successive columns and they will be
𝑦𝑛 = 0.47721, ∇𝑦𝑛 = 0.03005, ∇2𝑦𝑛 = −0.0021, ∇3𝑦𝑛 = 0.0005
Hence using all the values in the formula and simplifying we get,
(−0.45)(−0.45+1)
𝑦 = 0.47721 + (−0.45) × 0.03005 − × 0.0021 +
2
(−0.45)(−0.45+1)(−0.45+2)
× 0.0005
6
𝑦 = 0.45907 𝑂𝑅 log(2.91) = 0.45907
Hence 𝑓(5.7) = 187.193
INTERPOLATION FORMULAS FOR NON EQUISPACED POINTS

Let us consider a given set of data

𝑥 𝑥0 𝑥1 𝑥2 𝑥3 𝑥4
𝑦 𝑦0 𝑦1 𝑦2 𝑦3 𝑦4

Here the difference between the values of the variable 𝑥 are not equal. Hence here
for finding the value of 𝑦 for any given 𝑥 = 𝑎 we cannot use the NEWTON’S
FORWARD or NEWTON’S BACKWARD formula. Then there exists two other
formulas which are applicable for these data types, they are

 𝐿𝐴𝐺𝑅𝐴𝑁𝐺𝐸𝑆 𝐼𝑁𝑇𝐸𝑅𝑃𝑂𝐿𝐴𝑇𝐼𝑂𝑁 𝐹𝑂𝑅𝑀𝑈𝐿𝐴


 𝑁𝐸𝑊𝑇𝑂𝑁 ′ 𝑆𝐷𝐼𝑉𝐼𝐷𝐸𝐷 𝐷𝐼𝐹𝐹𝐸𝑅𝐸𝑁𝐶𝐸 𝐼𝑁𝑇𝐸𝑅𝑃𝑂𝐿𝐴𝑇𝐼𝑂𝑁 𝐹𝑂𝑅𝑀𝑈𝐿𝐴.

LAGRANGE’S INTERPOLATION FORMULA

The Lagrange’s formula for the above set of data is defined as


(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 )
𝑓 (𝑥 ) = 𝑦
(𝑥0 − 𝑥1)(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 )(𝑥0 − 𝑥4 ) 0
(𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 )
+ 𝑦
(𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 )(𝑥1 − 𝑥4 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 )
+ 𝑦
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 )(𝑥2 − 𝑥4 ) 2
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥4 )
+ 𝑦
(𝑥3 − 𝑥0 )(𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 )(𝑥3 − 𝑥4 ) 3
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
+ 𝑦
(𝑥4 − 𝑥0 )(𝑥4 − 𝑥1 )(𝑥4 − 𝑥2 )(𝑥4 − 𝑥3 ) 4

 The number of terms in the formula is equal to the number of data


points given.
 If 𝑥0 is first term then omitting 𝑥0 we can form four factors as
(𝑥 − 𝑥1)(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 ) which forms the numerator.
 Now in the numerator replace 𝑥 𝑏𝑦 𝑥0 then we get again four factors
as (𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 )(𝑥0 − 𝑥4 ) which form the
denominator of first term.
 Now multiply it by the value of y corresponding to the omitted value
of x i.e. 𝑦0 .
 Similarly 2nd term is written by omitting 𝑥1 in same manner we can
form four factors as (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 ) which forms
the numerator.
 Now in the numerator replace 𝑥 𝑏𝑦 𝑥1 then we get again four factors
as (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 )(𝑥1 − 𝑥4 ) which form the
denominator of second term.
 The value of 𝑦 corresponding to the omitted value of 𝑥 will be
multiplied with the ratio formed.
Ex-1)
Find the function 𝑦 = 𝑓(𝑥) and hence the value of 𝑓(1.1) from the
given data
𝑥 0 1 3
𝑦 0 3 1

Here if we look into the values of x they are not equidistant so we


make use of lagrangian formula.
Let 𝑥0 = 0, 𝑦0 = 0 ∶ 𝑥1 = 1𝑦1 = 3 ; 𝑥2 = 3 𝑦2 = 1
Now since three points are given our formula will be of three terms as

(𝑥−𝑥1 )(𝑥−𝑥2 ) (𝑥−𝑥0 )(𝑥−𝑥2 ) (𝑥−𝑥0 )(𝑥−𝑥1 )


𝑓 (𝑥 ) = (𝑥 𝑦
) 0+ (𝑥
𝑦 + (𝑥
) 1
𝑦2
0 −𝑥1 )(𝑥0 −𝑥2 1 −𝑥0 )(𝑥1 −𝑥2 2 −𝑥0 )(𝑥2 −𝑥1 )

Now putting the values of x and y we get,


(𝑥 − 1)(𝑥 − 3) (𝑥 − 0)(𝑥 − 3) (𝑥 − 0)(𝑥 − 1)
𝑓 (𝑥 ) = ×0+ ×3+ ×1
(0 − 1)(0 − 3) (1 − 0)(1 − 3) (3 − 0)(3 − 1)
4 13
This gives on simplification 𝑓(𝑥 ) = − 𝑥 2 + 𝑥
3 3
Now for 𝑓(1.1) we put 𝑥 = 1.1 in the above function and get 𝑓 (1.1) =
3.153
Ex-2) Find the value of 𝑦(10) from the given set of data.

𝑥 5 6 9 11

𝑦 12 13 14 16

Here if we look into the values of x they are not equidistant so we make use of
lagrangian formula.
Let
𝑥0 = 5, 𝑦0 = 12 ; 𝑥1 = 6, 𝑦1 = 13 ; 𝑥2 = 9, 𝑦2 = 14 ; 𝑥3 = 11, 𝑦3 = 16

Now since four points are given our formula will be of four terms as

(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )


𝑓 (𝑥 ) = 𝑦0 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1)(𝑥 − 𝑥2 )
+ 𝑦2 + 𝑦
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1)(𝑥2 − 𝑥3 ) (𝑥3 − 𝑥0 )(𝑥3 − 𝑥1)(𝑥3 − 𝑥2 ) 3

(10−6)(10−9)(10−11) (10−5)(10−9)(10−11)
𝑓 (10) = (5−6)(5−9)(5−11)
× 12 +
(6−5)(6−9)(6−11)
× 13 +
(10−5)(10−6)(10−11) (10−5)(10−6)(10−9)
(9−5)(9−6)(9−11)
× 14 + (11−5)(11−6)(11−9) × 16

Hence we get 𝑓 (10) = 14.6667


CONCEPT OF DIVIDED DIFFERENCE
Let us consider a given set of data

𝑥 𝑥0 𝑥1 𝑥2 𝑥3 𝑥4
𝑦 𝑦0 𝑦1 𝑦2 𝑦3 𝑦4

 1st order divided difference is defined with two points like (𝑥0 , 𝑥1 )
𝒚 −𝒚 𝒚 −𝒚
As 𝒇(𝒙𝟎 , 𝒙𝟏 ) = 𝟎 𝟏 similarly for (𝑥1 , 𝑥2 ) we have (𝒙𝟏 , 𝒙𝟐 ) = 𝟏 𝟐 .
𝒙𝟎 −𝒙𝟏 𝒙𝟏 −𝒙𝟐

 2ND order divided difference involve three points like (𝑥0 , 𝑥1 , 𝑥2 ) and is
𝒇(𝒙𝟎 ,𝒙𝟏 )−𝒇(𝒙𝟏 ,𝒙𝟐 )
defined as 𝒇(𝒙𝟎 , 𝒙𝟏 , 𝒙𝟐 ) = where 𝑓 (𝑥0 , 𝑥1 ) & 𝑓 (𝑥1 , 𝑥2 ) are
𝒙𝟎 −𝒙𝟐
calculated by 1ST order divided difference. Similarly for another three points
say (𝑥1 , 𝑥2 , 𝑥3 ) we can calculate another 2ND order difference as
𝒇(𝒙𝟏 ,𝒙𝟐 )−𝒇(𝒙𝟐 ,𝒙𝟑 )
𝒇(𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 ) = where 𝑓 (𝑥1 , 𝑥2 ) & 𝑓(𝑥2 , 𝑥3 ) are calculated by
𝒙𝟏 −𝒙𝟑
1ST order divided difference.

 3RD order divided difference involves four points and is defined as


𝒇(𝒙𝟎 ,𝒙𝟏 ,𝒙𝟐 )−𝒇(𝒙𝟏 ,𝒙𝟐 ,𝒙𝟑 )
𝒇(𝒙𝟎 , 𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 ) =
𝒙𝟎 −𝒙𝟑

 4th order divided difference can be calculated as, involving five points
𝒇(𝒙𝟎 ,𝒙𝟏 ,𝒙𝟐 ,𝒙𝟑 )−𝒇(𝒙𝟏 ,𝒙𝟐 ,𝒙𝟑 ,𝒙𝟒 )
𝒇(𝒙𝟎 , 𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 , 𝒙𝟒 ) =
𝒙𝟎 −𝒙𝟒

 Since no more points are given we cannot calculate other higher divided
difference.

 These calculated differences can be displayed in a table as


𝑥 𝑓(𝑥) 1st 2nd 3rd 4th

𝑥0 𝑦0

𝑓(𝑥0 , 𝑥1)

𝑥1 𝑦1 𝑓(𝑥0 , 𝑥1 , 𝑥2 )

𝑓(𝑥1 , 𝑥2 ) 𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )

𝑥2 𝑦2 𝑓(𝑥1 , 𝑥2 , 𝑥3 ) 𝑓(𝑥0 , 𝑥1, 𝑥2 , 𝑥3 , 𝑥4 )

𝑓(𝑥2 , 𝑥3 ) 𝑓(𝑥1, 𝑥2 , 𝑥3 , 𝑥4 )

𝑥3 𝑦3 𝑓(𝑥2 , 𝑥3 , 𝑥4 )

𝑓(𝑥3 , 𝑥4 )

𝑥4 𝑦4

DIVIDED DIFFERENCE INTERPOLATION FORMULA

𝑓 (𝑥 ) = 𝑦0 + (𝑥 − 𝑥0 )𝑓(𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓 (𝑥0 , 𝑥1, 𝑥2 ) + (𝑥 − 𝑥0 )(𝑥 −


𝑥1 )(𝑥 − 𝑥2 )𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 −
𝑥3 )𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 )

Where x is the value given at which y is to be evaluated.


Ex-3)

From the given set of data find 𝑓(10)

𝑥 4 7 9 12
𝑦 −43 83 327 1053

Here

𝑥0 = 4, 𝑦0 = −43 ; 𝑥1 = 7, 𝑦1 = 83 ; 𝑥2 = 9, 𝑦2 = 327 ; 𝑥3 = 12, 𝑦3 = 1053

Now calculating the divided difference of 1st order


𝑦0 −𝑦1 𝑦1 −𝑦2
𝑓 (𝑥0 , 𝑥1) = = 42 ; 𝑓(𝑥1 , 𝑥2 ) = = 122 ;
𝑥0 −𝑥1 𝑥1 −𝑥2

𝑦2 −𝑦3
𝑓 (𝑥2 , 𝑥3 ) = = 242
𝑥2 −𝑥3

Now calculating the divided difference of 2 nd order 𝑓 (𝑥0 , 𝑥1, 𝑥2 ) =


𝑓(𝑥0 ,𝑥1 )−𝑓(𝑥1 ,𝑥2 ) 42−122
= = 16
𝑥0 −𝑥2 4−9

𝑓(𝑥1 ,𝑥2 )−𝑓(𝑥2 ,𝑥3 )


𝑓(𝑥1, 𝑥2 , 𝑥3 ) = = 24
𝑥1 −𝑥3

Now calculating the 3rd order divided difference 𝑓 (𝑥0 , 𝑥1, 𝑥2 , 𝑥3 ) =


𝑓(𝑥0 ,𝑥1 ,𝑥2 )− 𝑓(𝑥1 ,𝑥2 ,𝑥3 )
=1
𝑥0 −𝑥3
Hence the divided difference table
𝑥 𝑓(𝑥) 𝑓(𝑥0 , 𝑥1 ) 𝑓(𝑥0 , 𝑥1 , 𝑥2 ) 𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )

𝑥0 = 4 𝑦0 = −43
𝑓 (𝑥0 , 𝑥1 ) = 42 𝑓 (𝑥0 , 𝑥1 , 𝑥2 ) = 16

𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )
𝑥1 = 7 𝑦1 = 83 𝑓(𝑥1 , 𝑥2 ) = 122 =1

𝑥2 = 9 𝑦2 = 327 𝑓 (𝑥2 , 𝑥3 ) = 242


𝑓 (𝑥1 , 𝑥2 , 𝑥3 ) = 24

𝑥3 = 12 𝑦3 = 1053

By divided difference interpolation formula, taking 𝑥 = 10 we get,

𝑓(𝑥 ) = 𝑦0 + (𝑥 − 𝑥0 )𝑓 (𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓 (𝑥0 , 𝑥1, 𝑥2 )


+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1)(𝑥 − 𝑥2 )𝑓 (𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )

𝑓 (𝑥 ) = −43 + (10 − 4) × 42 + (10 − 4)(10 − 7) × 16


+ (10 − 4)(10 − 7)(10 − 9) × 1 = 515

Ex-4) Find the function passing through the set of points and hence find 𝑓(5)

𝑥 2 4 7 8

𝑦 3 43 778 1515
Here

𝑥0 = 2, 𝑦0 = 3 ; 𝑥1 = 4, 𝑦1 = 43 ; 𝑥2 = 7, 𝑦2 = 778 ; 𝑥3 = 8, 𝑦3 = 1515

Now calculating the divided difference of 1st order


𝑦0 −𝑦1 𝑦1 −𝑦2
𝑓 (𝑥0 , 𝑥1) = = 20 ; 𝑓(𝑥1 , 𝑥2 ) = = 245 ;
𝑥0 −𝑥1 𝑥1 −𝑥2

𝑦2 −𝑦3
𝑓 (𝑥2 , 𝑥3 ) = = 737
𝑥2 −𝑥3

Now calculating the divided difference of 2 nd order 𝑓 (𝑥0 , 𝑥1, 𝑥2 ) =


𝑓(𝑥0 ,𝑥1 )−𝑓(𝑥1 ,𝑥2 ) 20−245
= = 45
𝑥0 −𝑥2 2−7

𝑓(𝑥1 ,𝑥2 )−𝑓(𝑥2 ,𝑥3 ) 245−737


𝑓(𝑥1, 𝑥2 , 𝑥3 ) = = = 123
𝑥1 −𝑥3 4−8

Now calculating the 3rd order divided difference 𝑓 (𝑥0 , 𝑥1, 𝑥2 , 𝑥3 ) =


𝑓(𝑥0 ,𝑥1 ,𝑥2 )− 𝑓(𝑥1 ,𝑥2 ,𝑥3 ) 45−123
= = 13
𝑥0 −𝑥3 2−8

𝑥 𝑓(𝑥) 𝑓(𝑥0 , 𝑥1 ) 𝑓(𝑥0 , 𝑥1 , 𝑥2 ) 𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )

𝑥0 = 2 𝑦0 = 3
𝑓 (𝑥0 , 𝑥1 ) = 20 𝑓 (𝑥0 , 𝑥1 , 𝑥2 ) = 45

𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ) = 13
𝑥1 = 4 𝑦1 = 43 𝑓(𝑥1 , 𝑥2 ) = 245

𝑓 (𝑥2 , 𝑥3 ) = 737
𝑥2 = 7 𝑦2 = 778
𝑓 (𝑥1 , 𝑥2 , 𝑥3 ) = 123

𝑥3 = 8 𝑦3 = 1515
By divided difference interpolation formula, we get,

𝑓(𝑥 ) = 𝑦0 + (𝑥 − 𝑥0 )𝑓 (𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓 (𝑥0 , 𝑥1, 𝑥2 )


+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1)(𝑥 − 𝑥2 )𝑓 (𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )

𝑓(𝑥 ) = 3 + (𝑥 − 2) × 20 + (𝑥 − 2)(𝑥 − 4) × 45 + (𝑥 − 2)(𝑥 − 4)(𝑥 − 7) × 13

𝑓 (𝑥 ) = 13𝑥 3 − 124𝑥 2 + 400𝑥 − 405

Now for x=5 we get


𝑓 (5) = 13 × 53 − 124 × 52 + 400 × 5 − 405 = 120
ALTERNATIVE METHOD OF CALCULATING DIVIDED DIFFERENCE
Let us consider a given set of data and find the function f(x).

𝑥 0 2 3 4 7 8
𝑦 4 26 58 112 466 668

DIFFERENCE TABLE

5th 4th 3rd 2nd 1st 𝑥 𝑦 1st 2nd 3rd 4th 5th
0 4

2 11

2 26
3 7

1
4 32 1

3 58
7 2 11 0

1
8 5 54 1 0

4 112
6 4 16 0

3
5 118 1

7 466
4 21
1 202
8 668
Hence from the table we get

𝑦0 = 4 ∶ 𝑓 (𝑥0 , 𝑥1 ) = 11 ∶ 𝑓 (𝑥0 , 𝑥1, 𝑥2 ) = 7 ∶ 𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ) = 1

𝑓 (𝑥 ) = 𝑦0 + (𝑥 − 𝑥0 )𝑓 (𝑥0 , 𝑥1) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓 (𝑥0 , 𝑥1 , 𝑥2 )


+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )𝑓 (𝑥0 , 𝑥1, 𝑥2 , 𝑥3 )

𝑓 (𝑥 ) = 4 + (𝑥 − 0) × 11 + (𝑥 − 0)(𝑥 − 2) × 7 + (𝑥 − 0)(𝑥 − 2)(𝑥 − 3) × 1

𝑓 (𝑥 ) = 4 + 11𝑥 + (𝑥 2 − 2𝑥 ) × 7 + (𝑥 2 − 2𝑥 )(𝑥 − 3) × 1

𝑓(𝑥 ) = 4 + 11𝑥 + 7𝑥 2 − 14𝑥 + 𝑥 3 − 𝑥 2 + 6𝑥 = 𝑥 3 + 6𝑥 2 + 3𝑥 + 4

You might also like