Newton's method to find the roots of f(x) = 0 should be done later in the semester when student's are comfortable using and creating Maple procedures. Newton's method may be implemented quite easily with the help of the procedure nextx defined below.

nextx := proc(x,f)  x - f(x)/D(f)(x)  end;

The input variables to the procedure nextx are the current guess x and the procedure name f .

For example, to find a root of x sin(x) - 1 = 0 near x=3, we use the following

g := proc(x) x*sin(x) - 3  end;

x := 3;   % initial guess
x := evalf(  nextx(x,g) );  % next estimate of the root
x := evalf( nextx(x,g) );  % a better estimate of the root

Repeating this we get better and better estimates of the root near 3.

The showtangent command may also be used to give a geometrical explanation of Newton's method.

You may also examine the Maple file giving a slide show on Newton's method. (Author-Carl DeVore).
 
 
 

Created by Rakesh on August 6, 2001.