Linear interpolation draws a straight line between the points A and B with coordinates (a,f(a)) and (b,f(b)), where a<x<b is an interval containing a root to the equation f(x)=0
As f(a) and f(b) have different signs, A and B are on either side of the x-axis
The approximation to the root is where this straight line cuts the x-axis
This is at the point X with coordinates (x,0)
Points A, X and B lie on the same straight line
It helps to use the gradient formula
The gradient between (x1,y1) and (x2,y2) is x2−x1y2−y1
How do I apply linear interpolation using gradients?
This is best explained with an example
If the root of f(x)=0 lies in the interval [1,2] and f(1)=−5 and f(2)=10, then:
A is the point (1,−5)
B is the point (2,10)
X is the point (x,0)
This is the x-intercept of the line AB
A, X and B lie on the same straight line
The gradient of AX equals the gradient of XB
The order matters (not BX)
Use the gradient formula to set these equal
x−10−(−5)=2−x10−0 giving x−15=2−x10
Solve the equation to find x
5(2−x)=10(x−1)
expand and solve to get x=34
This process can be **repeated **to get the next approximation
This gradient method does** not** require a sketch
What other methods can I use to do linear interpolation?
You can sketch the points A, B and X on a diagram and use similar triangles either side of the x-axis to find an equation in x
This leads to the same equation as the gradients above
Or you can use coordinate geometry to find the equation of the line AB
Use y−y1=m(x−x1)
Then find its x-intercept
Substitute in y=0 and solve for x
Exam Hint
If the calculations involve lengthy decimals, you can use f(a) and f(b) to stand for their numbers in your working!
Worked Example
The equation f(x)=0 where f(x)=x3−x−2 has a root in the interval [1.4,1.5].
Use linear interpolation once to find an approximation to the root, giving your answer to 3 decimal places.
It is easier to write them asf(1.4)andf(1.5)for nowLet A, B and X be the points (1.4,f(1.4)),(1.5,f(1.5))and(x,0)Use the gradient formulax2−x1y2−y1* to find the gradient of *AX
gradient of* AX is *x−1.40−f(1.4)
Use the gradient formulax2−x1y2−y1* to find the gradient of *XB