![]() |
VOOZH | about |
Lagrange Interpolation is a way of finding the value of any function at any given point when the function is not given. We use other points on the function to get the value of the function at any required point.
Suppose we have a function y = f(x) in which substituting the values of x gives different values of y. We are given two points (x1, y1) and (x2, y2) on the curve then the value of y at x = a(constant) is calculated using the Lagrange Interpolation Formula.
Read More:Lagranges Interpolation
Given few real values x1, x2, x3, ..., xn and y1, y2, y3, ..., yn and there will be a polynomial P with real coefficients satisfying the conditions P(xi) = yi, ∀ i = {1, 2, 3, ..., n} and degree of polynomial P must be less than the count of real values i.e., degree(P) < n.
The Lagrange Interpolation formula for nth degree polynomial is given below:
Lagrange Interpolation Formula for the nth order is,
If theDegree of the polynomial is 1 then it is called the First Order Polynomial. Lagrange Interpolation Formula for 1st order polynomials is,
If the Degree of the polynomial is 2 then it is called Second Order Polynomial. Lagrange Interpolation Formula for 2nd order polynomials is,
Let's consider a nth-degree polynomial of the given form,
f(x) = A0(x - x1)(x - x2)(x - x3)...(x - xn) + A1(x - x0)(x - x2)(x - x3)...(x - xn) + ... + An(x - x0)(x - x1)(x - x3)...(x - xn-1)
Substitute observations xi to get Ai
Put x = x0 then we get A0
f(x0) = y0 = A0(x0 - x1)(x0 - x2)(x0 - x3)...(x0 - xn)
A0 = y0/(x0 - x1)(x0 - x2)(x0 - x3)...(x0 - xn)
By substituting x = x1 we get A1
f(x1) = y1 = A1(x1 - x0)(x1 - x2)(x1 - x3)...(x1 - xn)
A1 = y1/(x1 - x0)(x1 - x2)(x1 - x3)...(x1 - xn)
Similarly, by substituting x = xn we get An
f(xn) = yn = An(xn - x0)(xn - x1)(xn - x2)...(xn - xn-1)
An = yn/(xn - x0)(xn - x1)(xn - x2)...(xn - xn-1)
If we substitute all values of Ai in function f(x) where i = 1, 2, 3, ...n then we get Lagrange Interpolation Formula as,
Various properties of the Lagrange Interpolation Formula are discussed below,
Various uses of the Lagrange Interpolation Formula are discussed below,
Let's look into a few sample questions on Lagrange Interpolation Formula.
Example 1: Find the value of y at x = 2 for the given set of points (1, 2),(3, 4)
Solution:
Given,
- (x0, y0) = (1, 2)
- (x1, y1) = (3, 4)
First order Lagrange Interpolation Formula is,
At x = 2
y
y = (-2/-2) + (4/2)
y = 1 + 2 = 3The value of y at x = 2 is 3
Example 2: Find the value of y at x = 5 for the given set of points (9, 2), (3, 10)
Solution:
Given,
- (x0, y0) = (9, 2)
- (x1, y1) = (3, 10)
First order Lagrange Interpolation Formula is,
At x = 5
y = (4/6) + (-40/-6)
y = (2/3) + (20/3)
y = 22/3 = 7.33The value of y at x = 5 is 7.33
Example 3: Find the value of y at x = 1 for the given set of points (1, 6), (3, 4), (2, 5)
Solution:
Given,
- (x0, y0) = (1, 6)
- (x1, y1) = (3, 4)
- (x2, y2) = (2, 5)
Second Order Lagrange Interpolation Formula is,
At x = 1
y = (12/2) + 0 + 0
y = 6The value of y at x = 1 is 6
Example 4: Find the value of y at x = 10 for the given set of points (9, 6), (3, 5), (1, 12)
Solution:
Given,
- (x0, y0) = (9, 6)
- (x1, y1) = (3, 5)
- (x2, y2) = (1, 12)
Second Order Lagrange Interpolation Formula is,
At x = 10
y = (63/8) + (-15/4) + (21/4)
y = (63-30 + 42)/8
y = 75/8 = 9.375The value of y at x = 10 is 9.375
Example 5: Find the value of y at x = 7 for the given set of points (1, 10), (2, 4), (3, 4), (5, 7)
Solution:
Given,
- (x0, y0) = (1, 10)
- (x1, y1) = (2, 4)
- (x2, y2) = (3, 4)
- (x3, y3) = (5, 7)
Third Order Lagrange Interpolation Formula is,
At x = 7
y = -50 + 64 - 60 + 35
y = 99 - 110 = -11The value of y at x = 7 is -11
Example 6: Find the value of y at x = 10 for the given set of points (5, 12), (6, 13), (7, 14), (8, 15)
Solution:
Given,
- (x0, y0) = (5, 12)
- (x1, y1) = (6, 13)
- (x2, y2) = (7, 14)
- (x3, y3) = (8, 15)
Third Order Lagrange Interpolation Formula is,
At x = 10,
y = -48 + 195 - 280 + 150
y = 17The value of y at x = 10 is 17
Example 7: Find the value of y at x = 0 for the given set of points (-2, 5),(1, 7)
Solution:
Given,
- (x0, y0) = (-2, 5)
- (x1, y1) = (1, 7)
First Order Lagrange Interpolation Formula is,
At x = 0,
y = (5/3) + (14/3)
y = 19/3 = 6.33The value of y at x = 0 is 6.33