2026-09-29 9 min

Polynomial Interpolation Calculator

Fit the unique quadratic through three points with Lagrange interpolation, coefficients and residual verification. Free online calculator.

Calculator

Three Points

x₁ Help

First node

y₁ Help

First value

x₂ Help

Second node

y₂ Help

Second value

x₃ Help

Third node

y₃ Help

Third value

Results update live as you type
Status:(0, 1) (1, 3) (2, 7)f(x) = 1x² + 1x + 1

Interpolation Summary

f(x)1x² + 1x + 1
a / b / c1 / 1 / 1
Max residual0.00e+0

Residual Check

f(0) = 1 vs y = 1 → residual 0

f(1) = 3 vs y = 3 → residual 0

f(2) = 7 vs y = 7 → residual 0

Results

Optimal

Interpolant f(x)

1x² + 1x + 1

Unique quadratic through all three points

a (x² coeff)

1

Curvature amount

b (x coeff)

1

Tilt component

c (constant)

1

Value at x = 0

Max |residual|

0

Largest f(xᵢ) − yᵢ gap

Fit Type

True quadratic

Quadratic, line or constant

Coefficients come from Cramer's rule on the Vandermonde system and every node is verified with an explicit residual near machine zero.

Visualizations

|Coefficient| Sizes

1a
1b
1c

Fit Completeness

Fitted100%

Max Residual vs Tolerance 1e-9

error0

Formula

Three constraints pin three coefficients; Cramer determinants extract each one from the Vandermonde system.

f(x) = ax² + bx + c with axᵢ² + bxᵢ + c = yᵢ (i = 1, 2, 3)

Alternative Form

Lagrange form: f(x) = Σ yᵢ·lᵢ(x), lᵢ(xⱼ) = δᵢⱼ

Variables

SymbolNameUnitDescription
xᵢ, yᵢData pointspairsThree nodes with distinct x
a, b, cCoefficientsnumbersSolved via determinants
detVandermonde detnumberNonzero ⟺ unique fit
residualFit errornumberf(xᵢ) − yᵢ, should be ~0

Explanation

Each Lagrange basis polynomial passes through exactly one node, so weighting by yᵢ threads the curve through all three.

Derivation

Substituting the nodes gives M·[a b c]ᵀ = y with Vandermonde M; det M = Π(xⱼ − xᵢ) ≠ 0 for distinct nodes, so Cramer yields the unique solution.

Step-by-Step Calculation

Follow each step to understand how the result is calculated from your inputs.

Step 1

Write the system axᵢ² + bxᵢ + c = yᵢ.

one equation per point
P1:(0, 1)
P2:(1, 3)
P3:(2, 7)
Result: 3 equations, 3 unknowns
Step 2

Form the Vandermonde determinant.

det of [[xᵢ², xᵢ, 1]]
det:-2
Intermediate: det = -2
Result: Nonzero → unique solution
Step 3

Solve with Cramer's rule (replace each column by y).

a = det_a/det, b = det_b/det, c = det_c/det
a:1
b:1
c:1
Result: a = 1, b = 1, c = 1
Step 4

Write the interpolant.

f(x) = ax² + bx + c
f:1x² + 1x + 1
Result: f(x) = 1x² + 1x + 1
Step 5

Verify at all three nodes.

residual = f(xᵢ) − yᵢ
r1:0
r2:0
r3:0
Result: Max |residual| = 0.00e+0 ✓
Step 6

Classify the fit.

a ≠ 0 quadratic; a = 0 line/constant
kind:True quadratic
Result: True quadratic
Final Answer
1x² + 1x + 1

Worked Examples

See how the calculator works with different scenarios.

Scenario

Classic quadratic data.

Inputs

x1:0
y1:1
x2:1
y2:3
x3:2
y3:7

Calculation

Solve → a=1, b=1, c=1

Result

f(x) = 1x² + 1x + 1

Interpretation

Check: f(2) = 4+2+1 = 7 ✓.

Understanding Your Result

Your Result: Interpolating quadratic with coefficients and residuals

Typical range: Residuals ~1e-15 (exact); a = 0 flags collinear data.

What This Means

The unique degree-≤2 curve threading all three points — exact at the nodes, smooth between them.

Why It Matters

It fills table gaps, animates keyframes, derives Simpson’s rule, and calibrates instruments from three readings.

Professional Interpretation

Trust interpolation between outer nodes; distrust extrapolation beyond them — quadratics run away fast.

Recommendations

  • •Keep x-values distinct
  • •Check residuals ≈ 0
  • •Expect a = 0 for lines
  • •Interpolate, avoid extrapolating
  • •Plot to confirm shape

Educational Content

