Lagrange Interpolation
Lagrange interpolation is a way to pass a polynomial of degree N1 through N points. In the applet below you can modify each of the points (by dragging it to the desired position) and the number of points by clicking at the number shown in the lower left corner of the applet.
As of 2018, Java plugins are not supported by any browsers (find out more). This Wolfram Demonstration, Cubic Spline Interpolation versus Interpolating Polynomial, shows an item of the same or similar topic, but is different from the original Java applet, named 'Lagrange'. The originally given instructions may no longer correspond precisely.
Note how dragging just one point affects the whole graph. Compare this to the behavior of the cubic spline.
Lagrange polynomials are the interpolating polynomials that equal zero in all given points, save one. Say, given points x_{1}, x_{2}, ..., x_{N}, Lagrange's polynomial #k is the product

such that P_{k}(x_{k}) = 1 and P_{k}(x_{j}) = 0, for j different from k. There is a simpler way to write Lagrange polynomials. Let
P(x) = ∏(x  x_{i}), 
where product is taken over all possible indices i (1 ≤ i ≤ N). Define also
P'_{k}(x) = ∏'(x  x_{i}), 
where the "prime" indicates the omission of one of the factors, viz., (x  x_{k}). Using P'_{k} Lagrange polynomials appear in a very compact form:
P_{k}(x) = P'_{k}(x) / P'_{k} (x_{k}). 
In terms of Lagrange's polynomials the polynomial interpolation through the points
(1)  P(x) = y_{1}P_{1}(x) + y_{2}P_{2}(x) + ... + y_{N}P_{N}(x). 
You can observe Lagrange's polynomials by clicking on the number to the right of "Show polynomial #". If the number is 0, the starting function is a parabola instead.
(The form (1) of the interpolating polynomial, while correct, is quite inconvenient in several respects for numerical computations. Usually, another one that makes use of Newton's divided differences is implemented instead. This is the route taken by the applet above.)
69103106  Copyright © 19962018 Alexander Bogomolny 