Home  >  Articles  >  An Overview of Lagrange Interpolation Formula

An Overview of Lagrange Interpolation Formula

Kasturi Talukdar

Updated on 07th June, 2023 , 9 min read

Introduction to Lagrange interpolation formula

Lagrange interpolation is a mathematical method used to approximate a function. It is based on the idea of using a polynomial to fit a set of data points. The interpolating polynomial is constructed by taking the weighted sum of the value of the function at each data point. The weights are determined by the Lagrange interpolation formula.

The Lagrange interpolation formula is named after Joseph-Louis Lagrange, who first published it in 1795. The formula can be derived from the Taylor series expansion of the function to be interpolated. In its general form, the Lagrange interpolation formula is given by:

  • Where is the data point being interpolated, where are the other data points, and what are the corresponding values of the function at those points?

The coefficients in front of each term must be determined so that the polynomial passes through all the data points. This can be done by solving a system of linear equations. Once the coefficients have been determined, they can be plugged into the formula to find the value of the function at any desired point within the range of the data points.

The Lagrange interpolation formula is simple to use and easy to understand. However, it has some limitations. One limitation is that it can only be used to interpolate functions that are smooth and continuous. If there are any discontinuities or singularities in the function, then other methods must be used. 

Lagrange interpolation formula Used For

The Lagrange interpolation formula can be used in various fields, such as engineering, physics, and computer graphics. Some of the common applications include:

  1. Data fitting: Given a set of data points, the Lagrange interpolation formula can be used to find a polynomial that passes through the points, allowing for an accurate approximation of the underlying function.
  2. Numerical integration: The Lagrange interpolation formula can be used to approximate the integral of a function over a given interval, by using the interpolating polynomial as an approximation of the integrand.
  3. Signal processing: The Lagrange interpolation formula can be used to interpolate or reconstruct a signal from a set of samples, which is useful in various applications such as image and audio processing.
  4. Computer graphics: The Lagrange interpolation formula can be used to interpolate points on a curve or surface, which is useful in creating smooth and realistic 3D models.

The mathematics behind the Lagrange interpolation formula

The Lagrange interpolation formula is based on the idea of constructing a polynomial of degree n that passes through n+1 given points in the xy-plane. The general form of the interpolating polynomial is given by:

Pn(x) = a0 + a1x + a2x^2 + ... + anxn

where n is the degree of the polynomial, and a0, a1, ..., and are the coefficients to be determined.

The Lagrange interpolation formula uses a set of n+1 basis polynomials that satisfy the following properties:

  • Each basis polynomial has degree n
  • Each basis polynomial has a value of 1 at one of the n+1 given points, and a value of 0 at all other given points.

The Lagrange basis polynomials are defined as:

li(x) = Π(j=0,j≠i,n) (x - xj) / (xi - xj)

where xi and xj are the x-coordinates of the ith and jth given points, respectively.

These basis polynomials have the desired properties, since li(xi) = 1 and li(xj) = 0 for all j≠i.

The Lagrange interpolation formula combines these basis polynomials with the y-coordinates of the given points to obtain the coefficients of the interpolating polynomial. The formula is:

Pn(x) = Σ(i=0,n) li(x) * yi

where yi is the y-coordinate of the ith given point.

This formula states that the interpolating polynomial is a linear combination of the Lagrange basis polynomials, weighted by the y-coordinates of the given points. When evaluated at a particular value of x, the formula computes the corresponding value of the interpolating polynomial.

How to use the Lagrange interpolation formula

If you have a set of data points and want to find a polynomial that fits those points, the Lagrange interpolation formula is a good option. This formula gives the value of a polynomial at a certain point, based on the values of the polynomial at other points. To use this formula, you need to know the coordinates of the points, as well as the values of the polynomial at those points.

 

To find the value of the polynomial at a certain point, start by finding the difference between the x-coordinates of that point and each of the other points. Then, multiply each of those differences by the corresponding y-coordinate. Finally, add all those products together and divide by the factorial of the number of points minus one. This will give you the value of the polynomial at your chosen point.

Read More About:

Lagrange interpolation formula for Intervals

The Lagrange interpolation formula is a mathematical method used to find an nth degree polynomial that passes through n+1 given points. The formula is given by:

L(x) = Σ f(xi) * l(i,x)

where:

  • L(x) is the Lagrange interpolating polynomial of degree n,
  • f(xi) is the value of the function at the ith point,
  • l(i, x) is the Lagrange basis polynomial of degree n, defined as:
    l(i,x) = Π (x - xj) / (xi - xj), where j≠i and j=0 to n.

