I'm learning MMA with Wagner's book. On page 41, he uses this to display the iterative steps of a FindRoot. However, I can't seem to replicate this (code at end), perhaps due to the difference in MMA versions (his was MMA 3.0!). Using Trace doesn't seem to help; it just displays the final value of x.

Codes:
FindRoot[Print[x]; Sin[x] - Cos[x], {x, 0.5}]
Trace[FindRoot[Sin[x] - Cos[x], {x, 0.5}]]
Edit I have also tried to use his method--Print[x] within a function--for an exercise in the section and that seems to work (though with some quirk in the result). EvaluationMonitor also works, and frankly I find the latter much more intuitive. Below is my solution for the problem (code at end); I'm not sure if this is the way Sin[x] is actually sampled, so any feedback is very welcome.

Plot[Sin[x], {x, \[Pi]/4, \[Pi]/2}] // InputForm
Plot[Print[x]; Sin[x], {x, \[Pi]/4, \[Pi]/2}]
Reap[Plot[Sow[x]; Sin[x], {x, \[Pi]/4, \[Pi]/2}]][[2]]
{plot, List@stepValue} =
Reap[Plot[Sin[x], {x, \[Pi]/4, \[Pi]/2},
EvaluationMonitor :> Sow[x]]];
stepValuePoints = {stepValue, Sin[stepValue]} // Transpose;
ListPlot[stepValue, AxesLabel -> {Step, x}]
Manipulate[
Show[
(* Actual y = Sin[x] curve *)
Plot[Sin[x], {x, \[Pi]/4, \[Pi]/2}, PlotStyle -> Yellow],
(* Generated mesh points *)
ListPlot[stepValuePoints, PlotStyle -> Red],
(* Arrow tail *)
ListLinePlot[{Table[stepValuePoints[[i]], {i, step - 5, step - 1}]}],
(*Arrow head *)
Graphics@{Blue,
Arrow[{stepValuePoints[[step - 1]], stepValuePoints[[step]]}]},
PlotRange -> {{\[Pi]/4, \[Pi]/2}, {Sqrt[2.]/2, 1}}], {step, 6,
Length[stepValuePoints], 1}]
anim = Table[
Show[
(* Actual y = Sin[x] curve *)
Plot[Sin[x], {x, \[Pi]/4, \[Pi]/2}, PlotStyle -> Yellow],
(* Generated mesh points *)
ListPlot[stepValuePoints, PlotStyle -> Red],
(* Arrow tail *)
ListLinePlot[{Table[
stepValuePoints[[i]], {i, step - 5, step - 1}]}],
(*Arrow head *)
Graphics@{Blue,
Arrow[{stepValuePoints[[step - 1]], stepValuePoints[[step]]}]},
PlotRange -> {{\[Pi]/4, \[Pi]/2}, {Sqrt[2.]/2, 1}}], {step, 6,
Length[stepValuePoints], 1}];
Export["anim.gif", anim, "DisplayDurations" -> 0.25]

EvaluationMonitoroption. – b.gates.you.know.what Jun 21 '14 at 21:17