Last modified on February 22nd, 2025

chapter outline

 

Linear Interpolation

Linear interpolation is a method of estimating unknown values between two known data points by assuming a linear relationship between two known values. It is like connecting two points with a straight line and finding values somewhere in between them. It estimates values between two known points by assuming that the change between them is always constant.

Formula

Mathematically, the linear interpolation equation is given by:

${y=y_{1}+\dfrac{\left( x-x_{1}\right) \left( y_{2}-y_{1}\right) }{x_{2}-x_{1}}}$

Here,

  • (x1, y1) and (x2, y2) are two known points
  • x is the given input value for which we want to estimate y
  • y is the interpolated value at x

This is the equation of a straight line passing through the two given points, which helps us to find an approximate value of y for a given x.

Steps 

Now, let us estimate the value of y when x = 3 using the interpolation formula:

xy
24
510

Step 1: Applying the Formula 

As we know, the interpolation formula is:

${y=y_{1}+\dfrac{\left( x-x_{1}\right) \left( y_{2}-y_{1}\right) }{x_{2}-x_{1}}}$

Here

  • x1 = 2, y1 = 4
  • x2 = 5, y2 = 10
  • x = 3

Substituting the values into the formula, we get

${y=4+\dfrac{\left( 3-2\right) \left( 10-4\right) }{5-2}}$

Step 2: Simplifying the Expression 

⇒ ${y=4+\dfrac{\left( 1\right) \left( 6\right) }{3}}$

⇒ ${y=4+\dfrac{6}{3}}$

⇒ ${y=4+2}$

⇒ ${y=6}$

Thus, the interpolated value at x = 3 is y = 6.

Solved Examples

E.g.1. Given the points (1, 3) and (4, 9), use linear interpolation to estimate the value of y when x = 2

The data points are:

x1 = 1, y1 = 3

x2 = 4, y2 = 9

x = 2 (value to interpolate)

As we know, the interpolation formula is:

${y=y_{1}+\dfrac{\left( x-x_{1}\right) \left( y_{2}-y_{1}\right) }{x_{2}-x_{1}}}$

Here,

${y=3+\dfrac{\left( 2-1\right) \left( 9-3\right) }{4-1}}$

⇒ ${y=3+\dfrac{\left( 1\right) \left( 6\right) }{3}}$

⇒ ${y=3+\dfrac{6}{3}}$

⇒ ${y=3+2}$

⇒ ${y=5}$

Thus, the interpolated value at x = 2 is y = 5.

E.g.2. Given the points (10, 20) and (15, 35), estimate the value of y when x = 12

The data points are:

x1 = 10, y1 = 20

x2 = 15, y2 = 35

x = 12 (value to interpolate)

As we know, the interpolation formula is:

${y=y_{1}+\dfrac{\left( x-x_{1}\right) \left( y_{2}-y_{1}\right) }{x_{2}-x_{1}}}$

Here,

${y=20+\dfrac{\left( 12-10\right) \left( 35-20\right) }{15-10}}$

⇒ ${y=20+\dfrac{\left( 2\right) \left( 15\right) }{5}}$

⇒ ${y=20+\dfrac{30}{5}}$

⇒ ${y=20+6}$

⇒ ${y=26}$

Thus, the interpolated value at x = 12 is y = 26.

E.g.3. The temperature at 2 PM was recorded as 20°C, and at 6 PM, it was 28°C. Use linear interpolation to estimate the temperature at 4 PM.

The data points are:

x1 = 2, y1 = 20

x2 = 6, y2 = 28

x = 4 (value to interpolate)

As we know, the interpolation formula is:

${y=y_{1}+\dfrac{\left( x-x_{1}\right) \left( y_{2}-y_{1}\right) }{x_{2}-x_{1}}}$

Here,

${y=20+\dfrac{\left( 4-2\right) \left( 28-20\right) }{6-2}}$

⇒ ${y=20+\dfrac{\left( 2\right) \left( 8\right) }{4}}$

⇒ ${y=20+\dfrac{16}{4}}$

⇒ ${y=20+4}$

⇒ ${y=24}$

Thus, the estimated temperature at 4 PM is 24°C.

E.g.4. The price of gasoline was \$3.00 per gallon in 2015 and \$3.80 per gallon in 2020. Estimate the price in 2018.

The data points are:

x1 = 2015, y1 = 3.00

x2 = 2020, y2 = 3.80

x = 2018 (value to interpolate)

As we know, the interpolation formula is:

${y=y_{1}+\dfrac{\left( x-x_{1}\right) \left( y_{2}-y_{1}\right) }{x_{2}-x_{1}}}$

Here,

${y=3.00+\dfrac{\left( 2018-2015\right) \left( 3.80-3.00\right) }{2020-2015}}$

⇒ ${y=3+\dfrac{\left( 3\right) \left( 0.80\right) }{5}}$

⇒ ${y=3+0.48}$

⇒ ${y=3.48}$

Thus, the estimated gasoline price in 2018 is \$3.48 per gallon.

E.g.5. Consider the table below, which shows the relationship between study hours and test scores of a student.

Study HoursScore (%)
155
365
575
785
995

Using this data, estimate the expected score of the student if they study for 4 hours.

Since 4 hours is between 3 and 5 hours, we take:

x1 = 3, y1 = 65

x2 = 5, y2 = 75

x = 4 (value to interpolate)

As we know, the interpolation formula is:

${y=y_{1}+\dfrac{\left( x-x_{1}\right) \left( y_{2}-y_{1}\right) }{x_{2}-x_{1}}}$

Here,

${y=65+\dfrac{\left( 4-3\right) \left( 75-65\right) }{5-3}}$

⇒ ${y=65+\dfrac{\left( 1\right) \left( 10\right) }{2}}$

⇒ ${y=65+\dfrac{10}{2}}$

⇒ ${y=65+5}$

⇒ ${y=70}$

Thus, the estimated score for studying 4 hours is 70%

Last modified on February 22nd, 2025