(*Created by Rafael Luís: rafaelluis@netmadeira.com
 2016-09-11: adapted for Mathematica v.10 by Ross Moore *)

(*Iterates functions  - in this case the logistic map*)

(*Function for iterate*)
Clear[α,f,x]
f[x_,α_]:=α×x×(1-x)

(*iterates*)
f2[x_,α_]:=f[f[x,α],α]
f3[x_,α_]:=f[f2[x,α],α]
f4[x_,α_]:=f[f3[x,α],α]

α:=3.5

graficos=Plot[{x,f[x,α],f2[x,α],f3[x,α],f4[x,α]},{x,0,1},AspectRatio->Automatic (*,PlotStyle->{{RGBColor[0,0,0]},{RGBColor[0,0,0]},{RGBColor[0,0,1]},{RGBColor[0,1,0]},{RGBColor[1,0,0]}}*)
,PlotLegends->{x,f,(f^((2))),(f^((3))),(f^((4)))}]