Introduction

This calculator fits the unique quadratic through any three non-degenerate points and proves the fit with residuals.

Concept Explanation

Three independent constraints determine three coefficients; determinants divide out each unknown cleanly.

Applications

▸Table-gap filling
▸Keyframe animation
▸Simpson's rule derivation
▸Sensor calibration
▸Trajectory threading
▸Yield-curve smoothing

Benefits

  • •Unique-fit guarantee stated
  • •Cramer steps transparent
  • •Residuals auto-checked
  • •Degenerate cases detected
  • •Live curve plot

Limitations

  • •Exactly three points
  • •Degree ≤ 2 output
  • •Distinct x required

Best Practices

  • •Sort nodes for readability
  • •Verify residuals
  • •Watch for a = 0 lines
  • •Stay inside the node span
  • •Scale wild coordinates

Common Misconceptions

Myth: Any three points give a true quadratic.
Truth: Collinear triples give a line (a = 0) — still the correct unique fit.
Myth: Point order changes the answer.
Truth: Row order does not change the solution set.
Myth: Interpolation works far outside.
Truth: Extrapolation error grows quadratically — stay between nodes.
Myth: More points always help.
Truth: Extra points over-constrain degree 2; use regression instead.

Practical Tips

  • •Keep x distinct
  • •Three points exactly
  • •Read a as curvature
  • •Check residuals ≈ 0
  • •a = 0 means collinear
  • •Stay between nodes
  • •Re-plot after edits

Common Mistakes

Repeating an x-value
Nudge or remove the duplicate node.
Expecting nonzero a always
Collinear data legitimately yields a = 0.
Extrapolating far out
Confine estimates to the node span.
Misreading residual notation
1e-16 means essentially zero.
Swapping x and y columns
x sets position, y sets height.

Assumptions

This calculator makes the following assumptions to provide estimates:

Distinct nodes: x₁, x₂, x₃ are pairwise different.
Function data: Each x maps to one y.
Degree ≤ 2: Output is at most quadratic.
Real arithmetic: All coordinates are real.
Exact nodes: Points are treated as exact.

Limitations

Be aware of these limitations when using this calculator:

Three points only: Larger datasets need regression.
No error bars: Noisy data is fit exactly, warts included.
Extrapolation risk: Tails diverge quadratically.
Display rounding: Coefficients show 6 digits.

Frequently Asked Questions

Answers to common questions about this calculator.

What is Lagrange interpolation?
A method building the unique lowest-degree polynomial through given points as a weighted sum of basis polynomials, each 1 at its own node and 0 at the others.
Why do three points give a quadratic?
A quadratic ax² + bx + c has three free coefficients, and three points supply three equations — exactly enough for (usually) one solution.
How do you solve for a, b, c?
Substitute each point into ax² + bx + c = y to get a 3×3 linear system, then solve by elimination or Cramer’s rule (determinants). This page shows the determinant route.
What if the x-values repeat?
Two points sharing an x (with different y) cannot sit on one function graph — the system has no solution. Equal points make it singular too.
When does a line come out instead?
If the three points are collinear, the solved a equals 0 and the "quadratic" collapses to the line through them — still a perfect fit.
How do I verify the interpolant?
Plug each x back in: f(xᵢ) must equal yᵢ exactly (up to rounding). The residual table here does that check automatically.
What is interpolation vs extrapolation?
Interpolation estimates between the nodes (safe); extrapolation extends beyond them (risky — quadratics diverge fast).
Where is quadratic interpolation used?
Filling table gaps, animating smooth paths through keyframes, numerical integration (Simpson’s rule), and calibrating sensors from three readings.
Does order of points matter?
No — any order gives the same unique polynomial, since the system of equations is the same set regardless of row order.

Related Calculators

Explore more calculators related to this topic.

Related Guides

Deepen your understanding with these educational resources.

Glossary

Technical terms used in mortgage calculations explained in plain language.

Interpolation
Estimating between known data nodes.
Lagrange basis
Polynomial 1 at one node, 0 at others.
Vandermonde matrix
System matrix [[xᵢ², xᵢ, 1]].
Cramer's rule
Determinant-ratio solution of linear systems.
Residual
Gap f(xᵢ) − yᵢ at a node.
Node
A given interpolation point.
Degenerate fit
Line or constant when a = 0.
Extrapolation
Estimating outside the node span.

Authoritative References

Trusted sources and standards referenced by this calculator.

Applicable Standards

Common Core A-CED — modeling with quadraticsNCTM Algebra — fitting functions to data

Was This Calculator Helpful?

Page Information

Last Updated:

2026-09-29

Version:

2.0.0

License:

Free to use for educational and professional purposes.