next up previous
Next: newton.f Up: No Title Previous: False position

Newton's method

You should have seen Newton's method in your calculus class. The basic idea of the algorithm is this: given an initial guess, call it tex2html_wrap_inline359 to a root of f(x)=0, a refined guess, tex2html_wrap_inline363 is computed based on the x-intercept of the line tangent to f at tex2html_wrap_inline359 . That is, consider the equation of the line tangent to f at tex2html_wrap_inline359 ,

displaymath375

This is the point-slope equation of a line, with tex2html_wrap_inline377 being the point and tex2html_wrap_inline379 the slope. Now calculate that x at which y=0. That is,

eqnarray122

This value of x is the new guess at the root - call it tex2html_wrap_inline363 . We repeat the process, computing an tex2html_wrap_inline389 , until we compute an tex2html_wrap_inline391 at which tex2html_wrap_inline393 , where tol is a prescribed tolerance.

If you examine the formula for the new iterates tex2html_wrap_inline397 you can see one potential for failure of Newton's method, namely tex2html_wrap_inline399 could be zero - or, what is essentially the same, very small. This may lead to wild divergences in the iteration procedure. There are other possible failures in the method that we will uncover in the exercises. For now, here is a skeleton code for Newton's method. Note: To finish the coding, you need formulae for both f and f'.





E. Bruce Pitman
Tue Sep 15 18:15:17 EDT 1998