plotting abs(log(x))



On 07/26/2012 09:11 AM, Jaime Villate wrote:
> On 07/25/2012 07:26 PM, Michele Minelli wrote:
>> I was trying to plot y=abs(log(x)) with
>>
>> /plot2d(abs(log(x)), [x, -10, 10]);/
>>
>> and I realized that Maxima plots a curve even for x less than zero. 
>> Could someone explain me why (I remember reading it once but I 
>> couldn't find it anymore) and how to disable this representation if I 
>> want?
> Hi,
> that issue has been discussed in this list and I thought we had 
> decided to use the plot option plot_realpart with a default value of 
> false (that is what the manual says too); however, the plot_realpart 
> option is no longer being accepted by plot2d. I will investigate 
> what's going on; I might be responsible for this bug :(
Please ignore my previous message. The option plot_realpart is working 
fine. For instance, try:
   plot2d(log(x),  [x, -10, 10]);
       (default value 'false' for plot-realpart)

   plot2d(log(x),  [x, -10, 10], [plot_realpart,true]);

The function you were attempting to plot, abs(log(x)) is a real 
function, with a real value for any real x different from zero and as 
Raymond told you, if you don't want to see the part for x<0 you should 
not use the domain [x,-10,10].

Notice that if x is real and less than zero, Maxima will give you the 
main-branch value:
   log(x) = log(abs(x)) + %i*%pi
and abs() for a complex argument will give you the modulus of the 
complex number:
   abs(log(x)) = sqrt( log(abs(x))^2 + %pi^2)

Regards,
Jaime