The Lagrange interpolation formula can be used to find the value of the polynomial at any point within the interval defined by the given points. However, it is important to note that the accuracy of the polynomial decreases as the distance from the given points increases. Therefore, it is recommended to use a higher degree polynomial for a more accurate result.

Lagrange Interpolation Formula for Unequal Intervals

The Lagrange interpolation formula can be used to find a polynomial that passes through a set of given points, regardless of whether the intervals between the points are equal or not. The only requirement is that the number of points is greater than or equal to the degree of the interpolating polynomial.

The formula for Lagrange interpolation remains the same as for the equal interval case. However, the Lagrange basis polynomial must be adjusted to consider the unequal intervals between the points. The formula for the Lagrange basis polynomial l(i, x) is:

l(i,x) = Π (x - xj) / (xi - xj), where j≠i and j=0 to n.

In this formula, xi and xj represent the x-coordinates of the ith and jth points, respectively. The difference between them (xi - xj) is the distance between the points, which is not necessarily the same for all points.

To calculate the value of the interpolating polynomial at a given point x using the Lagrange interpolation formula with unequal intervals, you simply need to provide the list of points and the value of x to the formula. The formula will calculate the polynomial coefficients using the Lagrange basis polynomials and then evaluate the polynomial at x to obtain the interpolated value.

Examples of the Lagrange interpolation formula in action

Lagrange interpolation is a mathematical technique used to approximate a function. The interpolation formula can be used to find a value at any point within the range of the data points. The following are examples of the Lagrange interpolation formula in action:

Example 1:

Data Points: (1,2), (3,4), (5,6)

Value to be found at x = 4:

Using the Lagrange interpolation formula, we get:

y = 2 + (4-1) (6-2)/(5-1) = 2 + 2 = 4

Example 2:

Data Points: (-1,3), (0,5), (2, -1)

Value to be found at x = 1:

y = 3 + (1-(-1)) (5-3)/ (2-(-1)) = 3 + 4 = 7

Proof of Lagrange Interpolation Formula

Here is a more detailed mathematical proof of Lagrange's theorem:

Let G be a finite group of order n and let H be a subgroup of G of order m. We want to prove that m divides n.

First, we define a relation on the elements of G by: g1 ~ g2 if and only if g1g2^-1 is in H. It can be verified that this relation is an equivalence relation on G, i.e., it satisfies the following properties:

  • Reflexivity: g ~ g for any element g in G
  • Symmetry: if g1 ~ g2, then g2 ~ g1
  • Transitivity: if g1 ~ g2 and g2 ~ g3, then g1 ~ g3

The equivalence classes of this relation are called cosets. There are two types of cosets: left cosets and right cosets. We focus on left cosets in this proof.

Let a be an arbitrary element of G. Then, the left cosets of H in G are:

aH, a^2H, ..., a^kH, ...

where k is the largest positive integer such that akH is nonempty. Note that k is finite since G is finite.

Since the cosets are disjoint and their union is G, we have:

|G| = |aH| + |a^2H| + ... + |a^kH|

where |S| denotes the number of elements in the set S.

We claim that all the left cosets have the same size. To see this, let g be an element in G. Then, there exists an integer i such that gi is in aH. Thus, g is in aiH, which shows that any left coset can be obtained by multiplying H on the left by some element of G. Since left multiplication by an element of G is a bijection, it follows that all left cosets have the same size, which we denote by m.

Therefore, we have:

|G| = k m

Since m is the size of each coset, we have:

|H| = m

Thus, we have shown that the order of the subgroup H divides the order of the group G. This completes the proof of Lagrange's theorem.

When not to use the Lagrange interpolation formula

There are a few conditions under which the Lagrange interpolation formula should not be used:

  • If the data points are not evenly spaced, the formula will not produce accurate results.
  • If the data points are close together, the formula may produce inaccurate results due to rounding errors.
  • If the data points are noisy (i.e., they contain random error), the formula may produce inaccurate results.

Sample Questions

1.Use the Lagrange interpolation formula to find a polynomial that passes through the points (0,1), (1,4), and (2,5).

Solution:

The Lagrange interpolation formula is given by:

P(x) = Σ (y_i * L_i(x))

where L_i(x) is the i-th Lagrange basis polynomial. For this problem, we have:

L_0(x) = (x-1) (x-2)/ (-12) = (x^2 - 3x + 2)/2

L_1(x) = (x-0) (x-2)/ (11) = -(x^2 - 2x)/1

L_2(x) = (x-0) (x-1)/ (2*1) = (x^2 - x)/2

Therefore, the polynomial that passes through the points (0,1), (1,4), and (2,5) is:

P(x) = 1*(x^2 - 3x + 2)/2 + 4*(-x^2 + 2x)/1 + 5*(x^2 - x)/2

