Lagrange's interpolation formula
(mathematics) A formula which when given a set of n points {\displaystyle (x{i},y{i})}{\displaystyle (x{i},y{i})}, gives back the unique polynomial of degree (at most) n − 1 in one variable which describes a function passing through those points. The formula is a sum of products, like so: {\displaystyle \sum {i}{n}y{i}\prod {j\neq i}{x-x{j} \over x{i}-x{j}}}{\displaystyle \sum {i}{n}y{i}\prod {j\neq i}{x-x{j} \over x{i}-x{j}}}. When {\displaystyle x=x{i}}{\displaystyle x=x{i}} then all terms in the sum other than the i th contain a factor {\displaystyle x-x{i}}{\displaystyle x-x{i}} in the numerator, which becomes equal to zero, thus all terms in the sum other than the i th vanish, and the i th term has factors {\displaystyle x{i}-x{j}}{\displaystyle x{i}-x{j}} both in the numerator and denominator, which simplify to yield 1, thus the polynomial should return {\displaystyle y{i}}{\displaystyle y{i}} as the function of {\displaystyle x{i}}{\displaystyle x{i}} for any i in the set {\displaystyle {1,...,n}}{\displaystyle {1,...,n}}.