Following tangents to find the solution of an equation numerically is Newton's method1. We use it to find the positive root of f(x)=x2−2, that is 2.
Following the tangents
Start from x0=2. Since f(2)=2 and f′(2)=4, the tangent at (2,2) is y=4x−6. It meets the x-axis at x=1.5, and that becomes the next value x1.
Repeat. Since f(1.5)=0.25 and f′(1.5)=3, the tangent is y=3x−417, meeting the x-axis at x2=1217=1.41667.
The general formula
Find where the tangent y=f(xn)+f′(xn)(x−xn) meets the x-axis.
xn+1=xn−f′(xn)f(xn)
For f(x)=x2−2 this tidies up as follows.
xn+1=xn−2xnxn2−2=21(xn+xn2)
It takes the average of the current value and xn2. If xn is larger than 2 then xn2 is smaller, so the average always lands between them.
How fast it converges
n
xn
Error
0
2
0.586
1
1.5
0.086
2
1.416667
0.0025
3
1.414216
0.000002
Against 2=1.414214, the number of correct digits roughly doubles at each step.
When it fails
If f′(xn)=0 the tangent is horizontal and the next value is undefined
If the starting value is far from a root, the iteration may jump to a different one
The values may also oscillate and never settle
What the method really is
That a tangent is the linear approximation of a curve is the substance of the method. The curve is replaced by a line and solved, and at the answer obtained the replacement is made again. That is all it repeats.
The parabola on the graph is y=x2−2, the two lines are the tangents at x0=2 and x1=1.5, and the large dots are the points of tangency together with the points where the tangents cut the x-axis.