A basis polynomial is an interpolation building block: it equals 1 at its associated input xᵢ and 0 at every other interpolation input xⱼ. For N data points, define it as gᵢ(x) = ∏ⱼ≠ᵢ (x − xⱼ)/(xᵢ − xⱼ). Although written as ratios, the data inputs are fixed numbers, so each factor is linear and gᵢ is an ordinary polynomial of degree N−1. section 6.3.4
The defining values make basis polynomials useful for assembling an interpolating polynomial:
- At x = xᵢ, every factor’s numerator matches its denominator, so gᵢ(xᵢ) = 1. section 6.3.4
- At any other data input xⱼ, one factor has a zero numerator, so gᵢ(xⱼ) = 0. section 6.3.4
- Scale each gᵢ by its data value yᵢ and add the results: L(x) = Σᵢ yᵢgᵢ(x). The sum passes through every interpolation point. section 6.3.4 section 6.3.6
Checking one basis polynomial
The polynomial 0.1x² − 0.1x − 0.2 evaluates to 1 at x = −3 and to 0 at x = −1 and x = 2, demonstrating the one-at-one-input, zero-at-the-others pattern.
