Skip to main content

Section 10.2 Lagrange Interpolation

The key idea behind Lagrange interpolation is based on the observation that
\begin{equation*} \begin{bmatrix} f_0 \\ f_1 \\ \vdots \\ f_n \end{bmatrix} = f_0 \begin{bmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix} + f_1 \begin{bmatrix} 0 \\ 1 \\ \vdots \\ 0 \end{bmatrix} + \cdots + f_n \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 1 \end{bmatrix} \end{equation*}
This suggests we should first consider a special interpolation problem: find polynomials \(l_i(x)\) (\(i = 0, 1, \ldots, n\)) of degree at most \(n\) satisfying
\begin{equation} l_i(x_j) = \delta_{ij} = \begin{cases} 1, \amp \text{if } j = i \\ 0, \amp \text{if } j \neq i \end{cases}\tag{10.2.1} \end{equation}
where \(\delta_{ij}\) is the Kronecker delta.
According to TheoremΒ 10.1.3, \(l_i(x)\) exists and is unique. From condition (10.2.1), we know that \(x_0, x_1, \ldots, x_{i-1}, x_{i+1}, \ldots, x_n\) are all zeros of \(l_i(x)\text{,}\) and since \(l_i(x)\) has degree at most \(n\text{,}\) we can write:
\begin{equation*} l_i(x) = b_i(x - x_0) \cdots (x - x_{i-1})(x - x_{i+1}) \cdots (x - x_n) \end{equation*}
We still have one condition \(l_i(x_i) = 1\) which is used to determine \(b_i\text{:}\)
\begin{equation*} l_i(x_i) = b_i(x_i - x_0) \cdots (x_i - x_{i-1})(x_i - x_{i+1}) \cdots (x_i - x_n) = 1 \end{equation*}
This gives us:
\begin{equation*} b_i = \frac{1}{(x_i - x_0) \cdots (x_i - x_{i-1})(x_i - x_{i+1}) \cdots (x_i - x_n)} \end{equation*}
Therefore:
\begin{equation} l_i(x) = \frac{(x - x_0) \cdots (x - x_{i-1})(x - x_{i+1}) \cdots (x - x_n)}{(x_i - x_0) \cdots (x_i - x_{i-1})(x_i - x_{i+1}) \cdots (x_i - x_n)}\tag{10.2.2} \end{equation}

Definition 10.2.1.

The polynomials \(l_i(x)\) (\(i = 0, 1, \ldots, n\)) defined by (10.2.2) are called the Lagrange basis functions or Lagrange fundamental polynomials corresponding to the nodes \(x_0, x_1, \ldots, x_n\text{.}\)
It can be verified that \([l_0(x), l_1(x), \ldots, l_n(x)]\) forms a basis for the \((n+1)\)-dimensional linear space \(P_n[x]\text{.}\)
If we define the \((n+1)\)-degree polynomial \(\omega_{n+1}(x)\) as
\begin{equation*} \omega_{n+1}(x) = \prod_{i=0}^n (x - x_i) = (x - x_0)(x - x_1) \cdots (x - x_n) \end{equation*}
then
\begin{equation*} \omega'_{n+1}(x_i) = (x_i - x_0) \cdots (x_i - x_{i-1})(x_i - x_{i+1}) \cdots (x_i - x_n) \end{equation*}
and equation (10.2.2) can be rewritten as:
\begin{equation} l_i(x) = \frac{\omega_{n+1}(x)}{\omega'_{n+1}(x_i)(x - x_i)}\tag{10.2.3} \end{equation}

Proof.

Clearly, \(p_n(x)\) given by (10.2.4) is a polynomial of degree at most \(n\text{,}\) and we have:
\begin{equation*} p_n(x_j) = \sum_{i=0}^n f_i l_i(x_j) = \sum_{i=0}^n f_i \delta_{ij} = f_j \quad (j = 0, 1, \ldots, n) \end{equation*}
Therefore, by TheoremΒ 10.1.3, \(p_n(x)\) is the unique interpolating polynomial.

Example 10.2.3. Lagrange Interpolation with Discrete Data.

Given the following discrete data:
\(x_i\) \(-2\) \(-1\) \(0\) \(1\) \(2\)
\(f_i\) \(0.25\) \(0.5\) \(1\) \(2\) \(4\)
  1. Find the linear interpolation polynomial using nodes \(x_2 = 0\) and \(x_3 = 1\text{,}\) and predict the approximate value of \(f\) at \(x = 0.3\text{.}\)
  2. Find the quadratic interpolation polynomial using nodes \(x_1 = -1\text{,}\) \(x_2 = 0\text{,}\) and \(x_3 = 1\text{,}\) and predict the approximate value of \(f\) at \(x = 0.3\text{.}\)
Solution.
(1) The linear interpolation polynomial is:
\begin{align*} p_1(x) \amp = f_2 \frac{x - x_3}{x_2 - x_3} + f_3 \frac{x - x_2}{x_3 - x_2}\\ \amp = 1 \times \frac{x - 1}{0 - 1} + 2 \times \frac{x - 0}{1 - 0}\\ \amp = -(x - 1) + 2x = x + 1 \end{align*}
Since \(p_1(0.3) = 0.3 + 1 = 1.3\text{,}\) the approximate value of \(f\) at \(x = 0.3\) is \(1.3\text{.}\)
(2) The quadratic interpolation polynomial is:
\begin{align*} p_2(x) \amp = 0.5 \frac{(x-0)(x-1)}{(-1-0)(-1-1)} + 1 \frac{(x-(-1))(x-1)}{(0-(-1))(0-1)}\\ \amp \quad + 2 \frac{(x-(-1))(x-0)}{(1-(-1))(1-0)}\\ \amp = 0.25x(x-1) - (x^2-1) + x(x+1)\\ \amp = 0.25x^2 + 0.75x + 1 \end{align*}
Since \(p_2(0.3) = 0.25 \times (0.3)^2 + 0.75 \times 0.3 + 1 = 1.2475\text{,}\) the approximate value of \(f\) at \(x = 0.3\) is \(1.2475\text{.}\)

Remark 10.2.4.

ExampleΒ 10.2.3 illustrates an important point: higher-degree interpolation (using more nodes) generally provides better approximation. However, as we will see later, this is not always the caseβ€”very high-degree interpolation can sometimes lead to poor approximation due to oscillation effects.