Re: vs. f[a]. When are they equal?
- To: mathgroup at smc.vnet.net
 - Subject: [mg118408] Re: vs. f[a]. When are they equal?
 - From: Bill Rowe <readnews at sbcglobal.net>
 - Date: Wed, 27 Apr 2011 05:38:01 -0400 (EDT)
 
On 4/26/11 at 4:43 AM, fateman at cs.berkeley.edu (Richard Fateman) wrote:
>Here's a fun thing to do with our function f[x_]:=1/(1-Exp[I x])  .
>try Plot[Re[f[x]],{x,0.01,20}]
>On my system it look like a plot of y=0.  A bug (Mathematica 7)?
Look closely at a plot of y = 0 and you will see that it is
different from a plot of f[x] above. The difference is much more
obvious if you move the origin for the axes. That is
Plot[0 , {x, .01, 20}, AxesOrigin -> {0, .5}]
is clearly different from
Plot[f[x], {x, .01, 20}, AxesOrigin -> {0, .5}]
Nothing at all is being plotted when you attempt to plot f[x].
This is not a bug since Plot is designed to plot functions where
they have real values. Doing
Plot[Im[f[x]], {x, .01, 20}, AxesOrigin -> {0, .5}]
shows the function has real values at regularly spaced points.
The likelihood of Mathematica selecting these points when
evaluating f[x] is essentially zero. Consequently, Plot all plot
sees as values for f[x] are complex values which are not plotted.