Newton’s Divided Differences
Newton’s divided differences build the polynomial that passes through a set of data points in Newton form: P(x) = f[x₀] + f[x₀, x₁](x − x₀) + f[x₀, x₁, x₂](x − x₀)(x − x₁) + …. The coefficients come from a divided-difference table, and adding a new data point adds just one new term.
Before this lesson: Lagrange Interpolation and Average Rate of Change
The idea: build the polynomial one point at a time
Lagrange interpolation writes the interpolating polynomial all at once. That works, but if one more data point arrives, every basis polynomial has to be rebuilt.
Newton’s form grows instead. Start with a constant that matches the first point. Add a linear term that is zero at the first point, so it fixes the second point without spoiling the first. Then add a quadratic term that is zero at the first two points, and so on. Each new term corrects the fit at one new point.
The coefficients of those terms are divided differences. The first divided difference f[x₀, x₁] is the slope between two points, the same as an average rate of change. The second divided difference measures how that slope changes, divided by the spread of the x-values, which is why it behaves like half a second derivative.
Divided difference formula and Newton form
Given n + 1 points (x₀, y₀), (x₁, y₁), …, (xₙ, yₙ) with different x-values, the divided differences are defined step by step:
\begin{aligned} f[x_i] &= y_i \\ f[x_i, x_{i+1}] &= \dfrac{f[x_{i+1}] - f[x_i]}{x_{i+1} - x_i} \\ f[x_i, \ldots, x_{i+k}] &= \dfrac{f[x_{i+1}, \ldots, x_{i+k}] - f[x_i, \ldots, x_{i+k-1}]}{x_{i+k} - x_i} \end{aligned}Each new difference subtracts two neighboring differences from the previous column and divides by the distance between the outermost x-values involved. The interpolating polynomial in Newton form is then
P_n(x) = f[x_0] + f[x_0, x_1](x - x_0) + f[x_0, x_1, x_2](x - x_0)(x - x_1) + \cdots + f[x_0, \ldots, x_n](x - x_0)(x - x_1)\cdots(x - x_{n-1})The coefficients are the top entries of the divided-difference table, one from each column. The table for four points looks like this:
Two facts make the method practical. First, a divided difference does not depend on the order of its points, so f[x₀, x₁, x₂] = f[x₂, x₀, x₁]. Second, this is the same polynomial Lagrange interpolation gives, because only one polynomial of degree n or less passes through n + 1 points with different x-values.
Newton’s divided differences examples
Example 1: A quadratic through three points
Find the polynomial through (1, 3), (2, 7) and (4, 21) using divided differences.
f[1, 2] = \dfrac{7 - 3}{2 - 1} = \dfrac{4}{1} = 4First divided difference of the first two points.
f[2, 4] = \dfrac{21 - 7}{4 - 2} = \dfrac{14}{2} = 7First divided difference of the last two points.
f[1, 2, 4] = \dfrac{7 - 4}{4 - 1} = \dfrac{3}{3} = 1Second divided difference: subtract the first differences and divide by 4 − 1, the spread of all three x-values.
P_2(x) = 3 + 4(x - 1) + 1(x - 1)(x - 2)
Write the Newton form with the top entries 3, 4 and 1.
P_2(x) = 3 + 4x - 4 + x^2 - 3x + 2
Expand each product (see multiplying binomials).
P_2(x) = x^2 + x + 1
Combine like terms.
Answer: P₂(x) = x² + x + 1. Check: P₂(1) = 3, P₂(2) = 7 and P₂(4) = 16 + 4 + 1 = 21.
Example 2: A full table for four points
Build the divided-difference table for x = −1, 0, 1, 3 with values 2, 1, 0, 22, write the Newton polynomial, and use it to estimate f(2).
f[-1, 0] = \dfrac{1 - 2}{0 - (-1)} = \dfrac{-1}{1} = -1First column: slope from x = −1 to x = 0.
f[0, 1] = \dfrac{0 - 1}{1 - 0} = -1Slope from x = 0 to x = 1.
f[1, 3] = \dfrac{22 - 0}{3 - 1} = \dfrac{22}{2} = 11Slope from x = 1 to x = 3.
f[-1, 0, 1] = \dfrac{-1 - (-1)}{1 - (-1)} = \dfrac{0}{2} = 0Second column: divide by 1 − (−1) = 2.
f[0, 1, 3] = \dfrac{11 - (-1)}{3 - 0} = \dfrac{12}{3} = 4Divide by 3 − 0 = 3.
f[-1, 0, 1, 3] = \dfrac{4 - 0}{3 - (-1)} = \dfrac{4}{4} = 1Third column: divide by 3 − (−1) = 4.
P_3(x) = 2 - (x + 1) + 0(x + 1)x + 1(x + 1)x(x - 1)
Use the top entries 2, −1, 0 and 1.
P_3(x) = 2 - x - 1 + x^3 - x
Expand: (x + 1)x(x − 1) = x(x² − 1) = x³ − x, and the zero term drops out.
P_3(x) = x^3 - 2x + 1
Combine like terms.
P_3(2) = 8 - 4 + 1 = 5
Substitute x = 2.
Answer: P₃(x) = x³ − 2x + 1, and f(2) ≈ 5. A zero in the table is fine: it only means that term is missing.
Example 3: Adding a new data point
Add the point (5, 26) to the data of Example 1 and update the polynomial.
f[4, 5] = \dfrac{26 - 21}{5 - 4} = 5Add one new entry to the first column.
f[2, 4, 5] = \dfrac{5 - 7}{5 - 2} = -\dfrac{2}{3}Add one new entry to the second column.
f[1, 2, 4, 5] = \dfrac{-\frac{2}{3} - 1}{5 - 1} = \dfrac{-\frac{5}{3}}{4} = -\dfrac{5}{12}The new top entry of the third column.
P_3(x) = P_2(x) - \dfrac{5}{12}(x - 1)(x - 2)(x - 4)Keep P₂ from Example 1 and add one term.
P_3(5) = 31 - \dfrac{5}{12}(4)(3)(1)Check at x = 5: P₂(5) = 25 + 5 + 1 = 31.
P_3(5) = 31 - 5 = 26
The new point is matched.
Answer: P₃(x) = x² + x + 1 − (5/12)(x − 1)(x − 2)(x − 4). The old work was reused; only one diagonal of new entries was computed.
Example 4: Evaluating Newton form with nested multiplication
Evaluate the polynomial from Example 2 at x = 2 without expanding it, using nested form.
Newton form can be nested like synthetic division: P₃(x) = 2 + (x + 1)(−1 + x(0 + (x − 1)(1))). Work from the inside out.
1 \cdot (2 - 1) = 1
Start with the last coefficient, 1, and multiply by (x − x₂) = 2 − 1.
0 + 1 = 1
Add the next coefficient, 0.
1 \cdot (2 - 0) = 2
Multiply by (x − x₁) = 2 − 0.
-1 + 2 = 1
Add the next coefficient, −1.
1 \cdot (2 + 1) = 3
Multiply by (x − x₀) = 2 − (−1).
2 + 3 = 5
Add the first coefficient, 2.
Answer: P₃(2) = 5, matching Example 2. Nested form needs only n multiplications for degree n.
Example 5: Estimating a car’s position (word problem)
A car’s dash camera logs its distance d (in meters) from a stop sign at a few times t (in seconds): d(0) = 0, d(2) = 18, d(5) = 60 and d(6) = 75. Estimate the distance at t = 4 s.
d[0, 2] = \dfrac{18 - 0}{2 - 0} = 9First differences are average speeds in m/s.
d[2, 5] = \dfrac{60 - 18}{5 - 2} = \dfrac{42}{3} = 14Average speed from t = 2 to t = 5.
d[5, 6] = \dfrac{75 - 60}{6 - 5} = 15Average speed from t = 5 to t = 6.
d[0, 2, 5] = \dfrac{14 - 9}{5 - 0} = 1Second column: divide by 5 − 0.
d[2, 5, 6] = \dfrac{15 - 14}{6 - 2} = 0.25Divide by 6 − 2.
d[0, 2, 5, 6] = \dfrac{0.25 - 1}{6 - 0} = -0.125Third column: divide by 6 − 0.
P_3(t) = 9t + t(t - 2) - 0.125\,t(t - 2)(t - 5)
Newton form; the constant term is d(0) = 0.
P_3(4) = 9(4) + 4(2) - 0.125(4)(2)(-1)
Substitute t = 4.
P_3(4) = 36 + 8 + 1 = 45
Multiply each term, then add.
Answer: about 45 m from the stop sign at t = 4 s. This is an estimate: the polynomial fits the four readings exactly, but the car’s true motion between readings is unknown.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Dividing by neighboring x-values in later columns | f[1, 2, 4] = \dfrac{7 - 4}{4 - 2} | Divide by the outermost x-values: 4 − 1 = 3. |
| Subtracting in the wrong order | f[1, 2] = \dfrac{3 - 7}{2 - 1} | Subtract the earlier value from the later one, matching the order of the x-values. |
| Using a bottom entry as a coefficient | Using f[2, 4] = 7 as the linear coefficient | Newton form uses the top entry of each column, the ones that start at x₀. |
| Including every factor in the last product | f[x_0, x_1, x_2](x - x_0)(x - x_1)(x - x_2) | The term for k + 1 points has k factors, stopping at (x − xₖ₋₁). |
| Rebuilding the whole table when a point is added | Recomputing every entry for one new point | Add the new point at the bottom and compute only the new diagonal. |
Related methods
Lagrange form vs. Newton form
| Feature | Lagrange form | Newton form |
|---|---|---|
| The polynomial | Same | Same |
| Coefficients | The y-values themselves | Divided differences from a table |
| Adding a data point | Rebuild every basis polynomial | Add one term |
| Evaluating at many x-values | More work per value | Fast with nested multiplication |
Forward differences for equally spaced data
When the x-values are equally spaced by h, divided differences simplify to forward differences: f[x₀, …, xₖ] = Δᵏy₀ / (k! hᵏ). For y = 1, 2, 9, 28 at x = 0, 1, 2, 3, the differences are Δy = 1, 7, 19, then Δ²y = 6, 12, then Δ³y = 6, so f[x₀, x₁, x₂, x₃] = 6/(3! · 1³) = 1.
Divided differences and derivatives
If f has n derivatives, then f[x₀, …, xₙ] = f⁽ⁿ⁾(c)/n! for some c between the smallest and largest node. This links divided differences to the coefficients of a Taylor polynomial, and it is the key to the error bound in Interpolation Error, the next lesson.
Practice problems
- Find f[2, 5] if f(2) = 7 and f(5) = 19.
- Find f[1, 3, 4] if f(1) = 2, f(3) = 10 and f(4) = 17.
- Use divided differences to find the polynomial through (0, 1), (1, 4) and (2, 11).
- Use divided differences to find the polynomial through (−1, 5), (1, 1) and (2, 8).
- Build the divided-difference table for x = 0, 1, 2, 3 with values −2, 0, 6, 22, and write the Newton polynomial.
- Add the point (3, 20) to the data of Problem 3 and update the polynomial.
- Evaluate P(x) = 4 + 2(x − 1) − 3(x − 1)(x − 2) + (x − 1)(x − 2)(x − 3) at x = 5 using nested multiplication.
- Using the data of Problem 2, compute f[4, 1, 3] and compare it with f[1, 3, 4].
- Use the points (1, 1), (4, 2) and (9, 3) on y = √x to estimate √5, and find the error.
- A thermometer reads 12 °C at 6 am, 18 °C at 8 am and 20 °C at 10 am. Let t be hours after 6 am. Use a quadratic in Newton form to estimate the temperature at 9 am.
Show answers
1.
f[2, 5] = \dfrac{19 - 7}{5 - 2}Subtract the values and divide by the difference of the x-values.
= \dfrac{12}{3} = 4Simplify.
Answer: f[2, 5] = 4
2.
f[1, 3] = \dfrac{10 - 2}{3 - 1} = \dfrac{8}{2} = 4First divided difference.
f[3, 4] = \dfrac{17 - 10}{4 - 3} = 7First divided difference.
f[1, 3, 4] = \dfrac{7 - 4}{4 - 1} = \dfrac{3}{3} = 1Divide by the outermost spread, 4 − 1.
Answer: f[1, 3, 4] = 1
3.
f[0, 1] = \dfrac{4 - 1}{1 - 0} = 3First divided difference.
f[1, 2] = \dfrac{11 - 4}{2 - 1} = 7First divided difference.
f[0, 1, 2] = \dfrac{7 - 3}{2 - 0} = 2Second divided difference.
P(x) = 1 + 3x + 2x(x - 1)
Newton form with top entries 1, 3 and 2.
P(x) = 1 + 3x + 2x^2 - 2x
Distribute 2x.
P(x) = 2x^2 + x + 1
Combine like terms.
Answer: P(x) = 2x² + x + 1
4.
f[-1, 1] = \dfrac{1 - 5}{1 - (-1)} = \dfrac{-4}{2} = -2First divided difference.
f[1, 2] = \dfrac{8 - 1}{2 - 1} = 7First divided difference.
f[-1, 1, 2] = \dfrac{7 - (-2)}{2 - (-1)} = \dfrac{9}{3} = 3Second divided difference.
P(x) = 5 - 2(x + 1) + 3(x + 1)(x - 1)
Newton form with top entries 5, −2 and 3.
P(x) = 5 - 2x - 2 + 3x^2 - 3
Expand; (x + 1)(x − 1) = x² − 1.
P(x) = 3x^2 - 2x
Combine like terms.
Answer: P(x) = 3x² − 2x
5.
f[0, 1] = 2,\quad f[1, 2] = 6,\quad f[2, 3] = 16
First column: (0 − (−2))/1, (6 − 0)/1 and (22 − 6)/1.
f[0, 1, 2] = \dfrac{6 - 2}{2} = 2,\quad f[1, 2, 3] = \dfrac{16 - 6}{2} = 5Second column: divide by 2 − 0 and 3 − 1.
f[0, 1, 2, 3] = \dfrac{5 - 2}{3 - 0} = 1Third column.
P(x) = -2 + 2x + 2x(x - 1) + x(x - 1)(x - 2)
Newton form with top entries −2, 2, 2 and 1.
Answer: P(x) = −2 + 2x + 2x(x − 1) + x(x − 1)(x − 2), which expands to x³ − x² + 2x − 2
6.
f[2, 3] = \dfrac{20 - 11}{3 - 2} = 9New first-column entry.
f[1, 2, 3] = \dfrac{9 - 7}{3 - 1} = 1New second-column entry.
f[0, 1, 2, 3] = \dfrac{1 - 2}{3 - 0} = -\dfrac{1}{3}New top entry of the third column.
P_3(x) = 2x^2 + x + 1 - \dfrac{1}{3}x(x - 1)(x - 2)Add one term to the answer to Problem 3.
P_3(3) = 22 - \dfrac{1}{3}(3)(2)(1) = 22 - 2 = 20Check the new point.
Answer: P₃(x) = 2x² + x + 1 − (1/3)x(x − 1)(x − 2)
7.
1 \cdot (5 - 3) = 2
Last coefficient times (x − 3).
-3 + 2 = -1
Add the next coefficient.
-1 \cdot (5 - 2) = -3
Multiply by (x − 2).
2 + (-3) = -1
Add the next coefficient.
-1 \cdot (5 - 1) = -4
Multiply by (x − 1).
4 + (-4) = 0
Add the first coefficient.
Answer: P(5) = 0
8.
f[4, 1] = \dfrac{2 - 17}{1 - 4} = \dfrac{-15}{-3} = 5First divided difference in the new order.
f[1, 3] = 4
From Problem 2.
f[4, 1, 3] = \dfrac{4 - 5}{3 - 4} = \dfrac{-1}{-1} = 1Divide by the outermost x-values, 3 − 4.
Answer: f[4, 1, 3] = 1 = f[1, 3, 4]; the order of the points does not matter
9.
f[1, 4] = \dfrac{2 - 1}{4 - 1} = \dfrac{1}{3}First divided difference.
f[4, 9] = \dfrac{3 - 2}{9 - 4} = \dfrac{1}{5}First divided difference.
f[1, 4, 9] = \dfrac{\frac{1}{5} - \frac{1}{3}}{9 - 1} = \dfrac{-\frac{2}{15}}{8} = -\dfrac{1}{60}Second divided difference.
P(5) = 1 + \dfrac{1}{3}(4) - \dfrac{1}{60}(4)(1)Substitute x = 5 into 1 + (1/3)(x − 1) − (1/60)(x − 1)(x − 4).
P(5) = \dfrac{15}{15} + \dfrac{20}{15} - \dfrac{1}{15} = \dfrac{34}{15} \approx 2.266667Write over 15 and add.
\left|2.266667 - 2.236068\right| \approx 0.030599
Compare with √5 ≈ 2.236068.
Answer: √5 ≈ 34/15 ≈ 2.2667, with an error of about 0.031
10.
T[0, 2] = \dfrac{18 - 12}{2 - 0} = 3Average warming rate from 6 to 8 am, in °C per hour.
T[2, 4] = \dfrac{20 - 18}{4 - 2} = 1Average warming rate from 8 to 10 am.
T[0, 2, 4] = \dfrac{1 - 3}{4 - 0} = -0.5Second divided difference.
P(3) = 12 + 3(3) - 0.5(3)(3 - 2)
Substitute t = 3 into 12 + 3t − 0.5t(t − 2).
P(3) = 12 + 9 - 1.5 = 19.5
Multiply, then add.
Answer: about 19.5 °C at 9 am
Newton’s divided differences FAQ
What is a divided difference?
A divided difference is a difference of function values divided by a difference of x-values. The first one, f[x₀, x₁] = (f(x₁) − f(x₀))/(x₁ − x₀), is the slope between two points, and higher ones are built from it recursively.
What is the Newton form of the interpolating polynomial?
It is P(x) = f[x₀] + f[x₀, x₁](x − x₀) + f[x₀, x₁, x₂](x − x₀)(x − x₁) + …, with the coefficients taken from the top of the divided-difference table.
Do Newton and Lagrange interpolation give the same polynomial?
Yes. Through n + 1 points with different x-values there is exactly one polynomial of degree n or less, so both methods produce it. They only write it in different forms.
Why use Newton’s divided differences instead of Lagrange?
Adding a data point only adds one term in Newton form, and nested multiplication makes evaluation fast. Lagrange form is often easier for theory and for writing the polynomial down in one line.
Summary
- The first divided difference is the slope between two points; each later one subtracts neighboring entries and divides by the spread of the outermost x-values.
- The top entry of each column of the table is a coefficient of the Newton form.
- P(x) = f[x₀] + f[x₀, x₁](x − x₀) + f[x₀, x₁, x₂](x − x₀)(x − x₁) + ….
- Adding a point adds one diagonal to the table and one term to the polynomial.
- Newton form gives the same polynomial as Lagrange interpolation and evaluates quickly in nested form.
Previous lesson: Lagrange Interpolation
Next lesson: Interpolation Error
Back to the Numerical Methods Index