Maxima asks about sign of integration(!) variable



Mathematica's justification for doing it differently
is to avoid this:

(%i1) rectform((-1.0+ 0.0*%i)^(1/3));
(%o1) -1.0
(%i2) rectform((-1.0+ 1e-10*%i)^(1/3));
(%o2) .8660254037677719*%i+.5000000000288676

(%i1) rectform(limit((-1 + (y + 1e-10) * %i)^(1/3), y,0));
(%o1) .8660254037677719*%i+.5000000000288676
(%i2) rectform(limit((-1 + y * %i)^(1/3), y,0));
(%o2) -1

You can look at wikipedia and other pages on cube
roots.

I don't know what to do about that in Maxima, maybe define another
operator for roots that behaves differently.

Also:

>  (expt -1 (/ 1 3))
#C(0.5f0 0.8660254f0)

So lisp promotes the type automatically.

c99 gives the same result for cube root of
-1.0 as complex type. But there you have to
explicitly ask for the complex root function.

Of course, the OP may have wanted real roots.
In Mma it is enough of a problem, that they
added CubeRoot and Surd with real domain and
range in version 9.

cheers,
John

On 09/26/2013 09:19 AM, Jaime Villate wrote:
>  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
>