Skip to main content

Section 10.3 Newton Interpolation

One drawback of Lagrange interpolation is that when we add a new node and corresponding function value, the Lagrange basis functions must be completely recomputed. This raises the question: Can we make full use of the existing interpolating polynomial and simply add a correction term to obtain the new interpolating polynomial? In other words, can we give the interpolating polynomial in a recursive form?
The Newton interpolation polynomial provides such a form. To make full use of existing results, the basis functions should grow as nodes are added. Therefore, we select the following special basis functions:
\begin{equation} \begin{cases} \varphi_0(x) = 1 \\ \varphi_{i+1}(x) = (x - x_i)\varphi_i(x), \quad i = 0, 1, \ldots, n-1 \end{cases}\tag{10.3.1} \end{equation}
Thus, a polynomial \(p_n(x)\) of degree at most \(n\) can be written as:
\begin{equation} \begin{split} p_n(x) = c_0 \cdot 1 \amp + c_1(x - x_0) + c_2(x - x_0)(x - x_1) \\ \amp + \cdots + c_n(x - x_0)(x - x_1) \cdots (x - x_{n-1}) \end{split}\tag{10.3.2} \end{equation}
Clearly, when using this form of basis functions, adding a new node \(x_{n+1}\) only requires adding a new term \(c_{n+1}(x - x_0)(x - x_1) \cdots (x - x_n)\) to equation (10.3.2).
The coefficients \(c_0, c_1, c_2, \ldots, c_n\) in (10.3.2) can be determined by the interpolation condition (10.1.1). Setting \(x = x_0\) in (10.3.2), we get:
\begin{equation*} c_0 = p_n(x_0) = f_0 \end{equation*}
Setting \(x = x_1\) in (10.3.2), we obtain:
\begin{equation*} c_0 + c_1(x_1 - x_0) = p_n(x_1) = f_1 \end{equation*}
Therefore:
\begin{equation*} c_1 = \frac{f_1 - c_0}{x_1 - x_0} = \frac{f_1 - f_0}{x_1 - x_0} \end{equation*}

Definition 10.3.1.

We denote
\begin{equation*} f[x_0, x_1] = \frac{f(x_1) - f(x_0)}{x_1 - x_0} = \frac{f_1 - f_0}{x_1 - x_0} \end{equation*}
and call it the first-order divided difference of \(f\) at nodes \(x_0\) and \(x_1\text{.}\) It represents the ratio of the function difference to the variable difference.
Setting \(x = x_2\) in (10.3.2), we get:
\begin{equation*} c_0 + c_1(x_2 - x_0) + c_2(x_2 - x_0)(x_2 - x_1) = p_n(x_2) = f_2 \end{equation*}
Solving for \(c_2\text{:}\)
\begin{equation*} c_2 = \frac{f_2 - c_0 - c_1(x_2 - x_0)}{(x_2 - x_0)(x_2 - x_1)} \end{equation*}
To understand how this expression relates to divided differences, we substitute the known values \(c_0 = f_0\) and \(c_1 = \frac{f_1 - f_0}{x_1 - x_0}\text{:}\)
\begin{align*} c_2 \amp = \frac{f_2 - f_0 - \frac{f_1 - f_0}{x_1 - x_0}(x_2 - x_0)}{(x_2 - x_0)(x_2 - x_1)}\\ \amp = \frac{f_2 - f_0 - \frac{(f_1 - f_0)(x_2 - x_0)}{x_1 - x_0}}{(x_2 - x_0)(x_2 - x_1)} \end{align*}
We can rewrite the numerator by adding and subtracting \(f_1\text{:}\)
\begin{align*} c_2 \amp = \frac{\frac{f_2 - f_1 + f_1 - f_0}{x_2 - x_1} - \frac{f_1 - f_0}{x_1 - x_0} \cdot \frac{x_2 - x_0}{x_2 - x_1}}{x_2 - x_0}\\ \amp = \frac{\frac{f_2 - f_1}{x_2 - x_1} + \frac{f_1 - f_0}{x_2 - x_1} - \frac{f_1 - f_0}{x_1 - x_0}\left(1 + \frac{x_1 - x_0}{x_2 - x_1}\right)}{x_2 - x_0} \end{align*}
Expanding the last term and simplifying:
\begin{align*} c_2 \amp = \frac{\frac{f_2 - f_1}{x_2 - x_1} + \frac{f_1 - f_0}{x_2 - x_1} - \frac{f_1 - f_0}{x_1 - x_0} - \frac{f_1 - f_0}{x_2 - x_1}}{x_2 - x_0}\\ \amp = \frac{\frac{f_2 - f_1}{x_2 - x_1} - \frac{f_1 - f_0}{x_1 - x_0}}{x_2 - x_0}\\ \amp = \frac{f[x_1, x_2] - f[x_0, x_1]}{x_2 - x_0} \end{align*}

