Newton Divided Difference Calculator

Build the divided difference table and Newton interpolating polynomial for your points.

Formula

P(x) = f[x₀] + f[x₀,x₁](x − x₀) + f[x₀,x₁,x₂](x − x₀)(x − x₁) + …

Each coefficient is a divided difference, built column by column from the one before:

f[xᵢ, …, xᵢ₊ₖ] = (f[xᵢ₊₁, …, xᵢ₊ₖ] − f[xᵢ, …, xᵢ₊ₖ₋₁]) / (xᵢ₊ₖ − xᵢ)

Example

The default points are ln(x) at x = 1, 2, 4, 5. The top row of the table gives the coefficients 0, 0.6931, −0.1155 and 0.01858, so

P(3) = 0.6931·2 − 0.1155·2·1 + 0.01858·2·1·(−1) ≈ 1.1180

The true value is ln 3 ≈ 1.0986, so a cubic through four points is off by about 2%.

Reading the divided difference table

The first column is y. Each later entry takes the two entries to its left (the one in the same row and the one below), subtracts them and divides by the spread of the x values they cover. Only the top entry of each column is used in the polynomial; the rest are stepping stones.

If a column is constant, the next one is zero and the data lies exactly on a polynomial of that degree.

Error and choosing points

The next divided difference, times (x − x₀)(x − x₁)…(x − xₙ), estimates the error. Points close to x keep that product small. With more than 6–8 points, the polynomial starts to oscillate; use a cubic spline instead.

FAQ

Is Newton’s polynomial different from Lagrange’s?

No. Through the same points both give exactly the same polynomial, just written differently. Compare with the Lagrange calculator.

Do the x values need to be equally spaced?

No. Divided differences work with any spacing and in any order. Each x must be unique.

How do I add another point?

Add a line at the end. The existing coefficients stay the same and one new column and term appear, which is the main advantage of Newton’s form.