newton's method is one of the greatest examples of applied
differentiation. The method is best illustrated by way of example.
problem. Without a calculator, compute 5.
The first step is to express the quantity 5 as an equation:
x2=5
Next, we'll want to abstract the equation as a function:
f(x)=x2−5
Now the question is, what values of x satisfy the following:
f(x)=x2−5=0
Plotting the function f(x)=x2−5 is pretty easy, so let's take a
look at that:
The idea now is to try and estimate 5.5 is close to
4, which is 2. So our initial guess, call it x0, will
be 2:
x0=2
The next step is to pretend that f(x) is linear. We mark where f(2)
is, and draw a tangent line there. Where the tangent line intersects the
{\text{x-axis}} is where our new guess will be:
Notice that by doing this, we've gotten closer to where f(x) actually
cross the {\text{x-axis}.} This is the key idea behind newton's method.
We keep guessing, over and over again, until we eventually reach the
desired result.
The equation of the tangent line is:
y−y0=m(x−x0)
In our diagram above, the tangent line is the blue line. Where it crosses
the {\text{x-axis}} is a point we'll call x1. We want to find the
value of x1. Easy: It's when y=0.
0−y0−my0=m(x1−x0)=x1−x0
Now we can derive a formula for x1:
−my0x0−my0=x1−x0=x1
We have our formula for x1:
x1=x0−my0
Now, we know that y0 is just the function f(x) evaluated at
x0. We also know that m is the slope of f(x) at x0. Thus,
the formula, expanded, is:
x1=x0−f′(x0)f(x0)
The formula above is what allows us to calculate any root. This formula
is so important that we state it a little more formally:
newton's wethod. Let f(x) be a function. If f(x) is
differentiable, then for any point xn on f(x), we may
approximate f(x) by the tangent line to the graph of f(x) at the
point (xn,f(xn)). That is,
f(x)≈f(xn)+f′(xn)(x−xn)
Hence, if the tangent line is a good approximation to f between xn
and a zero of f(x), then we may find an approximate zero by solving
for:
0=f(xn+1)≈f(xn)+f′(xn)(xn+1−xn)
giving:
xn+1=xn−f′(xn)f(xn)
Let's apply the formula. We start with x0=2, and f(x)=x2−5.
Then, we have f′(x)=2x. Thus:
On a calculator, 5≈2.2360679775. Comparing our
approximations:
n
xn
En=∣5−xn∣
0
2
0.2360679775≈2.4×10−1
1
49
0.0139320225≈1.4×10−2
2
72161
0.00004313361≈4.3×10−5
3
144161+322360
≈4.16×10−10
Looking at the table, once we're at the second iteration, we're already at
such a good approximation of 5 that we don't need to go any
further. In fact, most calculators won't even go to the third iteration.
Again, newton's method works by repeatedly bringing the tangent line's
intersection with the x-axis closer and closer to the target what we
want:
As illustrated in the diagram above, notice how close x2 is to the
target, the x value marked with the brown vertical line. The distance
En=∣x−xn∣ is the error margin. The distance
En+1 is roughly (En)2. This in turn means that, roughly
speaking, the error margin is squared at each iteration of applying the
newton's method (i.e., the number of digits of accuracy doubles at each
iteration):
En
Error
E0
≈10−1
E1
≈10−2
E2
≈10−4
E3
≈10−8
E4
≈10−16
There are, however, a few constraints to newton's method. The constraints
are as follows:
∣f′∣ must not be small.
∣f′′∣ must not be too big.
x0, the initial guess, starts nearby x, the target.