Definition 10.3.2.

We denote
\begin{equation*} f[x_0, x_1, x_2] = \frac{f[x_1, x_2] - f[x_0, x_1]}{x_2 - x_0} \end{equation*}
and call it the second-order divided difference. It represents the divided difference of first-order divided differences.
Therefore, we have shown that \(c_2 = f[x_0, x_1, x_2]\text{.}\) This calculation reveals the pattern: each coefficient \(c_i\) in the Newton form equals the \(i\)-th order divided difference starting from \(x_0\text{.}\)
Continuing this process, we can determine the coefficients \(c_0, c_1, c_2, \ldots, c_n\) successively. In general:
\begin{equation*} c_i = \frac{f[x_1, x_2, \ldots, x_i] - f[x_0, x_1, \ldots, x_{i-1}]}{x_i - x_0} = f[x_0, x_1, \ldots, x_i] \quad (i = 0, 1, \ldots, n) \end{equation*}

Remark 10.3.3.

To illustrate the detailed computation of \(c_3\text{,}\) we follow the same systematic approach used for \(c_2\text{.}\) This calculation will show how the pattern extends to higher-order divided differences.
Setting \(x = x_3\) in (10.3.2), we get:
\begin{equation*} c_0 + c_1(x_3 - x_0) + c_2(x_3 - x_0)(x_3 - x_1) + c_3(x_3 - x_0)(x_3 - x_1)(x_3 - x_2) = f_3 \end{equation*}
Solving for \(c_3\text{:}\)
\begin{equation*} c_3 = \frac{f_3 - c_0 - c_1(x_3 - x_0) - c_2(x_3 - x_0)(x_3 - x_1)}{(x_3 - x_0)(x_3 - x_1)(x_3 - x_2)} \end{equation*}
Substituting the known values \(c_0 = f_0\text{,}\) \(c_1 = f[x_0, x_1] = \frac{f_1 - f_0}{x_1 - x_0}\text{,}\) and \(c_2 = f[x_0, x_1, x_2]\text{:}\)
\begin{align*} c_3 \amp = \frac{f_3 - f_0 - \frac{f_1 - f_0}{x_1 - x_0}(x_3 - x_0) - f[x_0, x_1, x_2](x_3 - x_0)(x_3 - x_1)}{(x_3 - x_0)(x_3 - x_1)(x_3 - x_2)} \end{align*}
Since \(f[x_0, x_1, x_2] = \frac{f[x_1, x_2] - f[x_0, x_1]}{x_2 - x_0}\text{,}\) we can substitute:
\begin{align*} c_3 \amp = \frac{f_3 - f_0 - \frac{f_1 - f_0}{x_1 - x_0}(x_3 - x_0) - \frac{f[x_1, x_2] - f[x_0, x_1]}{x_2 - x_0}(x_3 - x_0)(x_3 - x_1)}{(x_3 - x_0)(x_3 - x_1)(x_3 - x_2)} \end{align*}
To simplify the numerator, we factor out \((x_3 - x_0)\) and rearrange terms systematically. First, we rewrite the numerator as:
\begin{align*} \text{Numerator} \amp = f_3 - f_0 - \frac{(f_1 - f_0)(x_3 - x_0)}{x_1 - x_0} - \frac{(f[x_1, x_2] - f[x_0, x_1])(x_3 - x_0)(x_3 - x_1)}{x_2 - x_0} \end{align*}
By adding and subtracting appropriate terms and using the fact that \(f[x_1, x_2] = \frac{f_2 - f_1}{x_2 - x_1}\) and \(f[x_0, x_1] = \frac{f_1 - f_0}{x_1 - x_0}\text{,}\) we can show through algebraic manipulation (similar to the derivation of \(c_2\)) that:
\begin{align*} c_3 \amp = \frac{1}{x_3 - x_0} \left[ \frac{f[x_1, x_2, x_3] - f[x_0, x_1, x_2]}{1} \right]\\ \amp = \frac{f[x_1, x_2, x_3] - f[x_0, x_1, x_2]}{x_3 - x_0} \end{align*}
By the definition of third-order divided differences, this gives us:
\begin{equation*} c_3 = f[x_0, x_1, x_2, x_3] \end{equation*}
Detailed algebraic steps: The key insight in the simplification is to group terms by their order and use the recursive nature of divided differences. Specifically, when we expand all the divided differences in terms of function values and manipulate the resulting expression, the terms cancel in such a way that we obtain the standard form of a third-order divided difference.
This computation confirms the general pattern: \(c_i = f[x_0, x_1, \ldots, x_i]\) for all \(i\text{,}\) establishing that each coefficient in the Newton form equals the corresponding divided difference.
Basic Properties of Divided Differences:
  1. The \(i\)-th order divided difference \(f[x_0, x_1, \ldots, x_i]\) can be expressed as a linear combination of \(f(x_0), f(x_1), \ldots, f(x_i)\text{.}\) For example:
    \begin{equation*} f[x_0, x_1, x_2] = \frac{f(x_0)}{(x_0-x_1)(x_0-x_2)} + \frac{f(x_1)}{(x_1-x_0)(x_1-x_2)} + \frac{f(x_2)}{(x_2-x_0)(x_2-x_1)} \end{equation*}
  2. Symmetry Property: Divided differences are symmetric with respect to their argumentsβ€”they are independent of the order of the nodes. For example:
    \begin{equation*} f[x_0, x_1, x_2] = f[x_1, x_0, x_2] = f[x_1, x_2, x_0] = f[x_2, x_1, x_0] = f[x_2, x_0, x_1] = f[x_0, x_2, x_1] \end{equation*}
  3. If \(f(x)\) is a polynomial of degree \(m\text{,}\) then the \(i\)-th order divided difference \(f[x_0, \ldots, x_{i-1}, x]\) with respect to \(x_0, \ldots, x_{i-1}, x\) is a polynomial of degree \(m - i\) when \(i \leq m\text{,}\) and is identically zero when \(i > m\text{.}\)
