Lagrange cardinal polynomial (source code)

= Lagrange cardinal polynomial
{c}
{title2=$\ell_i$}

= Lagrange basis polynomial
{c}
{synonym}

For distinct <interpolation nodes> $x_0,\ldots,x_n$, the <Lagrange cardinal polynomial> $\ell_i$ has value one at its own <interpolation node> and zero at every other <interpolation node>:
$$
\ell_i(x)=\prod_{j\ne i}\frac{x-x_j}{x_i-x_j},\qquad
\ell_i(x_j)=\delta_{ij}=
\begin{cases}1,&i=j,\\0,&i\ne j.\end{cases}
$$
Here $\delta_{ij}$ is the <Kronecker delta>. These <Lagrange cardinal polynomials> form a <basis> of the <vector space> of <polynomials> of <polynomial degree> at most $n$: every such <polynomial> has the unique expansion $p(x)=\sum_i p(x_i)\ell_i(x)$. The nodal evaluation <linear functionals> $E_j(p)=p(x_j)$ form the <dual basis>, since $E_j(\ell_i)=\delta_{ij}$.

For the <interpolation nodes> $0,1,2$, the three <Lagrange cardinal polynomials> are
$$
\ell_0(x)=\frac{(x-1)(x-2)}2,\qquad
\ell_1(x)=-x(x-2),\qquad
\ell_2(x)=\frac{x(x-1)}2.
$$
Their values on the <interpolation nodes> are the rows of the <identity matrix>. In the figure, each colored curve passes through its own unit-height marker and through zero at the other two <interpolation nodes>. Multiplying the curves by the data $1,2,5$ and adding gives the <Lagrange polynomial> $x^2+1$.

\Image[/lagrange-interpolation-cardinals.png]
{title=Lagrange cardinal polynomials at nodes 0, 1, 2 and their weighted sum interpolating values 1, 2, 5}

Since the constant <polynomial> one interpolates data values all equal to one, uniqueness gives $\sum_i\ell_i(x)=1$. Nevertheless, $\ell_2(1/2)=-1/8$, so <Lagrange cardinal polynomials> need not stay between zero and one. If a single data value $y_i$ changes by $\varepsilon$, the <interpolation polynomial> changes by exactly $\varepsilon\ell_i(x)$. Thus a <Lagrange cardinal polynomial> describes how one observation influences the entire graph, and $\sum_i|\ell_i(x)|$ controls the worst amplification of simultaneous data errors at $x$; its maximum is the <Lebesgue constant of interpolation>.