Suppose we are given two-dimensional coordinates , where all values are distinct, but values are not necessarily distinct. Lagrange’s polynomial interpolation is a technique to find a unique polynomial of degree at most that passes through such coordinates. The given points may lie either in (the complex plane, which includes the real numbers) or in for some prime .
Theorem A-15 Lagrange’s Polynomial Interpolation
Suppose we are given two-dimensional coordinates , whereas all values are distinct but the values don’t need to be distinct. The domain of can be either: (which includes the real domain) or (where is a prime). Then, there exists a unique polynomial of degree at most that passes through these coordinates. Such a polynomial is computed as follows:
Proof.
where
We call the Lagrange basis for polynomials of degree . Given this design of , notice that for each of , for , and for . Therefore, for . In other words, passes through the distinct coordinates: . Such a satisfactory can be computed in the case where the domain of ) is either: (i.e., real and complex numbers), or (where is a prime). Especially, a valid can be computed also in the domain, because as we learned from Fermat’s Little Theorem in Theorem A-4.2.4 (§A-4.2), if and only if and are co-prime, and this means that if is a prime, then for all (i.e., without ). Since every value in has an inverse, we can perform each division in the formula for by multiplying with the corresponding inverses of those denominators.