Peculiar Behavior of FindRoot
Author's Data: Housam BINOUS
Department of Chemical Engineering
National Institute of Applied Sciences and Technology
Tunis, TUNISIA
Email: binoushousam@yahoo.com

Acknowledgement :

This example of the resolution of a nonlinear algebraic equation using Newton's method was given by Kenneth J. Beers in Numerical Methods for Chemical Engineering, Applications in Matlab, Cambridge University Press, 2007.

Finding the solution of f[x]=0 for different inital guesses.

f[x_] := (x - 1) (x - 2) (x - 3)

For[i = 1, 
      i < 8001, {sol = FindRoot[f[x] ==  0, {x, i 0.0005}], 
        x[i] =  x /. sol, i++}]

ListPlot[Table[{i 0.0005, x[i]}, {i, 1, 8000}], 
      PlotStyle ->  RGBColor[1, 0, 0], 
      PlotRange -> {{0, 4}, {0, 4}}]

One finds unexpected behavior of FindRoot for some values of the inital guess. In fact, we expect the solution to be either 1 or 2  and FindRoot finds 3.

FindRoot[f[x] ==  0, {x, 1.425}]

Here, we expect the solution to be either 2 or 3 and FindRoot finds 1.

FindRoot[f[x] ==  0, {x, 2.505}]

Explanation is found to this peculiar behavior of FindRoot by plotting u[x] = - f[x] / f'[x] . Indeed, we see that u[x] present sharp variations near 1.5 and 2.6.

u[x_] := -f[x]/f'[x]

Plot[u[x], {x, 1, 3}, PlotStyle ->  RGBColor[1, 0, 0]]