From (10.3.3), we see that constructing the Newton interpolation polynomial reduces to computing divided differences. The computation of divided differences can be carried out row by row in a table format, as shown in TableΒ 10.3.5.
Table 10.3.5. Divided Difference Table
\(x\) \(f(x)\) 1st order 2nd order 3rd order \(\cdots\) \(n\)-th order
\(x_0\) \(\boxed{f(x_0)}\)
\(x_1\) \(f(x_1)\) \(\boxed{f[x_0, x_1]}\)
\(x_2\) \(f(x_2)\) \(f[x_1, x_2]\) \(\boxed{f[x_0, x_1, x_2]}\)
\(x_3\) \(f(x_3)\) \(f[x_2, x_3]\) \(f[x_1, x_2, x_3]\) \(\boxed{f[x_0, x_1, x_2, x_3]}\)
\(\vdots\) \(\vdots\) \(\vdots\) \(\vdots\) \(\vdots\) \(\ddots\)
\(x_n\) \(f(x_n)\) \(f[x_{n-1}, x_n]\) \(f[x_{n-2}, x_{n-1}, x_n]\) \(f[x_{n-3}, \ldots, x_n]\) \(\cdots\) \(\boxed{f[x_0, \ldots, x_n]}\)
Note: The boxed values in the table are the coefficients of the Newton interpolation polynomial.

