Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

Lagrange Interpolation

Reviewed by:
ffImage
hightlight icon
highlight icon
highlight icon
share icon
copy icon
SearchIcon

Lagrange Interpolation Formula


We know that interpolation in numerical analysis is a method of obtaining a simple function from the provided discrete data set such that the function passes through the given data points. Interpolation is helpful in determining the data points in between the available data points. Depending upon the position of the value i.e whether the point is positioned above the midpoint or below the midpoint, we use Newton's forward interpolation and Newton's backwards interpolation methods for evenly distributed data. For uneven data points, we go for the Lagrange interpolation formula. In this article, we will learn the Lagrange interpolation formula, Lagrange interpolation and using the Lagrange formula, we will solve a few problems. Let’s start learning!


Lagrange Interpolation

The interpolation methods are always required to compute the value of any function for an intermediate value of the independent function. In other words, the interpolation method is a process of determining the unknown values that lie within the known data points. The interpolation method is mostly applied to foretell the unknown values for any geographical, or any experimental related data points such as noise level, to estimate the population in a certain year, rainfall, elevation, etc.


Lagrange Formula

We know that Newton’s forward and backward interpolation formulae are used only when the given data points are equidistant. If the values of the data points are equidistant or not at equidistant, then we use the Lagrange interpolation formula. The Lagrange formula is of importance because of its utility. The Lagrange interpolation formula can be used to determine the missing values, to construct a quadratic or polynomial equation from the given data.


Let y = f(x) be a function such that f(x) can take the value y0 (initial function), y1,......,yn corresponding to the x = x0, x1,....., xn i.e., yi = f(xi) where i = 0,1,2,....n points. Then the Lagrange equation is given by:


\[y=f(x)=\frac{(x-x_{1})(x-x_{2})........(x-x_{n})}{(x_{0}-x_{1})(x_{0}-x_{2}).....(x_{0}-x_{n})} y_{0}+\frac{(x-x_{0})(x-x_{2})......(x-x_{n})}{(x_{1}-x_{0})(x_{1}-x_{2})......(x_{1}-x_{n})} y_{1}+............+\frac{(x-x_{0})(x-x_{1})......(x-x_{(n-1)})}{(x_{n}-x_{0})(x_{n}-x_{1}).....(x_{n}-x_{n-1})}y_{n}\]........(1)


Equation (1) is known as the Lagrange formula or Lagrange interpolation formula. This interpolation method can be used for evenly distributed and for uneven distribution of data points. Sometimes it is even known as Lagrange’s interpolation formula for unequal intervals. Let us understand Lagrange interpolation formula solved examples. 


Examples

1. Determine the value of  y at x = 0 given some set of values  (-2,5), (1,7), (3,11), (11,34)?

Sol:

Given,

We have a set of data points given by,


x

x0=-2

x1=1

x2=3

x3=11

y= f(x)

5

7

11

34


We are asked to determine the value of yat x=0using the Lagrange interpolation method. So, we know that the Lagrange interpolation formula is given by:


\[y=f(x)=\frac{(x-x_{1})(x-x_{2})(x-x_{n})}{(x_{0}-x_{1})(x_{0}-x_{2})(x_{0}-x_{n})} y_{0}+\frac{(x-x_{0})(x-x_{2})(x-x_{n})}{(x_{1}-x_{0})(x_{1}-x_{2})(x_{1}-x_{n})} y_{1}+............+\frac{(x-x_{0})(x-x_{1})(x-x_{(n-1)})}{(x_{n}-x_{0})(x_{n}-x_{1})(x_{n}-x_{n-1})}y_{n}\]........(1)


Rearranging the equation (1) for the given data points, since we four data points substitute n=3in the above equation:


\[y=f(x)=\frac{(x-x_{1})(x-x_{2})(x-x_{3})}{(x_{0}-x_{1})(x_{0}-x_{2})(x_{0}-x_{3})}y_{0}+\frac{(x-x_{0})(x-x_{2})(x-x_{3})}{(x_{1}-x_{0})(x_{1}-x_{2})(x_{1}-x_{3})}y_{1}+\frac{(x-x_{0})(x-x_{1})(x-x_{3})}{(x_{2}-x_{0})(x_{2}-x_{1})(x_{1}-x_{3})}y_{2}+\frac{(x-x_{0})(x-x_{1})(x-x_{2})}{(x_{3}-x_{0})(x_{3}-x_{2})(x_{3}-x_{2})} y_{3}\]........(2)


