A-15 Lagrange’s Polynomial Interpolation

Suppose we are given n + 1 two-dimensional coordinates (x0,y0),(x1,y1),,(xn,yn), whereas all x values are distinct but y values are not necessarily distinct. Lagrange’s polynomial interpolation is a technique to find a unique n-degree polynomial that passes through such n + 1 coordinates. The domain of X and Y values is complex numbers (which include the real domain), or can be modulo prime.

Theorem A-15 Lagrange’s Polynomial Interpolation

Suppose we are given n + 1 two-dimensional coordinates (x0,y0),(x1,y1),,(xn,yn), whereas all X values are distinct but the Y values don’t need to be distinct. The domain of (X,Y ) can be either: (xi,yi) 2 (which includes the real domain) or (xi,yi) p2 (where p is a prime). Then, there exists a unique n-degree (or lesser degree) polynomial f(X) that passes through these n coordinates. Such a polynomial f(X) is computed as follows:

f(X) = j=0n (X x0) (X x1)(X xj1) (X xj+1)(X xn) (xj x0) (xj x1)(xj xj1) (xj xj+1)(xj xn) yj

Proof.

1.
First, we will show that there exists an n-degree (or lesser degree) polynomial f(X) that passes through the n + 1 distinct coordinates: (x0,y0),(x1,y1),,(xn,yn). Such a polynomial f(X) is designed as follows:

f(X) = j=0n (X x0) (X x1)(X xj1) (X xj+1)(X xn) (xj x0) (xj x1)(xj xj1) (xj xj+1)(xj xn) yj

Given this design of f(X), notice that for each of (xi,yi) {(x0,y0),(x1,y1),,(xn,yn)}, f(xi) = yi, specifically the i + 1-th term of sigma summation being yi and all other terms being 0.

Such a satisfactory f(X) can be computed in the case where the domain of (X,Y ) is: (xi,yi) 2 (which includes the real domain) or (xi,yi) p2 (where p is a prime). Especially, a valid f(X) can be computed also in the mod p domain, because as we learned from Fermat’s Little Theorem in Theorem A-4.2.4 (§A-4.2), ap1 1 mod p if and only if a and p are co-prime, and this means that if p is a prime, then ap1 1 mod p for all a p× (i.e., p without {0}). Since every value in p× has an inverse, we can compute the denominator’s division operation in f(X) = j=0n (X x0) (X x1)(X xj1) (X xj+1)(X xn) (xj x0) (xj x1)(xj xj1) (xj xj+1)(xj xn) yj by converting them into multiplication of their counter-part inverses, and thereby compute a validly defined f(X) mod p.

2.
Next, we will prove that no two distinct n-degree (or lesser degree) polynomials f(X)1 and f(X)2 can pass through the same n + 1 distinct (X,Y ) coordinates. Suppose there exist such two polynomials f(X)1 and f(X)2. Then f12(X) = f1(X) f2(X) will be a new n-degree (or lesser degree) polynomial that passes through (x0,0),(x1,0),,(xn,0). This means that f12(X) has n + 1 distinct roots. In other words, f12(X) is an n + 1-degree (or higher-degree) polynomial. However, this contradicts the fact that f12(X) is an n-degree (or lesser degree) polynomial. Therefore, there exist no two polynomials f1(X) and f2(X) that pass through the same n + 1 distinct (X,Y ) coordinates.
3.
We have shown that there exists some n-degree (or lesser degree) polynomial f(X) that passes through n + 1 distinct (X,Y ) coordinates, and no such two or more distinct polynomials exists. Therefore, there exists only a unique polynomial that satisfies this requirement.