Computing Divided Differences with SageMath.

We can use SageMath to compute divided differences automatically. The following code implements a recursive function that computes the \(i\)-th order divided difference \(f[x_i, x_{i+1}, \ldots, x_j]\text{:}\)
For practical computation, it’s more efficient to build the entire divided difference table at once using dynamic programming: There is an error in the code, fix it.

Remark 10.3.6.

The correction code.

Example 10.3.7. Newton Interpolation with Tabular Data.

Given the data table:
\(x_i\) \(1.0\) \(2.7\) \(3.2\) \(4.8\) \(5.6\)
\(f_i\) \(14.2\) \(17.8\) \(22.0\) \(38.2\) \(51.7\)
  1. Find an interpolating polynomial \(p_3(x)\) of degree at most 3 that passes through the first four data points.
  2. Find an interpolating polynomial \(p_4(x)\) of degree at most 4 that passes through all five data points, and compute an approximate value for \(f(4.0)\text{.}\)
Solution.
The divided difference computation is shown in TableΒ 10.3.8.
Table 10.3.8. Divided Difference Calculations for ExampleΒ 10.3.7
\(x_i\) \(f_i\) 1st order 2nd order 3rd order 4th order
\(1.0\) \(\boxed{14.2}\)
\(2.7\) \(17.8\) \(\boxed{2.118}\)
\(3.2\) \(22.0\) \(8.400\) \(\boxed{2.855}\)
\(4.8\) \(38.2\) \(10.125\) \(0.821\) \(\boxed{-0.535}\)
\(5.6\) \(51.7\) \(16.875\) \(2.813\) \(0.687\) \(\boxed{0.266}\)
(1) The interpolating polynomial passing through the first four data points is:
\begin{align*} p_3(x) = 14.2 \amp + 2.118(x - 1.0) + 2.855(x - 1.0)(x - 2.7)\\ \amp - 0.535(x - 1.0)(x - 2.7)(x - 3.2) \end{align*}
(2) The interpolating polynomial passing through all five data points is:
\begin{align*} p_4(x) = p_3(x) \amp + 0.266(x - 1.0)(x - 2.7)(x - 3.2)(x - 4.8)\\ = 14.2 \amp + 2.118(x - 1.0) + 2.855(x - 1.0)(x - 2.7)\\ \amp - 0.535(x - 1.0)(x - 2.7)(x - 3.2)\\ \amp + 0.266(x - 1.0)(x - 2.7)(x - 3.2)(x - 4.8) \end{align*}
To compute \(f(4.0) \approx p_4(4.0)\text{,}\) we use nested multiplication (Horner’s method):
\begin{align*} f(4.0) \approx p_4(4.0) = \amp \{[[0.266(4.0 - 4.8) - 0.535](4.0 - 3.2)\\ \amp + 2.855](4.0 - 2.7) + 2.118\}(4.0 - 1.0) + 14.2\\ = \amp 29.355 \end{align*}
Therefore, the approximate value of \(f(4.0)\) is \(29.355\text{.}\)

Remark 10.3.9. Advantages of Newton Interpolation.

ExampleΒ 10.3.7 clearly demonstrates the main advantage of Newton interpolation over Lagrange interpolation: when adding new nodes, we simply add new terms to the existing polynomial rather than recomputing everything from scratch. This recursive structure makes Newton interpolation particularly efficient for incremental interpolation.
Additionally, the nested form (Horner’s method) used in part (2) provides an efficient way to evaluate the polynomial, requiring only \(n\) multiplications and \(n\) additions for a degree-\(n\) polynomial, compared to \(O(n^2)\) operations for direct evaluation.