rectplot[fff_,inputx_,inputy_, opts___] := ParametricPlot[Through[{Re,Im}[fff[x+I*y]]], {x,inputx[[1]], inputx[[2]]}, {y,inputy[[1]],inputy[[2]]}, opts, PlotStyle->None, Mesh->True];
discplot[fff_,inputx_,inputy_, opts___] :=ParametricPlot[Through[{Re,Im}[fff[r Exp[I t]]]],{r,inputx[[1]], inputx[[2]]},{t,inputy[[1]],inputy[[2]]},opts,PlotStyle->None, Mesh->True];

THESE FIRST FEW CELLS (WHICH LOOK EMPTY) CONTAIN THE CODE FOR THE COMMANDS USED BELOW.  I WOULDN'T RECOMMEND DELETING THEM.  YOU ARE WELCOME TO TAKE A LOOK THOUGH!

cobwebs[functmm_,lowermm_,endmm_,startmm_,nummm_,opts___]:=(makesomelines[x_]:={Line[{{x,x},{x,functmm[x]}}],Line[{{x,functmm[x]},{functmm[x],functmm[x]}}]};Plot[{x,functmm[x]},{x,lowermm,endmm},opts,Epilog->{makesomelines/@NestList[functmm,startmm,nummm]}])

orbitwebs[functmm_,lowermm_,endmm_,startmm_,nummm_,skipmm_,opts___]:=Plot[{x,functmm[x]},{x,lowermm,endmm},opts,Epilog->{Line[Partition[NestList[functmm,Nest[functmm,startmm,skipmm],nummm],2,1]]}]

cyclefinder[functmm_,startmm_,maxmm_]:=Block[
	{nthmm,twonthmm,countermm,resultmm,valuemm},
	nthmm=functmm[startmm];
	twonthmm=functmm[functmm[startmm]];
	countermm=1;
	While[(Abs[nthmm-twonthmm]>10^(-11)) &&
		(countermm<maxmm),
		nthmm=functmm[nthmm];
		twonthmm=Nest[functmm,twonthmm,2];
		++countermm];
	resultmm={nthmm};
	valuemm=functmm[nthmm];
	If[Abs[countermm-maxmm]>.5,
		While[Abs[valuemm-nthmm]>10^(-10),
			AppendTo[resultmm,valuemm];
			valuemm=functmm[valuemm];]];
	Print["The counter stopped at: ",countermm];
	If[maxmm>countermm,
		Print["There seems to be a cycle of length:  ",Length[resultmm]],
		Print["No cycle found"]];
	outlist=resultmm;
	If[Abs[countermm-maxmm]>.5,resultmm,nthmm]]

silentfinder[functmm_,startmm_,maxmm_]:=Block[
	{nthmm,twonthmm,countermm,resultmm,valuemm},
	nthmm=functmm[startmm];
	twonthmm=functmm[functmm[startmm]];
	countermm=1;
	While[(Abs[nthmm-twonthmm]>10^(-11)) &&
		(countermm<maxmm),
		nthmm=functmm[nthmm];
		twonthmm=Nest[functmm,twonthmm,2];
		++countermm];
	resultmm={nthmm};
	valuemm=functmm[nthmm];
	If[Abs[countermm-maxmm]>.5,
		While[Abs[valuemm-nthmm]>10^(-10),
			AppendTo[resultmm,valuemm];
			valuemm=functmm[valuemm];]];
	(*Print["The counter stopped at: ",countermm];
	If[maxmm>countermm,
		Print["There seems to be a cycle of length:  ",Length[resultmm]],
		Print["No cycle found"]];*)
	outlist=resultmm;
	]

iterategraph[functmm_, startmm_, numbermm_, skipmm_, opts___]:=
 ListPlot[NestList[functmm,Nest[functmm,startmm,skipmm],numbermm]
 , opts]

iterate[functmm_,startmm_, itmm_,skipmm_]:= 
MatrixForm[N[NestList[functmm,Nest[functmm,N[startmm],skipmm],itmm],10]]

iterateexact[functmm_,startmm_, itmm_,skipmm_]:= 
MatrixForm[NestList[functmm,Nest[functmm,startmm,skipmm],itmm]]

symbols[list_]:=Table[If[list[[i]]<.5,0,1],{i,1,Length[list]}]

newtons[functionmm_, varmm_, startmm_, itmm_] :=
(newt[zmm_] :=  zmm - (functionmm /. varmm-> zmm)/(D[functionmm,varmm] /. varmm->zmm);
iterate[newt,startmm, itmm, 0])

newtonsexact[functionmm_, varmm_, startmm_, itmm_] :=
(newt[zmm_] :=  zmm - (functionmm /. varmm-> zmm)/(D[functionmm,varmm] /. varmm->zmm);
iterateexact[newt,startmm, itmm, 0])

All of these functions will be used at some point in the course.

f[x_] := a x(1-x);  (*Section 5.1*)

g[x_] := x E^(r (1-x));

h[x_] := x^2+c;

j[x_] := Abs[x-1];

circle[x_] := Mod[n x, 1];  (*Section 5.1*)

power[x_] :=  x^n;  (*Section 5.1 for n=2*)

tent[x_] := If[x<1/2, c x, -c (x-1)];  (*  Section 5.1:  Note step function here! *)

lc[z_] := c z;

(*Here is a bigger step function.  See the end of the file for analysis.*)
step[x_] := 3 /; x<1;
step[x_] := 2x+1 /; 1<= x <= 2;
step[x_] := 7-x /; 2<= x <= 3;
step[x_] := 10-2x /; 3<= x <= 4;
step[x_] := 6-x /; 4<= x <= 5;
step[x_] := 1 /; x>5;

newf[x_] := k(1-(Abs[2x-1])^p)