7 Fixed point iteration \(f(x)=x-x^3\) a sink at \(x=0\)

This shows fixed point iteration of \(f(x)=x-x^3\) with 2 seeds, one using \(x_0=0.6\) and one using \(x_0=-0.6\) in the first plot (top left corner plot).

It shows the fixed point interation is stable and converges to the limit \(x=0\) from both sides. Hence \(x=0\) is a sink.

Additional animations shown in the table below, are zoom versions of the same iterations that used the seed \(x=0.6\) in order to obtain better views.

Original version

zoom in more


Pause Play Restart Step forward Step back


Pause Play Restart Step forward Step back

The program is written using Mathematica. Here is the notebook

Source code

(*version 2:21 AM, 4/16/2020 *) 
Manipulate[ 
 Module[{f1, f2, x1, x2, sol, x, t, ode}, 
  f1 = x2; 
  f2 = (-x1^2 - x1 - a)*x2 - x1; 
  ode = x''[t] + (x[t]^2 + x[t] + a)*x'[t] + x[t] == 0; 
  sol = NDSolve[{ode, x[0] == 1, x'[0] == 0}, x, {t, 0, 30}]; 
  Grid[{ 
    {Row[{"a = ", NumberForm[a, {4, 2}]}]}, 
    { 
     StreamPlot[{f1, f2}, {x1, -5, 5}, {x2, -7, 7}, 
      ImageSize -> 300, 
      StreamPoints -> {{{{1, 0}, Red}, Automatic}}], 
     Plot[Evaluate[x[t] /. sol], {t, 0, 30}, 
      PlotRange -> {Automatic, {-4, 4}}, 
      ImageSize -> 300, 
      GridLines -> Automatic, GridLinesStyle -> LightGray, 
      PlotStyle -> Red, 
      AxesLabel -> {"time", "x(t)"}, 
      BaseStyle -> 12, 
      PlotLabel -> "Solution to  x''+f[x] x' + x = 0" 
      ] 
     } 
    } 
   ] 
  ], 
 {{a, -2, "a"}, -2, 1, 0.1, Appearance -> "Labeled"}, 
 TrackedSymbols :> {a} 
 ]