| x | P(x) | Exact |
|---|
Lagrange interpolation calculator: find the polynomial through your points, evaluate it at any x, and copy it as text, LaTeX or an Excel formula.
Lagrange interpolation step by step: every basis polynomial, its value at x, the weighted sum and the expanded polynomial, with exact fractions.
Runge phenomenon demo: interpolate any function with equally spaced or Chebyshev points and compare the largest error as the degree grows.
A way to find the polynomial of lowest degree that passes exactly through a set of points. With n points you get a polynomial of degree n − 1 or less, and there is only one.
P(x) = Σ yᵢ Lᵢ(x), where each basis polynomial Lᵢ(x) = ∏ (x − xⱼ) / (xᵢ − xⱼ) over every other point j. Lᵢ is 1 at xᵢ and 0 at every other xⱼ.
Each Lᵢ divides by xᵢ − xⱼ, which would be zero. A function also can't pass through two different y values at the same x.
Yes. Both give the same unique polynomial. Newton's divided differences just build it in a different order, which makes adding a point cheaper.
With many equally spaced points, the polynomial can swing wildly near the ends of the interval, even for a smooth function like 1/(1 + 25x²). Chebyshev points, bunched toward the ends, fix it. Try it on the Runge & Error tab.
That's extrapolation. Polynomials often shoot off beyond the data, so trust values between your smallest and largest x much more.
The polynomial, its coefficients and P(x) are worked out with exact fractions, so nothing is rounded until it's displayed. The charts use the barycentric formula, a stable way to plot the same polynomial.
Learn Lagrange interpolation: the formula, the basis polynomials, how to do it by hand, and how it compares with Newton's method.