Applied mathematics · Eqora guide

Linear interpolation: what belongs between two data points?

Locate the target between two measured inputs, carry the same fraction across the output interval, and state when a straight-line estimate is reasonable.

Adult coastal researcher positions a middle tide marker between two survey stakes on a rocky shore

Linear interpolation estimates a value inside an interval whose two endpoints are known. Suppose a temperature log reads 12 °C at 08:00 and 20 °C at 12:00, but the 10:30 entry is missing. The target time is 2.5 hours into a four-hour interval, or 2.5/4 = 0.625 of the way across. Carrying that same fraction through the 8 °C rise gives 12 + 0.625 × 8 = 17 °C. The arithmetic is exact for the straight line; whether the straight line represents the real temperature is a separate modeling question.

The central habit is to identify the two surrounding observations before touching the formula. Interpolation stays between them; extrapolation ventures outside. This guide derives the formula, handles rising and falling data, works backward from an output, applies the method piece by piece in a table, and checks the estimate independently. The coastal photographs are visual analogies for endpoints, position, range, and reasonableness. They do not encode the examples or turn field measurements into a straight line automatically.

NIST describes interpolation as estimating new values from known data points and distinguishes it from fitting a model that need not pass through every observation. OpenStax similarly separates predictions inside the observed data range from extrapolations outside it. Linear interpolation makes one local assumption: between the selected endpoints, change is treated as constant. State that assumption. A well-calculated estimate can still be unsuitable when the underlying process curves, jumps, cycles, or changes rate sharply.

Use this guide actively. Keep a real problem beside you, pause after each idea, and translate the advice into one action you can test in the next ten minutes.
Eqora Math AI homework helper example for Linear interpolation: what belongs between two data points?
Connect the advice to a real problem and a visible next step.
Independent math practice connected to Linear interpolation: what belongs between two data points?
Finish with practice you can complete without the answer in view.

Linear interpolation preserves position between endpoints

Let the known points be (x₀, y₀) and (x₁, y₁), with x₀ ≠ x₁. A target x between x₀ and x₁ occupies the fraction t = (x − x₀)/(x₁ − x₀) of the horizontal interval. Linear interpolation places the output at the same fraction of the vertical change: y = y₀ + t(y₁ − y₀). Combining the two steps gives y = y₀ + [(x − x₀)/(x₁ − x₀)](y₁ − y₀). This is the point-slope equation for the straight segment joining the data points.

The fraction is more informative than memorized symbols. If x is halfway across, t = 0.5 and y is halfway between the outputs. If x is one quarter across, apply one quarter of the total output change. The brass cups and coral marker in the photograph make position visible without pretending to be a graph. On paper, label the lower and upper endpoints explicitly. Mixing x from one row with y from another creates a plausible-looking calculation for the wrong segment.

Two brass endpoint cups connected by a straight cord with a coral marker between them on a coastal field table
Find the target's fraction of the input interval, then preserve that fraction across the output change.

Work the time-and-temperature example in two stages

For the 08:00 to 12:00 interval, use decimal hours x₀ = 8, x₁ = 12, and x = 10.5. The position fraction is t = (10.5 − 8)/(12 − 8) = 2.5/4 = 0.625. The temperatures are y₀ = 12 and y₁ = 20, so their change is 8 °C. Apply the fraction: y = 12 + 0.625 × 8 = 17 °C. Keep time units consistent; 10:30 is 10.5 hours, not the decimal 10.30.

A second form provides a useful check: y = (1 − t)y₀ + ty₁. Here, 0.375 × 12 + 0.625 × 20 = 4.5 + 12.5 = 17. The weights add to one and are both between zero and one, so the estimate must lie between 12 and 20. This weighted-average form also clarifies which endpoint has more influence. Because 10:30 is closer to 12:00, the estimate receives more weight from 20 °C than from 12 °C.

Coastal researcher watches a transparent float positioned partway between two orange anchored buoys
The target float is partway across the interval; the same fraction controls the estimated output.

Descending data use the same formula

Interpolation does not require y to increase. A tide gauge reads 3.4 m at 06:00 and 2.2 m at 09:00. Estimate the straight-line value at 07:15. The target is 1.25 hours into a three-hour interval, so t = 1.25/3 = 5/12. The output change is 2.2 − 3.4 = −1.2 m. Therefore y = 3.4 + (5/12)(−1.2) = 3.4 − 0.5 = 2.9 m. The negative change carries the direction automatically.

Do not reverse only one subtraction. If you calculate t with x₀ to x₁, calculate the output change as y₁ − y₀ in the same order. Reversing both orders gives the same fraction and result; reversing only one changes the sign. A quick bound check catches the mistake: an interpolated tide level must remain between 2.2 m and 3.4 m. This mathematical estimate is not a tide forecast, because real tides curve and depend on more than two readings.

Choose the surrounding pair in a larger table

A table may contain many points. To estimate at x = 7, suppose the nearest surrounding rows are (5, 18) and (9, 30). Use that local segment, not automatically the first and last rows in the table. The fraction is (7 − 5)/(9 − 5) = 1/2, so y = 18 + 1/2(30 − 18) = 24. If x = 8 instead, t = 3/4 and y = 27. Piecewise linear interpolation connects each adjacent pair with its own straight segment.

Sorting by x prevents accidental bracketing errors. Repeated x-values need special attention: if two rows share x but have different y, no single-valued straight segment can connect them as a function over a zero-width input interval. Missing units are another warning. Do not interpolate a time between one row measured in seconds and another in minutes until converting. Record the chosen endpoints, the target, and the units above the formula so another reader can reproduce your choice.

Interpolation and extrapolation answer different questions

For endpoints x₀ = 5 and x₁ = 9, a target x = 7 is interpolation because 5 ≤ 7 ≤ 9. A target x = 12 is extrapolation because it lies beyond the observed interval. The formula still produces a number: t = 7/4 and the straight line continues. But the data no longer surround the prediction, so there is less direct evidence that the local rate continues. Label it extrapolation rather than presenting it as an equally supported estimate.

The green marker in the photograph lies inside the two boundary posts; the red marker lies beyond them. That visual distinction is the first check to make before calculating. OpenStax notes that a model may break down outside the data range. In practice, even interpolation can fail across a known discontinuity, such as a switch turning on, a fare changing by step, or a phase transition. Being inside the interval is necessary for interpolation, not proof that linearity is scientifically appropriate.

Coastal boardwalk with a green marker between two survey posts and a red marker beyond the far post
Inside the measured interval is interpolation; beyond an endpoint is extrapolation and needs a stronger warning.

Inverse interpolation finds the input for a target output

Sometimes the output is known and the input is missing. In the temperature example, when would the straight-line estimate reach 18 °C? The output has moved 18 − 12 = 6 °C through a total rise of 8 °C, so t = 6/8 = 0.75. Apply that fraction to the four-hour interval: x = 8 + 0.75 × 4 = 11. The estimated time is 11:00. This works because the endpoint outputs differ and the segment is monotonic.

You can also rearrange the formula: x = x₀ + [(y − y₀)/(y₁ − y₀)](x₁ − x₀). Check that the target y lies between y₀ and y₁ if the task calls for interpolation. If y₀ = y₁, the denominator is zero. A flat segment either reaches that constant output at every point or never reaches a different target, so inverse interpolation cannot select one unique x. State that special case rather than dividing by zero.

Round only after carrying enough precision

The position fraction may repeat. If a sensor reads 14.2 at x = 2 and 19.1 at x = 5, then at x = 3 the fraction is 1/3. Keeping t as 1/3 gives y = 14.2 + (1/3)(4.9) = 15.8333… . If the measurement resolution supports tenths, report 15.8. Rounding t to 0.3 first would give 15.67, which rounds to 15.7 and introduces an avoidable extra error.

Separate calculation precision from measurement certainty. More calculator digits do not make the underlying straight-line assumption or endpoint observations more accurate. Match the final rounding to the context and source precision, and mark the result as an estimate. When endpoints already contain uncertainty, the interpolated result inherits it. A proper scientific analysis may need uncertainty propagation or a different model; ordinary linear interpolation does not remove noise or validate the measurements.

Check bounds, endpoints, slope, and assumptions

Use four checks. First, t should be between zero and one for interpolation. Second, substituting x = x₀ must return y₀ and x = x₁ must return y₁. Third, the estimate must stay between endpoint outputs. Fourth, compare the implied slope (y₁ − y₀)/(x₁ − x₀) with the context and units. In the temperature example the slope is 2 °C per hour, and 2.5 hours add 5 °C to the starting 12 °C, again producing 17 °C.

Finally ask whether constant change between the endpoints is defensible. Look for curves, thresholds, cycles, abrupt events, uneven sampling, or a more suitable domain model. The three cylinders and separate balance in the photograph symbolize an independent reasonableness check, not laboratory evidence for the examples. For important engineering, financial, medical, or environmental decisions, use validated methods and qualified expertise. Linear interpolation is transparent and useful precisely when its local assumption and limits are made explicit.

Adult coastal researcher compares three graduated liquid levels with a separate balance at sunset
A sound estimate respects the endpoint bounds, the direction of change, the units, and the model assumptions.

Put it into practice now

Choose one problem from your current homework or review set. Attempt it before opening Eqora, then use the app only at the point where your own reasoning stops.

  • State what the problem is asking before you solve it
  • Identify the first step you cannot justify
  • Ask Eqora one focused follow-up about that step
  • Finish with a similar problem and no solution in view

The session is complete when the method is clearer, not simply when the worksheet has one more answer.

Good to know

Questions about this guide

What is the linear interpolation formula?

For points (x₀, y₀) and (x₁, y₁), estimate at x with y = y₀ + [(x − x₀)/(x₁ − x₀)](y₁ − y₀), provided x₀ and x₁ differ.

Does interpolation give the true missing value?

Not necessarily. It gives the value on the straight segment between observations. Accuracy depends on the endpoint data and whether constant local change is a reasonable model.

What is the difference between interpolation and extrapolation?

Interpolation estimates inside the observed input interval. Extrapolation extends beyond an endpoint and relies more strongly on an unobserved continuation of the trend.