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

Lagranges Interpolation Formula

1. Lagrange's Interpolation Formula provides a method for determining the value of a function for intermediate values based on a set of known x-y points. 2. The formula expresses the value of the function f(x) as a linear combination of basis polynomials, with coefficients determined by the known y-values. 3. The formula is valid for both equal and unequal intervals between the x-values and can be used to find an interpolating polynomial that fits the given data points.
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)
307 views

Lagranges Interpolation Formula

1. Lagrange's Interpolation Formula provides a method for determining the value of a function for intermediate values based on a set of known x-y points. 2. The formula expresses the value of the function f(x) as a linear combination of basis polynomials, with coefficients determined by the known y-values. 3. The formula is valid for both equal and unequal intervals between the x-values and can be used to find an interpolating polynomial that fits the given data points.
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/ 5

Lagrange’s Interpolation Formula

(i) Define interpolation.


Ans: Interpolation: the method of obtaining the value of a function for any intermediate value of the
argument from the given set of values of the function for certain values of argument is known as
interpolation.
(ii) Given a set of (n+1) points , state the general form of n-th degree Lagrange’s interpolation formula.
Ans: given (𝑛 + 1) values of the function 𝑓(𝑥) for 𝑥 = 𝑥0 , 𝑥1 , 𝑥2 … … … 𝑥𝑛 namely 𝑓(𝑥0 ), 𝑓(𝑥1 ),
𝑓(𝑥2 )……… 𝑓(𝑥𝑛 ) respectively, the formula states that,
(𝑥−𝑥1 )(𝑥−𝑥2 )…………(𝑥−𝑥𝑛 ) (𝑥−𝑥0 )(𝑥−𝑥2 )(𝑥−𝑥3 )…………(𝑥−𝑥𝑛 )
𝑓(𝑥) = (𝑥 𝑓(𝑥0 ) + 𝑓(𝑥1 )
0 −𝑥1 )(𝑥0 −𝑥2 )………..(𝑥0 −𝑥𝑛 ) (𝑥1 −𝑥0 )(𝑥1 −𝑥2 )………..(𝑥1 −𝑥𝑛 )

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


+ (𝑥 𝑓(𝑥2 ) + (𝑥 𝑓(𝑥3 )
2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 )………..(𝑥2 −𝑥𝑛 ) 3 −𝑥0 )(𝑥3 −𝑥1 )(𝑥3 −𝑥2 )………..(𝑥3 −𝑥𝑛 )

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


+ ⋯ … … … … … . . + (𝑥 𝑓(𝑥𝑛 )
𝑛 −𝑥0 )(𝑥𝑛 −𝑥1 )(𝑥𝑛 −𝑥2 )………..(𝑥𝑛 −𝑥𝑛−1 )

1.State and prove Lagrange’s Interpolation formula for unequal intervals.


Statement: given (𝑛 + 1) values of the function 𝑓(𝑥) for 𝑥 = 𝑥0 , 𝑥1 , 𝑥2 … … … 𝑥𝑛 namely 𝑓(𝑥0 ), 𝑓(𝑥1 ),
𝑓(𝑥2 )……… 𝑓(𝑥𝑛 ) respectively, the formula states that,
(𝑥−𝑥1 )(𝑥−𝑥2 )…………(𝑥−𝑥𝑛 ) (𝑥−𝑥0 )(𝑥−𝑥2 )(𝑥−𝑥3 )…………(𝑥−𝑥𝑛 )
𝑓(𝑥) = (𝑥 𝑓(𝑥0 ) + 𝑓(𝑥1 )
0 −𝑥1 )(𝑥0 −𝑥2 )………..(𝑥0 −𝑥𝑛 ) (𝑥1 −𝑥0 )(𝑥1 −𝑥2 )………..(𝑥1 −𝑥𝑛 )

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


+ (𝑥 𝑓(𝑥2 ) + (𝑥 𝑓(𝑥3 )
2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 )………..(𝑥2 −𝑥𝑛 ) 3 −𝑥0 )(𝑥3 −𝑥1 )(𝑥3 −𝑥2 )………..(𝑥3 −𝑥𝑛 )

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


+ ⋯ … … … … … . . + (𝑥 𝑓(𝑥𝑛 )
𝑛 −𝑥0 )(𝑥𝑛 −𝑥1 )(𝑥𝑛 −𝑥2 )………..(𝑥𝑛 −𝑥𝑛−1 )

Proof: let the given function be 𝑦 = 𝑓(𝑥) . Given corresponding to the values 𝑥0 , 𝑥1 , 𝑥2 … … … 𝑥𝑛 of the
argument 𝑥 , the values of the function 𝑓(𝑥) be 𝑓(𝑥0 ), 𝑓(𝑥1 ), 𝑓(𝑥2 )……… 𝑓(𝑥𝑛 ) respectively, where the
intervals (𝑥1 − 𝑥0 ) , (𝑥2 − 𝑥1 ) , (𝑥3 − 𝑥2 ) ,…………… (𝑥𝑛 − 𝑥𝑛−1 ) May not be equal. Since (𝑛 + 1)
values of 𝑓(𝑥) are given, we can fit a polynomial of n-th degree,
Let 𝑓(𝑥) = 𝑎0 (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … . . (𝑥 − 𝑥𝑛 ) + 𝑎1 (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) … . . (𝑥 − 𝑥𝑛 )
+𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … . . (𝑥 − 𝑥𝑛 ) + ⋯ … . . … . . 𝑎𝑛 (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … . . (𝑥 − 𝑥𝑛−1 )
…………………….(1)
Where 𝑎𝑖 , 𝑖 = 0,1,2,3 … … . 𝑛 are constants.
To find 𝑎0 , 𝑎1 , 𝑎2 …………… 𝑎𝑛 we put 𝑥 = 𝑥0 , 𝑥1 , 𝑥2 … … … 𝑥𝑛 respectively in (1) . Now putting 𝑥 = 𝑥0
in (1) we get,
𝑓(𝑥0 ) = 𝑎0 (𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … . . (𝑥0 − 𝑥𝑛 )
𝑓(𝑥0 )
⇒ 𝑎0 = (𝑥
0 −𝑥1 )(𝑥0 −𝑥2 )…..(𝑥0 −𝑥𝑛 )
At 𝑥 = 𝑥1 we get,
𝑓(𝑥1 ) = 𝑎1 (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … . . (𝑥1 − 𝑥𝑛 )
𝑓(𝑥1 )
⇒ 𝑎1 = (𝑥
1 −𝑥0 )(𝑥1 −𝑥2 )…..(𝑥1 −𝑥𝑛 )

Again at 𝑥 = 𝑥2 we get,
𝑓(𝑥2 ) = 𝑎2 (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) … . . (𝑥2 − 𝑥𝑛 )
𝑓(𝑥2 )
⇒ 𝑎2 = (𝑥
2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 )…..(𝑥2 −𝑥𝑛 )

Similarly putting 𝑥 = 𝑥𝑛 in (1) we get,


𝑓(𝑥𝑛 ) = 𝑎𝑛 (𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 )(𝑥𝑛 − 𝑥3 ) … . . (𝑥𝑛 − 𝑥𝑛−1 )
𝑓(𝑥𝑛 )
⇒ 𝑎𝑛 = (𝑥
𝑛 −𝑥0 )(𝑥𝑛 −𝑥1 )(𝑥𝑛 −𝑥3 )…..(𝑥𝑛 −𝑥𝑛−1 )

Substituting these values 𝑎0 , 𝑎1 , 𝑎2 …………… 𝑎𝑛 in (1) we get,


(𝑥−𝑥1 )(𝑥−𝑥2 )…………(𝑥−𝑥𝑛 ) (𝑥−𝑥0 )(𝑥−𝑥2 )(𝑥−𝑥3 )…………(𝑥−𝑥𝑛 )
𝑓(𝑥) = (𝑥 𝑓(𝑥0 ) + 𝑓(𝑥1 )
0 −𝑥1 )(𝑥0 −𝑥2 )………..(𝑥0 −𝑥𝑛 ) (𝑥1 −𝑥0 )(𝑥1 −𝑥2 )………..(𝑥1 −𝑥𝑛 )

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


+ (𝑥 𝑓(𝑥2 ) + (𝑥 𝑓(𝑥3 )
2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 )………..(𝑥2 −𝑥𝑛 ) 3 −𝑥0 )(𝑥3 −𝑥1 )(𝑥3 −𝑥2 )………..(𝑥3 −𝑥𝑛 )

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


+ ⋯ … … … … … . . + (𝑥 𝑓(𝑥𝑛 )
𝑛 −𝑥0 )(𝑥𝑛 −𝑥1 )(𝑥𝑛 −𝑥2 )………..(𝑥𝑛 −𝑥𝑛−1 )

This is called Lagrange 's interpolation formula and can be used for both equal and unequal intervals.

Problem 1: Apply Lagrange 's formula to find the form of the function 𝑓(𝑥) , using the following table:
x 0 1 2 3 4
𝑓(𝑥) 3 6 11 18 27

Solution: Here 𝑥0 = 0, 𝑥1 = 1, 𝑥2 = 2 , 𝑥3 = 3, 𝑥4 = 4
By the Lagrange 's interpolation formula, we have
(𝑥−𝑥1 )(𝑥−𝑥2 )(𝑥−𝑥3 )(𝑥−𝑥4 )
𝑓(𝑥) = (𝑥 𝑓(𝑥0 )
0 −𝑥1 )(𝑥0 −𝑥2 )(𝑥0 −𝑥3 )(𝑥0 −𝑥4 )

(𝑥−𝑥0 )(𝑥−𝑥2 )(𝑥−𝑥3 )(𝑥−𝑥4 )


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

(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥3 )(𝑥−𝑥4 )


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

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


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

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


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

(𝑥−0)(𝑥−1)(𝑥−2)(𝑥−4) (𝑥−0)(𝑥−1)(𝑥−2)(𝑥−3)
+ (3)(2)(1)(−1)
× 18 + (4)(3)(2)(1)
× 27

(𝑥−1)(𝑥−2)(𝑥−3)(𝑥−4) 𝑥(𝑥−2)(𝑥−3)(𝑥−4) 11𝑥(𝑥−1)(𝑥−3)(𝑥−4)


⇒ 𝑓(𝑥) = − +
8 1 4

3𝑥(𝑥−1)(𝑥−2)(𝑥−4) 9𝑥(𝑥−1)(𝑥−2)(𝑥−3)
− +
1 8

(𝑥−1) 11(𝑥−3)(𝑥−4) 3(𝑥−2)(𝑥−4) 9(𝑥−2)(𝑥−3)


⇒ 𝑓(𝑥) = (𝑥 − 2)(𝑥 − 3)(𝑥 − 4) { − 𝑥} + 𝑥(𝑥 − 1) { − + }
8 4 1 8

𝑥−1−8𝑥 22(𝑥−3)(𝑥−4)−24(𝑥−2)(𝑥−4)+9(𝑥−2)(𝑣−3)
⇒ 𝑓(𝑥) = (𝑥 2 − 5𝑥 + 6)(𝑥 − 4) { } + 𝑥(𝑥 − 1) { }
8 8

1 1
⇒ 𝑓(𝑥) = 8 (𝑥 2 − 5𝑥 + 6)(𝑥 − 4)(−7𝑥 − 1) + 8 (𝑥 2 − 𝑥)(22𝑥 2 − 66𝑥 − 88𝑥 + 264 − 24𝑥 2 + 48𝑥 +
96𝑥 − 192 + 9𝑥 2 − 18𝑥 − 27𝑥 + 54)
1 1
⇒ 𝑓(𝑥) = 8 (𝑥 3 − 5𝑥 2 + 6𝑥 − 4𝑥 2 + 20𝑥 − 24)(−7𝑥 − 1) + 8 (𝑥 2 − 𝑥)(7𝑥 2 − 55𝑥 + 126)
1 1
⇒ 𝑓(𝑥) = 8 (−7𝑥 4 + 63𝑥 3 − 182𝑥 2 + 168𝑥 − 𝑥 3 + 9𝑥 2 − 26𝑥 + 24) + 8 (7𝑥 4 − 7𝑥 3 − 55𝑥 3 + 55𝑥 2 +
126𝑥 2 − 126𝑥)
1
⇒ 𝑓(𝑥) = 8 (−7𝑥 4 + 7𝑥 4 + 63𝑥 3 − 63𝑥 3 + 190𝑥 2 − 182𝑥 2 + 168𝑥 − 152𝑥 + 24)
1
⇒ 𝑓(𝑥) = 8 (8𝑥 2 + 16𝑥 + 24)

⇒ 𝑓(𝑥) = 𝑥 2 + 2𝑥 + 3
Which is the required function.

Problem 2: Estimate √(155) using Lagrange 's interpolation formula from the table given below:

x 150 152 154 156


𝑦 = √𝑥 12.247 12.329 12.410 12.490

Solution: Here we have, 𝑥 = 155 , 𝑥0 = 150 , 𝑥1 = 152 , 𝑥2 = 154 , 𝑥3 = 156


And 𝑦0 = 12.247 , 𝑦1 = 12.329 , 𝑦2 = 12.410 , 𝑦3 = 12.410
Here we get,
𝑥 − 𝑥𝑜 = 155 − 150 = 5 𝑥 − 𝑥1 = 155 − 152 = 3 𝑥 − 𝑥2 = 155 − 154 = 1 𝑥 − 𝑥3 = 155 − 156 = −1

𝑥1 − 𝑥𝑜 = 152 − 150 = 2 𝑥0 − 𝑥1 = 150 − 152 = −2 𝑥0 − 𝑥2 = 150 − 154 = −4 𝑥0 − 𝑥3 = 150 − 156 = −6


𝑥2 − 𝑥𝑜 = 154 − 150 = 4 𝑥2 − 𝑥1 = 154 − 152 = 2 𝑥1 − 𝑥2 = 152 − 154 = −2 𝑥1 − 𝑥3 = 152 − 156 = −4

𝑥3 − 𝑥𝑜 = 156 − 150 = 6 𝑥3 − 𝑥1 = 156 − 152 = 4 𝑥3 − 𝑥2 = 156 − 154 = 2 𝑥2 − 𝑥3 = 154 − 156 = −2

We know the Lagrange’s Interpolation formula is


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

(3)(1)(−1) (5)(1)(−1) (5)(3)(−1) (5)(3)(1)


⇒ 𝑦(𝑥) = (−2)(−4)(−6) × 12.247 + (2)(−2)(−4) × 12.329 + (4)(2)(−2) × 12.410 + (6)(4)(2) × 12.490

⇒ 𝑦(𝑥) = 12.45
(Ans:)

Problem 3: Using Lagrange 's Interpolation formula find the form of the function 𝑦 = 𝑓(𝑥) , from the
following table:
x 0 1 3 4
𝑦 = 𝑓(𝑥) -12 0 12 24

Solution: Here we have, 𝑥0 = 0 , 𝑥1 = 1 , 𝑥2 = 3 , 𝑥3 = 4


And 𝑦0 = −12 , 𝑦1 = 0 , 𝑦2 = 12, 𝑦3 = 24
Here we get,
𝑥 − 𝑥𝑜 = 𝑥 𝑥 − 𝑥1 = 𝑥 − 1 𝑥 − 𝑥2 = 𝑥 − 3 𝑥 − 𝑥3 = 𝑥 − 4

𝑥1 − 𝑥𝑜 = 1 𝑥0 − 𝑥1 = −1 𝑥0 − 𝑥2 = −3 𝑥0 − 𝑥3 = −4

𝑥2 − 𝑥𝑜 = 3 𝑥2 − 𝑥1 = 2 𝑥1 − 𝑥2 = −2 𝑥1 − 𝑥3 = −3

𝑥3 − 𝑥𝑜 = 4 𝑥3 − 𝑥1 = 3 𝑥3 − 𝑥2 = 1 𝑥2 − 𝑥3 = −1

We know the Lagrange’s Interpolation formula is


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

(𝑥−1)(𝑥−3)(𝑥−4) 𝑥(𝑥−3)(𝑥−4) 𝑥(𝑥−1)(𝑥−4) 𝑥(𝑥−1)(𝑥−3)


⇒ 𝑦(𝑥) = (−12) + ( × (0) + (12) + (24)
(−1)(−3)(−4) 1)(−2)(−3) (3)(2)(−1) (4)(3)(2)

(𝑥 3 −8𝑥 2 +19𝑥−12) (𝑥 3 −5𝑥 2 +4𝑥) (𝑥 3 −4𝑥 2 +3𝑥)


⇒ 𝑦(𝑥) = (12) + 0 − (12) + (24)
12 6 12

⇒ 𝑦(𝑥) = 𝑥 3 − 8𝑥 2 + 19𝑥 − 12 − 2𝑥 3 + 10𝑥 2 − 8𝑥 + 2𝑥 3 − 8𝑥 2 + 6𝑥


⇒ 𝑦(𝑥) = 𝑥 3 − 6𝑥 2 + 17𝑥 − 12

Problem 4: Using Lagrange 's Interpolation formula find the value of 𝑓(10) , from the following table:
x 5 6 9 11
𝑓(𝑥) 12 13 14 16

You might also like