= -x^2 + 4x + 1

2.Find the value of the polynomial P(x) = 2x^2 + 3x + 4 at x = 1 using the Lagrange interpolation formula.

Solution:

To use the Lagrange interpolation formula, we need to find a set of points that the polynomial passes through. For this problem, we can choose the points (0,4), (1,9), and (2,18) since they are on the graph of P(x). Using the Lagrange interpolation formula, we have:

P (1) = 4*(1/2) + 9*(-1) + 18*(1/2) = 2

Therefore, P (1) = 2.

3.Use the Lagrange interpolation formula to find a polynomial of degree 2 that passes through the points (0,2), (1,1), and (2,0).

Solution: 

Using the Lagrange interpolation formula, we have:

L_0(x) = (x-1) (x-2)/(-12) = (x^2 - 3x + 2)/2

L_1(x) = (x-0) (x-2)/ (11) = -(x^2 - 2x)/1

L_2(x) = (x-0) (x-1)/ (2*1) = (x^2 - x)/2

P(x) = 2*(x^2 - 3x + 2)/2 + 1*(-x^2 + 2x)/1 + 0*(x^2 - x)/2

= -x^2 + x + 2

Therefore, the polynomial of degree 2 that passes through the points (0,2), (1,1), and (2,0) is P(x) = -x^2 + x + 2.

4.Find the value of the polynomial P(x) = x^3 - 2x^2 + 3x + 1 at x = 2 using the Lagrange interpolation formula.

Solution:

To use the Lagrange interpolation formula, we need to find a set of points that the polynomial passes through. For this problem, we can choose the points (0,1), (1,2), (2,5), and (3,16), since they are on the graph of P.

5.Find the polynomial of degree at most 2 that passes through the points (-1, 1), (0, 2), and (1, 3).

Solution:

Let's define the Lagrange basis functions as follows:

L_0(x) = (x - x_1) (x - x_2)/ (x_0 - x_1) (x_0 - x_2)

L_1(x) = (x - x_0) (x - x_2)/ (x_1 - x_0) (x_1 - x_2)

L_2(x) = (x - x_0) (x - x_1)/ (x_2 - x_0) (x_2 - x_1)

where x_0 = -1, x_1 = 0, and x_2 = 1.

Then, the Lagrange interpolation formula gives:

p(x) = f(x_0) L_0(x) + f(x_1) L_1(x) + f(x_2) L_2(x)

where f(x) is the function, we want to interpolate. In this case, f(x) = y, the y-coordinate of each point.

Plugging in the given values, we get:

p(x) = 1L_0(x) + 2L_1(x) + 3*L_2(x)

= (x - 0) (x - 1)/2 + (x + 1) (x - 1)/-2 + (x + 1)(x - 0)/2

= x^2 - x + 2

Therefore, the polynomial we seek is p(x) = x^2 - x + 2.

6.Use Lagrange interpolation to approximate the function f(x) = e^x on the interval [0, 1] with a polynomial of degree at most 1.

Solution:

Using the same Lagrange basis functions as in the previous problem, we get:

p(x) = f(x_0) L_0(x) + f(x_1) L_1(x)

wherex_0 = 0, x_1 = 1, and f(x) = e^x.

Plugging in the values, we get:

p(x) = e^0L_0(x) + e^1L_1(x)

= (1 - x) e^0 + xe^1

= xe + 1 - x

Therefore, the polynomial we seek is p(x) = x*e + 1 - x.

Frequently Asked Questions

What is Lagrange interpolation?

The Lagrange formula can be obtained using the Lagrange Interpolation Algorithm. a polynomial that assumes certain values at each specified location. It is the nth degree polynomial representation of the function f. (x). The new data points are found within the boundaries of a distinct collection of extant data points using the interpolation method.

What is the function of Lagrange interpolation?

Lagrange interpolation functions are used to explicitly determine the shape functions of a cubic element. Shape functions under a natural CS are used as an illustration here.

What is Lagrange Interpolation’s purpose?

The form functions of a cubic element are directly defined by the Lagrange interpolation functions.

What is Lagrange interpolation used for?

Even if the parameters are not equally dispersed, this formula can still be used to determine the function’s value. This formula calculates the value of the independent variable x based on a function value.

What is the formula for Lagrange interpolation polynomial?

y - y1= (y2- y1)/(x2-x1) * (x-x1)

What is the Lagrange principle?

The formula for the Lagrangian L is L = T V, where T denotes the system’s kinetic energy and V is its potential energy. In general, a system’s potential energy relies on the coordinates of each of its constituent particles; this is denoted by V = V. (x 1, y 1, z 1, x 2, y 2, z 2, . . . ).

Check Eligibility Apply Now