A-15 Lagrange’s Polynomial Interpolation

Suppose we are given n + 1 two-dimensional coordinates (x0,y0),(x1,y1),,(xn,yn), where all x values are distinct, but y values are not necessarily distinct. Lagrange’s polynomial interpolation is a technique to find a unique polynomial of degree at most n that passes through such n + 1 coordinates. The given points (xi,yi) may lie either in 2 (the complex plane, which includes the real numbers) or in p2 for some prime p.

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 polynomial f(X) of degree at most n that passes through these n + 1 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

f(X) = j=0n ( 0kn kj X xk xj xk 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

f(X) = j=0n ( 0kn kj X xk xj xk yj)

f(X) = j=0nj(X) yj where j(X) = 0kn kj X xk xj xk

We call {0(X),1(X),,n(X)} the Lagrange basis for polynomials of degree n. Given this design of f(X), notice that for each of (xi,yi) {(x0,y0),(x1,y1),,(xn,yn)}, i(xi) = 1 for i = i, and i(xi) = 0 for ii. Therefore, f(xi) = j=0nj(xi) yj = 1 yi = yi for 0 i n. In other words, f(X) passes through the n + 1 distinct coordinates: {(x0,y0),(x1,y1),,(xn,yn)}. Such a satisfactory f(X) can be computed in the case where the domain of (X,Y ) is either: (xi,yi) 2 (i.e., real and complex numbers), 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 perform each division in the formula for 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 multiplying with the corresponding inverses of those denominators.

2.
Next, we will prove that no two distinct n-degree (or lesser degree) polynomials f1(X) and f2(X) can pass through the same n + 1 distinct (X,Y ) coordinates. Suppose there exist such two polynomials f1(X) and f2(X). 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 assumption 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.