Interpolation means estimating a value between known data points. If the -value you want is inside the range of the data you already know, interpolation gives you a way to estimate the missing -value.
The simplest case is linear interpolation, which uses a straight line between two points. Polynomial interpolation uses one polynomial that passes through several points exactly. Lagrange interpolation is a standard formula for writing that polynomial when the known -values are distinct.
If the unknown lies outside the known range, you are extrapolating instead. That is a different task and is usually less reliable.
Linear Interpolation Formula
Suppose you know points and with . For an between and , linear interpolation uses
This works by taking the fraction of horizontal distance from to and applying the same fraction of the vertical change from to . It is exact if the true relationship is linear on that interval; otherwise it is a local estimate.
Linear Interpolation Example
Suppose the known points are and , and you want the value at .
Use the linear interpolation formula:
Now simplify:
So the interpolated value is . This makes sense because is one third of the way from to , so the output moves one third of the way from to .
Polynomial Interpolation Means Exact Fit Through Several Points
If you have more than two points with distinct -values, polynomial interpolation looks for one polynomial that passes through all of them. For points with distinct -values, there is exactly one polynomial of degree at most that fits them.
For example, two points determine a line, three points determine a quadratic at most, and four points determine a cubic at most. This is useful when you want a smooth formula that matches sampled values exactly.
The tradeoff is that exact fit does not always mean good behavior between points. With many points or widely spaced points, a high-degree interpolating polynomial can oscillate a lot, especially near the ends of the interval.
Lagrange Interpolation Formula
Lagrange interpolation is a direct way to write the interpolating polynomial. If you have points with distinct , the Lagrange form is
where
Each basis polynomial is built so that it equals at and at the other known -values. That is why the sum keeps the correct at each data point.
You usually use the Lagrange form when you want an exact interpolating polynomial from a small set of points. It is conceptually clean, but for larger numerical problems other forms are often preferred because they are more stable to compute.
Interpolation vs. extrapolation
Interpolation means estimating inside the known range of -values. Extrapolation means extending beyond that range.
That difference matters because interpolation stays anchored to nearby data. Extrapolation can fail quickly if the underlying pattern changes outside the observed interval.
Common Interpolation Mistakes
Using interpolation outside the data range
If lies outside the known interval, the calculation is no longer interpolation. It becomes extrapolation, which is often less reliable.
Assuming exact fit means exact reality
A polynomial can pass exactly through measured data points and still be a poor model of the real situation between them, especially if the data contain noise.
Forgetting the distinct- condition
For the standard interpolation formulas, the known -values need to be distinct. If two data points share the same but have different -values, one function cannot pass through both.
Choosing a high degree too quickly
Using every data point in one large polynomial can create unstable behavior. In practice, piecewise methods such as splines are often preferred when many points are involved.
Where Interpolation Is Used
Interpolation appears in numerical analysis, computer graphics, table lookup, signal processing, and scientific computing. It is useful whenever you know values at selected points but need a reasonable value in between.
In a first math course, it also connects slope, functions, polynomials, and approximation into one idea: using known structure to estimate an unknown in-between value.
Try a similar interpolation problem
Take the points and and estimate the value at with linear interpolation. Then ask whether using a straight line seems reasonable over that interval.
If you want a quick check after you set it up yourself, try your own version in the solver and compare the line equation with your result.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →