Linear Interpolation Formula with Worked Examples

#Formula
TL;DR
The linear interpolation formula is y=y1+(x−x1)(y2−y1)x2−x1y = y_1 + \frac{(x-x_1)(y_2-y_1)}{x_2-x_1}, estimating a value between two known points. This article gives five worked examples.
BT
Bhanzu TeamLast updated on November 7, 20266 min read

Key Points

  • The linear interpolation formula is y=y1+(x−x1)(y2−y1)x2−x1y = y_1 + \frac{(x - x_1)(y_2 - y_1)}{x_2 - x_1}, estimating yy at an xx between two known points.

  • The fraction y2−y1x2−x1\frac{y_2-y_1}{x_2-x_1} is the slope of the line joining the two points, so the formula walks along that line.

  • The method assumes the quantity changes at a steady rate between the points, which is an approximation rather than an exact result.

  • Reading at an xx outside the two known points is extrapolation, not interpolation, and its error grows with distance.

  • Interpolating at the midpoint gives exactly the average of the two yy values, which is a quick check on any implementation.

What Is the Linear Interpolation Formula?

The linear interpolation formula estimates a value lying between two known data points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2):

y=y1+(x−x1)(y2−y1)x2−x1y = y_1 + \frac{(x - x_1)(y_2 - y_1)}{x_2 - x_1}

It assumes the straight line joining the two points is a reasonable stand-in for whatever happens between them.

Why the Formula Is a Slope Walk

Read the formula from left to right and it describes a journey. Start at the known height y1y_1, then add the extra height gained by moving sideways from x1x_1 to xx.

The height gained per unit of sideways movement is the slope, y2−y1x2−x1\frac{y_2-y_1}{x_2-x_1}. Multiplying it by the sideways distance (x−x1)(x-x_1) gives the rise over that stretch.

That is why the formula has the shape it does: a starting value plus a rate times a distance. It is the same structure as any straight-line equation, written from a point you already know.

Variable Key

Symbol

Meaning

Unit or type

Notes

(x1,y1)(x_1,y_1)

the lower known point

data pair

the starting value

(x2,y2)(x_2,y_2)

the upper known point

data pair

sets the slope

xx

where you want an estimate

between x1x_1 and x2x_2

outside means extrapolation

y2−y1x2−x1\frac{y_2-y_1}{x_2-x_1}

the slope

rate

height gained per unit across

Examples of the Linear Interpolation Formula

Example 1

Given (10,25)(10, 25) and (20,45)(20, 45), estimate yy at x=14x = 14.

y=25+(14−10)(45−25)20−10=25+4×2010=25+8=33y = 25 + \frac{(14-10)(45-25)}{20-10} = 25 + \frac{4 \times 20}{10} = 25 + 8 = 33

Final answer: 33

Example 2

Given the same points, estimate yy at x=14x = 14 by averaging the two yy values.

Averaging gives 25+452=35\frac{25+45}{2} = 35, which is at least in the right region.

But 35 is the value at the midpoint x=15x = 15, not at x=14x = 14. The target sits four tenths of the way along the interval rather than halfway, so the estimate must be lower than the average.

Weighting by position instead of averaging:

y=25+0.4×20=33y = 25 + 0.4 \times 20 = 33

Final answer: 33. Averaging is only correct when the target is exactly midway, which is the check in the Key Points.

Example 3

A table gives 16=4\sqrt{16} = 4 and 25=5\sqrt{25} = 5. Estimate 20\sqrt{20} by interpolation.

y=4+(20−16)(5−4)25−16=4+49≈4.444y = 4 + \frac{(20-16)(5-4)}{25-16} = 4 + \frac{4}{9} \approx 4.444

Final answer: about 4.444, against a true value of about 4.472.

The estimate is low by 0.028 because the square-root curve bends, and interpolation assumed a straight line. That gap is the method's error, not an arithmetic slip.

Example 4

Estimate yy at x=15x = 15 for the points in Example 1, and check the midpoint property.

y=25+(15−10)(20)10=25+10=35y = 25 + \frac{(15-10)(20)}{10} = 25 + 10 = 35

Final answer: 35, which equals 25+452\frac{25+45}{2} exactly, confirming the midpoint check.

Example 5

Given (10,25)(10,25) and (20,45)(20,45), estimate yy at x=30x = 30 and comment.

y=25+(30−10)(20)10=25+40=65y = 25 + \frac{(30-10)(20)}{10} = 25 + 40 = 65

Final answer: 65, but this is extrapolation rather than interpolation, since 30 lies outside both known points.

The arithmetic is identical and the reliability is not. Nothing in the data supports the straight line continuing past x=20x = 20.

Interpolation and Its Neighbours

Method

Where it estimates

Assumption

Linear interpolation

between two known points

steady rate between them

Extrapolation

outside the known points

the trend continues

Averaging

the midpoint only

target is exactly halfway

Higher-order interpolation

between several points

a curve fits the points

The fourth row is what you reach for when linear interpolation is visibly too crude, as with the square-root example. Fitting a curve through three or more points reduces the error at the cost of more arithmetic.

Where Do Students Trip Up on Linear Interpolation?

Mistake 1: Averaging instead of weighting by position

Where it slips in: The target lies between two values, and averaging is the familiar way to land between two numbers.

Don't do this: y=y1+y22y = \frac{y_1+y_2}{2} for any xx in the interval.

The correct way: Weight by how far along the interval xx sits. Averaging is the special case where that fraction is exactly one half.

Students who first work out what fraction of the way along the target sits, as a decimal, before touching the yy values get this right consistently. That fraction is the whole of the interpolation, and the rest is multiplication.

Mistake 2: Extrapolating without saying so

Where it slips in: The formula accepts any xx and returns a number without complaint.

Don't do this: Report an estimate at x=30x = 30 from data spanning 10 to 20 as though it were interpolated.

The correct way: Check that xx lies between x1x_1 and x2x_2. If it does not, the result is an extrapolation and should be labelled as one.

Mistake 3: Subtracting the coordinates in inconsistent order

Where it slips in: The formula contains three subtractions, and reversing one flips a sign.

Don't do this: Use x−x1x - x_1 in the numerator but x1−x2x_1 - x_2 in the denominator.

The correct way: Keep point 1 first in every subtraction. A sign error makes the estimate fall outside the two known yy values, which is an impossible result for an interpolation.

Bottom Line

  • The linear interpolation formula is y=y1+(x−x1)(y2−y1)x2−x1y = y_1 + \frac{(x-x_1)(y_2-y_1)}{x_2-x_1}.

  • It is a starting value plus a slope times a sideways distance, which is why it reads as a walk along a line.

  • The method assumes a steady rate between the points, so a curving relationship leaves a predictable error.

  • An xx outside the known points makes the result an extrapolation, which should always be labelled.

  • To work through graphs and rates with a teacher, explore an algebra tutor or math classes online.

Where to Go From Here

Given (2,7)(2, 7) and (8,25)(8, 25), estimate yy at x=5x = 5 and confirm it equals the average of the two yy values. Then estimate at x=4x = 4 and check your answer lies between 7 and 25.

Want a live Bhanzu trainer to walk through more graph problems? Book a free demo class.

Read More

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the linear interpolation formula?
y=y1+(x−x1)(y2−y1)x2−x1y = y_1 + \frac{(x-x_1)(y_2-y_1)}{x_2-x_1}, estimating yy at an xx lying between two known points.
Is the linear interpolation formula exact?
Only if the underlying relationship is genuinely linear. Otherwise it is an approximation whose error depends on how much the true relationship curves between the points.
What is the difference between interpolation and extrapolation?
Interpolation estimates inside the range of known data; extrapolation estimates outside it. The arithmetic is the same but extrapolation is far less reliable.
How do I check an interpolation answer quickly?
Confirm it falls between the two known yy values, and that interpolating at the midpoint returns their average.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →