Fixed points and stability

Example 1

Clear["Global`*"]
f[x_]=(x+1/2)/(2+x^2);
Plot[{x,f[x]},{x,-1,1},PlotRange->{-1,1},Frame->True]

Fixed points

fp=NSolve[f[x]-x==0,x]
xfp=x/.fp[[3]]

Stability

fd=D[f[x],x]
Print["x*=",xfp,"    f'(x)=",fd/.{x->xfp}]

Evolution

x01=xfp+0.5
x02=xfp-0.5
orbit1=NestList[f,x01,10];
orbit2=NestList[f,x02,10];
plot1=Plot[xfp,{x,0,10}, PlotStyle->Magenta];
plot2=ListPlot[orbit1, Joined->True];
plot3=ListPlot[orbit2, Joined->True];
Show[plot1,plot2,plot3]

Example 2

Clear["Global`*"]
f[x_]=1/(x^2+1);
Plot[{x,f[x]},{x,-1,1},PlotRange->{-1,1},Frame->True]

Fixed points

fp=NSolve[f[x]-x==0,x]
xfp=x/.fp[[3]]

Stability

fd=D[f[x],x]
Print["x*=",xfp,"    f'(x)=",fd/.{x->xfp}]

Evolution

x01=xfp+0.5
x02=xfp-0.5
orbit1=NestList[f,x01,10];
orbit2=NestList[f,x02,10];
plot1=Plot[xfp,{x,0,10}, PlotStyle->Magenta];
plot2=ListPlot[orbit1, Joined->True];
plot3=ListPlot[orbit2, Joined->True];
Show[plot1,plot2,plot3]

Example 3

Clear["Global`*"]
f[x_]=(x^3-2);
Plot[{x,f[x]},{x,0,2},PlotRange->All,Frame->True]

Fixed points

fp=NSolve[f[x]-x==0,x]
xfp=x/.fp[[3]]

Stability

fd=D[f[x],x]
Print["x*=",xfp,"    f'(x)=",fd/.{x->xfp}]

Evolution

x01=xfp+0.01
x02=xfp-0.01
orbit1=NestList[f,x01,3]
orbit2=NestList[f,x02,4]
plot1=Plot[xfp,{x,0,10}, PlotStyle->Magenta];
plot2=ListPlot[orbit1, Joined->True];
plot3=ListPlot[orbit2, Joined->True];
Show[plot1,plot2,plot3]

Example 4 - semistable

Clear["Global`*"]
f[x_]=x-x^2;
Plot[{x,f[x]},{x,-1,1},PlotRange->All,Frame->True]

Fixed points

fp=NSolve[f[x]-x==0,x]
xfp=x/.fp[[1]]

Stability

fd=D[f[x],x]
fdd=D[fd,x]
Print["x*=",xfp,"    f'(x)=",fd/.{x->xfp},"    f''(x)=",D[fd,x]/.{x->xfp}]

Evolution

x01=xfp+0.6
x02=xfp-0.1
orbit1=NestList[f,x01,10]
orbit2=NestList[f,x02,10]
plot1=Plot[xfp,{x,0,10}, PlotStyle->Magenta];
plot2=ListPlot[orbit1, Joined->True];
plot3=ListPlot[orbit2, Joined->True];
Show[plot1,plot2,plot3]