Interactive Educational Modules in
Scientific Computing

Newton's Method

This module demonstrates Newton's method for solving a nonlinear equation f(x) = 0 in one dimension. Given an approximate solution x, Newton's method produces a new approximate solution given by xf(x) ⁄ f′(x), based on local linearization about the current point (the tangent line in one dimension). This process is repeated until convergence, which is usually very rapid.

The user selects a problem either by choosing a preset example or typing in a desired function f(x). The user can also select a starting point x or accept a default value. The successive steps of Newton's method are then carried out sequentially by repeatedly clicking on NEXT or on the currently highlighted step. The current values of x and f(x) are indicated by bullets on the plot and are also shown numerically in the table below. At each iteration of Newton's method, the approximating tangent line at the current point is drawn, the next approximate solution is taken to be the intersection of the tangent line with the x axis, and the process is then repeated. If the starting guess is close enough to the solution, then Newton's method converges to it, typically with a quadratic convergence rate.

Example 1 shows Newton's method quickly finding the solution of the sum of a polynomial and a trigonometric function. Example 2 shows a case in which Newton's method fails because it is started too far away from the solution. With the default starting value of x0 = 1, the method is trapped in an infinite loop alternating between x = 1 and x = −1.

Reference: Michael T. Heath, Scientific Computing, An Introductory Survey, 2nd edition McGraw-Hill, New York, 2002. See Section 5.5.3, especially Algorithm 5.2 and Example 5.10.

Developers: Jeffrey Naisbitt and Michael Heath