home AS/A2 p4 AS/A2
Pure 5
Pure 6
P4 Topic 4: Numerical solution of equations
Solving f(x) = 0 by linear interpolation backmore
linear interpolationTo find an approximate solution to the equation f(x)=0, start by choosing values for x1 and x2. For the method to work, these values need to be either side of the required root (marked X in the diagram); in other words y1 and y2 need to be of opposite sign. The possible solution is then calculated by assuming that the curve is straight between (x1,y1) and (x2,y2) (hence the term linear interpolation) and using the similar triangles ABC and XAD to find the position of X.
Because ABC and XAD are similar,
BC/AC = AD/DX, so
(y2-y1)/(x2-x1) = -y1/DX,
Our extimated solution is the x-coordinate of point X, ie., x1+DX, therefore
linear interpolation

In the following examples, use the graph of y = f(x) to get a rough idea about where the solutions are and therefore some starting values for x1 and x2. Use it also to verify your solutions. Click the left button to zoom in on the graph; shift-click the left button to zoom out.
Example 1

Solve x3+3x2-2 = 0
x1 y1=
x2 y2=
 
Possible solution:
Clearly one root is at x = -1.
Example 2

Solve x3+4x2-2 = 0
x1 y1=
x2 y2=
 
Possible solution:
Example 3

Solve x.sinx - 1 = 0
x1 y1=
x2 y2=
 
Possible solution:


Summary
The values you choose for x1 and x2 need to be in the neighbourhood of the required solution. This means they need to be close enough so that they are not near other roots of the same equation.
Note the similarity between the formula above for linear interpolation, based on similar triangles:
linear interpolation
and the formula for the Newton-Raphson method, based on gradient:
newton raphson
JavaScript interactive pages © MathsNet 2001