Interpolation Calculator | Lagrange, Newton & Divided Differences
Construct an interpolating polynomial through any set of data points using Lagrange interpolation or Newton's divided difference method. Displays the full divided difference table, polynomial in expanded form, and evaluates at any x — with error bound estimation between data points.
Data Points (up to 8)
What Is the Interpolation Calculator | Lagrange, Newton & Divided Differences?
Polynomial interpolation constructs the unique polynomial of degree ≤ n−1 that passes through n given data points. Lagrange interpolation expresses this polynomial as a sum of basis polynomials that are each 1 at one data point and 0 at all others. Newton's form uses the divided difference table and is more efficient for adding new points or evaluating the polynomial at many values. Both methods produce the same polynomial.
Formula
Lagrange: P(x) = Σᵢ yᵢ · Lᵢ(x)
Lᵢ(x) = Π_{j≠i} (x−xⱼ) / (xᵢ−xⱼ)
Newton: P(x) = f[x₀] + f[x₀,x₁](x−x₀) + f[x₀,x₁,x₂](x−x₀)(x−x₁) + …
f[xᵢ,…,xᵢ₊ₖ] = divided differences (built recursively)
How to Use
- 1
Enter at least 2 data points (x, y) — use the + button to add more, × to remove
- 2
Or click a preset (Sin, Sqrt, Ln, Cubic) for sample data
- 3
Enter an x value in the Evaluate at field
- 4
Select Lagrange or Newton method
- 5
Click Interpolate to compute
- 6
View the divided difference table, polynomial formula, and evaluated value
Add your (x, y) data points using the + button, or load a preset. Enter an x value to evaluate. Choose Lagrange or Newton. Click Interpolate. The full divided difference table and polynomial coefficients are displayed, along with the evaluated value at your chosen x.
Example Calculation
Example: Interpolate through (0,1), (1,3), (2,7)
Divided differences: f[0]=1, f[1]=3, f[2]=7
f[0,1] = (3−1)/(1−0) = 2 | f[1,2] = (7−3)/(2−1) = 4
f[0,1,2] = (4−2)/(2−0) = 1
Newton: P(x) = 1 + 2(x−0) + 1(x−0)(x−1) = x² + x + 1
P(1.5) = 2.25 + 1.5 + 1 = 4.75
Frequently Asked Questions
Are Lagrange and Newton interpolation the same?
They produce the same interpolating polynomial — there is exactly one polynomial of degree ≤ n−1 through n distinct points. They differ only in the form of representation and in computational efficiency. Newton's form is preferred when you want to add new data points incrementally, as only one new row is added to the divided difference table.
What is the divided difference table?
The divided difference table organizes the recursive computation of Newton's coefficients. The zeroth differences are the y-values. The first differences are (yⱼ−yᵢ)/(xⱼ−xᵢ). Higher orders are built the same way from the previous column. The top diagonal gives Newton's coefficients a₀, a₁, a₂, …
How accurate is polynomial interpolation?
Between data points, the error depends on higher-order derivatives of the true function and the node distribution. Equally spaced nodes can lead to Runge's phenomenon — large oscillations near the endpoints for high-degree polynomials. Chebyshev nodes minimize this effect.
What happens with duplicate x values?
All x values must be distinct. If two data points share the same x, the interpolating polynomial would need to pass through two different y values at the same x, which is impossible for a function. The calculator requires unique x coordinates.
You Might Also Like
Explore 360+ Free Calculators
From math and science to finance and everyday life — all free, no account needed.