Lagrange Interpolation
One particularly useful property of polynomials is that a polynomial of degree m is completely determined on m+1 evaluation points, which implies that we can uniquely derive a polynomial of degree m from a set S:
Polynomials therefore have the property that m+1 pairs of points (xi,yi) for xi=xj are enough to determine the set of pairs (x,P(x)) for all x∈R.
If the coefficients of the polynomial we want to find have a notion of multiplicative inverse, it is always possible to find such a polynomial using a method called Lagrange Interpolation, which works as follows.

The set of polynomials lj(x)is called the Lagrange basis. Each of the polynomials has degree m and take values lj(xi)=0 if i=j and lj(xj)=1. Using the Kronecker delta this can be written as lj(xi)=δij.
Notice that the numerator ∏i=j(x−xi) has m roots at the nodes {xi}i=j while the denominator ∏i=j(xj−xi) scales the resulting polynomial so that lj(xj)=1.
The naive implemetation of Lagrange Interpolation can be found below:
Sage example:
Last updated