Lagrange Interpolation Calculator
Lagrange’s polynomial passes through every data point: through the cubes of 1–4 it gives P(2.5) = 15.625, exactly 2.5³.
15.625
Full answer, then cut to fewer decimals (not rounded):
- 15.625
- 15.62
- 15.6
- Interpolating polynomial
- P(x) = x^3
- Degree
- 3
| i | xᵢ | yᵢ | Lᵢ(x) | yᵢ·Lᵢ(x) |
|---|---|---|---|---|
| 0 | 1 | 1 | -0.0625 | -0.0625 |
| 1 | 2 | 8 | 0.5625 | 4.5 |
| 2 | 3 | 27 | 0.5625 | 15.1875 |
| 3 | 4 | 64 | -0.0625 | -4 |
Step-by-step solution
- P(x) = Σ yᵢ·Lᵢ(x), Lᵢ(x) = Π (x − xⱼ)/(xᵢ − xⱼ) for j ≠ i
- P(2.5) = 1×-0.0625 + 8×0.5625 + 27×0.5625 + 64×-0.0625
- = 15.625
Lagrange Interpolation Formula
P(x) = Σ yᵢ Π (x − xⱼ)/(xᵢ − xⱼ)
degree ≤ n − 1 through n points
Worked Example
The points (1, 1), (2, 8), (3, 27), (4, 64) at x = 2.5:
- P(x) = Σ yᵢ·Lᵢ(x), Lᵢ(x) = Π (x − xⱼ)/(xᵢ − xⱼ) for j ≠ i
- P(2.5) = 1×-0.0625 + 8×0.5625 + 27×0.5625 + 64×-0.0625
- = 15.625
Degree: 3
| i | xᵢ | yᵢ | Lᵢ(x) | yᵢ·Lᵢ(x) |
|---|---|---|---|---|
| 0 | 1 | 1 | -0.0625 | -0.0625 |
| 1 | 2 | 8 | 0.5625 | 4.5 |
| 2 | 3 | 27 | 0.5625 | 15.1875 |
| 3 | 4 | 64 | -0.0625 | -4 |
GATE tip
For two points Lagrange reduces to linear interpolation: y = y₀ + (y₁ − y₀)(x − x₀)/(x₁ − x₀), the most common GATE interpolation question.
More Numerical Methods Calculators
-
Newton Interpolation Calculator
P(x) = f[x₀] + f[x₀,x₁](x − x₀) + f[x₀,x₁,x₂](x − x₀)(x − x₁) + …
f[xᵢ,…,xᵢ₊ₖ] = (f[xᵢ₊₁,…] − f[xᵢ,…]) ÷ (xᵢ₊ₖ − xᵢ)
Example: The points (1, 1), (2, 8), (3, 27), (4, 64) at x = 2.5: P(2.5) = 15.625.
-
Newton-Raphson Method Calculator
xₙ₊₁ = xₙ − f(xₙ) ÷ f′(xₙ)
quadratic convergence near a simple root
Example: f(x) = x³ − 2x − 5 starting at x₀ = 2: Root x ≈ 2.09455148154.
-
Bisection Method Calculator
c = (a + b)/2; regula falsi c = (a·f(b) − b·f(a)) ÷ (f(b) − f(a))
keep the half where f changes sign
Example: f(x) = x³ − x − 2 on [1, 2]: Root x ≈ 1.5213804245.
-
Secant Method Calculator
xₙ₊₁ = xₙ − f(xₙ)(xₙ − xₙ₋₁) ÷ (f(xₙ) − f(xₙ₋₁))
order of convergence ≈ 1.618
Example: f(x) = x² − 612 starting from 10 and 30: Root x ≈ 24.7386337537.
Frequently asked questions
When should I use Lagrange rather than Newton interpolation?
Lagrange works directly for unequally spaced points; Newton’s divided differences are easier to extend when a point is added.
Is the interpolating polynomial unique?
Yes: through n points with distinct x there is exactly one polynomial of degree ≤ n − 1, so Lagrange and Newton give the same answer.
Sources
Last reviewed: . Factors are stored exactly and computed with 50-digit decimal arithmetic. See how we verify conversion factors.
Cite this page
APA
Scientific Converters. (2026, October 15). Lagrange Interpolation Calculator. Retrieved October 25, 2026, from https://scientificconverters.com/calculators/lagrange-interpolation-calculator/
IEEE
Scientific Converters, "Lagrange Interpolation Calculator," scientificconverters.com. Accessed: Oct. 25, 2026. [Online]. Available: https://scientificconverters.com/calculators/lagrange-interpolation-calculator/