We have to find the value of y at x=0,substituting all the values in the above equation and simplify, we get:


\[y=f(0)=\frac{(0-1)(0-3)(0-11)}{(-2-1)(-2-3)(-2-11)}(5)+\frac{(0+2)(0-3)(0-11)}{(1+2)(1-3)(1-11)}(7)+\frac{(0+2)(0-1)(0-11)}{(3+2)(3-1)(3-11)}(11)+\frac{(0+2)(0-3)(0-1)}{(11+2)(11-1)(11-3)}(34)\]


\[y_{x=0}=\left[\frac{-165}{-195}\right]+\left[\frac{462}{60}\right]+\left[\frac{242}{-80}\right]+\left[\frac{2040}{1040} \right ]\]


\[y_{x=0}\] = 0.846 + 7.7 - 3.025 + 1.962


\[y_{x=0} \]= 7.483


Therefore, the value of yat x=0using the Lagrange interpolation method is 7.483.


1. Use the Lagrange formula to fit the data point and hence find y (1)?


x

x0=-1

x1=0

x2=2

x3=3

y=f(x)

-8

3

1

2

Sol:

Given,

We have a set of data points given by,


x

x0=-1

x1=0

x2=2

x3=3

y=f(x)

-8

3

1

2


We are asked to construct the Lagrange polynomial using the Lagrange interpolation method. So, we know that the Lagrange interpolation formula is given by:


\[y=f(x)=\frac{(x-x_{1})(x-x_{2})........(x-x_{n})}{(x_{0}-x_{1})(x_{0}-x_{2}).....(x_{0}-x_{n})} y_{0}+\frac{(x-x_{0})(x-x_{2})......(x-x_{n})}{(x_{1}-x_{0})(x_{1}-x_{2})......(x_{1}-x_{n})} y_{1}+............+\frac{(x-x_{0})(x-x_{1})......(x-x_{(n-1)})}{(x_{n}-x_{0})(x_{n}-x_{1}).....(x_{n}-x_{n-1})}y_{n}\]........(1)


Rearranging the equation (1) for the given data points, since we four data points substitute n=3 in the above equation:


\[y=f(x)=\frac{(x-x_{1})(x-x_{2})(x-x_{3})}{(x_{0}-x_{1})(x_{0}-x_{2})(x_{0}-x_{3})}y_{0}+\frac{(x-x_{0})(x-x_{2})(x-x_{3})}{(x_{1}-x_{0})(x_{1}-x_{2})(x_{1}-x_{3})}y_{1}+\frac{(x-x_{0})(x-x_{1})(x-x_{3})}{(x_{2}-x_{0})(x_{2}-x_{1})(x_{1}-x_{3})}y_{2}+\frac{(x-x_{0})(x-x_{1})(x-x_{2})}{(x_{3}-x_{0})(x_{3}-x_{2})(x_{3}-x_{2})}\times y_{3}\]........(2)


We have to construct the polynomial. Now, substituting all the values in the above equation and simplify, we get:


\[y=f(x)=\frac{(x-0)(x-2)(x-3)}{(-1-0)(-1-2)(-1-3)}(-8)+\frac{(x+1)(x-2)(x-3)}{(0+1)(0-2)(0-3)}(3)+\frac{(x+1)(x-0)(x-3)}{(2+1)(2-0)(2-3)}(1)+\frac{(x+1)(x-0)(x-2)}{(3+1)(3-0)(3-2)}(2)\]


\[y_{x} = \frac{7x^{3}-31x^{2}+28x+18}{6}\].....(3)


Let us verify equation (3):


\[y_{x} = \frac{18}{6}\] = 3


Equation (3) is the required polynomial and it is verified. Now, let us find y(1),substituting x=1in the equation (3) and simplify. We get:


\[y_{x} = \frac{7-31+28+18}{6}\] = 3.666


Therefore, the value of y at x = 1using the Lagrange interpolation method is 3.66.

FAQs on Lagrange Interpolation

1. What is the inverse interpolation formula?

Inverse interpolation formula is the expression to find the value of data point using the function. 

2. Why do we use the Lagrange interpolation formula?

The Lagrange interpolation formula is used to obtain the polynomial function from the given set of data points when they are placed in the uneven interval.