Lagrange interpolation Method

The Lagrange interpolation method is a polynomial interpolation technique used to construct a polynomial that passes through a given set of points. This method is particularly useful for finding the value of a function at a specific point, given its values at known points.

The formula for Lagrange interpolation method Interpolation is:

P(x)=y0L0(x)+y1L1(x)+y2L2(x)+ynLn(x) P(x) = y_0 \cdot L_0(x) + y_1 \cdot L_1(x) + y_2 \cdot L_2(x) + \cdots y_n \cdot L_n(x)
Li(x)=(xx0)(xx1)(xxi1)(xxi+1)(xxn)(xix0)(xix1)(xixi1)(xixi+1)(xixn)L_i(x) = \frac{(x - x_0)(x - x_1) \cdots (x - x_{i-1})(x - x_{i+1}) \cdots (x - x_n)}{(x_i - x_0)(x_i - x_1) \cdots (x_i - x_{i-1})(x_i - x_{i+1}) \cdots (x_i - x_n)}

where:

  • (xn,yn)(x_n,y_n) are the given data points.
  • Li(x)L_i(x) is the Lagrange basis polynomial,
    Li(x)=j=0,jinxxjxixjL_i(x) = \prod_{j=0, j \,\neq \, i}^{n} \frac{x - x_j}{x_i - x_j}
  • nn is the number of data points.
  • P(x)P(x) is the The Lagrange polynomial.

Example of Newton Backward Interpolation

Let's say we are given the following data points:


xxyy
05
27
38
510
612

We are tasked with finding yy where x=4x = 4


Step 1: Calculate the Ln(x)L_n (x) for the yy values.


xxyyLn(x)L_n(x)
05\ rac(42)(43)(45)(46)(02)(03)(05)(06)=0.0222\ rac{(4-2)(4-3)(4-5)(4-6)}{(0-2)(0-3)(0-5)(0-6)} = 0.0222
27\ rac(40)(43)(45)(46)(20)(23)(25)(26)=0.3333\ rac{(4-0)(4-3)(4-5)(4-6)}{(2-0)(2-3)(2-5)(2-6)} = 0.3333
38\ rac(40)(42)(45)(46)(30)(32)(35)(36)=0.8889\ rac{(4-0)(4-2)(4-5)(4-6)}{(3-0)(3-2)(3-5)(3-6)} = 0.8889
510\ rac(40)(42)(43)(46)(50)(52)(53)(56)=0.5333\ rac{(4-0)(4-2)(4-3)(4-6)}{(5-0)(5-2)(5-3)(5-6)} = 0.5333
612\ rac(40)(42)(43)(45)(60)(62)(63)(65)=0.1111\ rac{(4-0)(4-2)(4-3)(4-5)}{(6-0)(6-2)(6-3)(6-5)} = 0.1111

Step 3: Apply the Newton Backward Interpolation formula:


P(x)=y0L0(x)+y1L1(x)+y2L2(x)+ynLn(x) P(x) = y_0 \cdot L_0(x) + y_1 \cdot L_1(x) + y_2 \cdot L_2(x) + \cdots y_n \cdot L_n(x)

Substituting the values:

P(4)=50.0222+70.3333+808889100.5333+120.1111P(4) = 5 \cdot 0.0222 + 7 \cdot 0.3333 + 8 \cdot 08889 10 \cdot 0.5333 + 12 \cdot 0.1111

Substituting the values:

P(4)=0.11112.3333+7.1111+5.3333+1.3333P(4) = 0.1111 - 2.3333 + 7.1111+ 5.3333 + - 1.3333

Adding them together:

P(4)=8.8889P(4) = 8.8889

Thus, the interpolated value of yy at x=4x = 4 is approximately 8.8889 8.8889

Lagrange Interpolation Method Calculator

X ValueY Value

Plot: