Maxima asks about sign of integration(!) variable



On 26-09-2013 00:44, John Lapeyre wrote:
> On 09/26/2013 01:33 AM, Richard Fateman wrote:
> > On 9/25/2013 4:11 PM, Jaime Villate wrote:
> >> expr : sqrt(1+(4*x^(1/3)-1/16*x^((-1)/3))^2)$
> >
> > Mathematica, evaluating expr at -2.0
> > gives 2.54465 + 4.32153 i
> >
> > Maxima gives 5.0892904824535
>
> (%i64) float(realpart(expr)),x=-2,numer;
> (%o64)  2.544645241226752
> (%i65) float(realpart(expr)),x=-2;
> (%o65)  5.0892904824535
> (%i66) float(imagpart(expr)),x=-2;
> (%o66)   0.0
> (%i67) float(imagpart(expr)),x=-2,numer;
> (%o67)   4.321534242730678
That's one of the problems of ev(...); one can never tell in which order 
the evaluation is being made. It is more clear what's going to happen 
when you use subst.
float(subst(x=-2,expr))

Regards,
Jaime