Newton's Method Homework.

The code for the programs   SingleStep,  NewtonStep,  and NaiveNewton which have been demonstrated in class, and in the notebook Newton_Method.nb, is hidden here.  Use these programs to do the exercises from Section 3.8 of the text.

Needs["Graphics`Colors`"]NewtonStep[f_] :=Module[
		{next,  realroot,  line,  curve},
		next =  guess - N[((f[guess])/(f'[guess]))];
	
		
	Print["guess =  ",  guess,  "   next  = ",  next]
                ;
realroot  =  x /. FindRoot[f[x],  {x,  guess}];
scale  =  1.5* Abs[guess  - realroot];
\(line\  = \ 
                Plot[\ f[guess]\  + \ \(f'\)[guess]\ *\((x\  - \ guess)\), 
                  \ {x, \ realroot - scale, \ realroot\  + \ scale}, 

                  				PlotStyle\  -> {AbsoluteThickness[2], \ Red}, 

                  			DisplayFunction\  -> Identity]\);
\(curve\  = \ 
                Plot[\ f[x], 
                  \ {x, \ realroot - scale, \ realroot\  + \ scale}, 

                  				PlotStyle\  -> {AbsoluteThickness[2], Black}, 

                  			DisplayFunction\  -> Identity]\);
\(points\  = \ 
                Graphics[

                  		{PointSize[ .02], \ Blue, 
                    \ {Point[{guess, \ 0}], 
					
                      Point[{guess, \ f[guess]}], \ 
				
                      Point[{next, \ 0}]}}, \ Color\  -> \ Blue
				]\);
		\(Show[{line, \ curve, \ points}, \ 	
                DisplayFunction\  -> \ $DisplayFunction]\);
		guess  =  next;
		]
SingleStep[f_] :=Module[
		{next},
		next =  guess - N[((f[guess])/(f'[guess]))];Print["guess =  ",  guess,  "   next  = ",  next]
                ;
		guess  =  next;
		]
Clear[NaiveNewton]NaiveNewton[f_, guess_]:=
	Module[{newtstep, root},
		newtstep = 1;
		root = guess;
		While[Abs[newtstep] > 10^(-6),
			newtstep=N[-((f[root])/(f'[root]))];
			root = root + newtstep;
		Print[root];
		];
		N[root, 6]]