Newton-Raphson Method (see ws1)

The Newton-Raphson method is similar to the secant method, but can be argued on a more theoretical basis. Let us assume that [Maple Math] is sufficiently smooth on the interval [Maple Math] , i.e. that its first and second derivative are continuous functions on [Maple Math] . Let [Maple Math] be an approximation to the root [Maple Math] , such that [Maple Math] is small and [Maple Math] . Then the Taylor series about [Maple Math] is given by

> f(x)=taylor(f(x),x=q,2);

[Maple Math]

so that at [Maple Math] , we find

> 0=subs(x=p,taylor(f(x),x=q,2));

[Maple Math]

Assuming that the approximation is close to the root, we can ignore the higher order terms in the series expansion and calculate [Maple Math] as the solution of

> eq:=f(q)+D(f)(q)*(p-q)=0;

[Maple Math]

or,

> p:=solve(eq,p);

[Maple Math]

> p:=collect(%,q);

[Maple Math]

This leads to the following algorithm:

>

Step 1: obtain an approximation, [Maple Math] .

Step 2: calculate the next approximation as

[Maple Math] .

Step 3: If [Maple Math] then [Maple Math] is the root, otherwise, if [Maple Math] then [Maple Math] is the required approximation to the root, else repeat step 2.

>

This is illustrated in the following example:

> f:=x->cos(x)-0.4;

[Maple Math]

> epsilon:=10.^(-7);x[0]:=0.5;x[1]:=x[0]-(f(x[0])/D(f)(x[0]));

[Maple Math]

[Maple Math]

[Maple Math]

> for i from 1 by 1 to 10 while abs((x[i]-x[i-1])/x[i]) > epsilon do x[i+1]:=x[i]-(f(x[i])/D(f)(x[i])); od;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> abs((x[5]-x[4])/x[5]);

[Maple Math]

Notice the [Maple Math] construction which allows us to stop the loop as soon as the required accuracy is obtained. But remember that when this accuracy is not obtained after the maximum number of steps, the final value is not yet as accurate as we demanded! Nevertheless, it is wise to restrict the maximum number of times a loop should be executed when working on a computer.

Grapically, the Newton-Raphson Method corresponds to finding the tangent line to the graph of [Maple Math] at the estimated value of the root. The next estimate is then the zero of this tangent line. This is illustrated in the following picture:

[Maple Plot]

>

The Newton-Raphson Method converges very rapidly and is one of the more popular methods. However, the method can not be applied when on of the approximations [Maple Math] , has [Maple Math] . In this case, the tangent line is horizontal and will not have an intersection with the [Maple Math] -axis.

There are also more special cases in which the Newton-Raphson Method may fail to produce a converging sequence of approximations.