write an algorithim for langrange forlumaa finf the polynomial which fits the following data (-1,7) (1,5) (2,15)
Answers
Answered by
0
Lagrange polynomials are used for polynomial interpolation. For a given set of distinct points xj and numbers yj. Lagrange’s interpolation is also an Nth degree polynomial approximation to f(x).
Find the Lagrange Interpolation Formula given below,
lagrange
Solved Examples
Question: Find the value of y at x = 0 given some set of values (-2, 5), (1, 7), (3, 11), (7, 34)?
Solution:
Given the known values are,
x = 0 ; x0 = -2 ; x1 = 1 ; x2= 3 ; x3 = 7 ; y0 = 5 ; y1 = 7 ; y2 = 11 ; y3 = 34
Using the interpolation formula,
y = (x−x1)(x−x2)…..(x−xn)(x0−x1)(x0−x2)…..(x0−xn) y0 + (x−x0)(x−x2)…..(x−xn)(x1−x0)(x1−x2)…..(x1−xn) y1 + …. + (x−x1)(x−x1)…..(x−xn−1)(xn−x0)(x0−x1)…..(xn−xn−1) yn
y = (0−1)(0−3)(0−7)(−2−1)(−2−3)(−2−7) × 5 + (0+2)(0−3)(0−7)(1+2)(1−3)(1−7) × 7 + (0+2)(0−1)(0−7)(3+2)(3−1)(3−7) × 11 + (0+2)(0−1)(0−3)(7+2)(7−1)(7−3) × 34
y = 2127 + 496 + −7720 + 5154
y = 1087180
Similar questions