On Fri, Mar 16, 2012 at 4:06 PM, Rubens Marinho <marinho.rubens at gmail.com>wrote:
> Dear all,
>
> radcan do understand assume and do it correctly.
> consider de code
>
No, not quite.
>
> (%i1) reset()$kill(all)$
> (%i3) radcan(sqrt(x^2)-x);
> (%o3) |x| -x
> (%i4) assume(x>0);
> (%o4)[x>0]
> (%i5) radcan(sqrt(x^2)-x);
> (%o5)0
>
This happens because maxima has already simplified sqrt(x^2)-x to zero, so
radcan effectively gets 0.
> (%i7) reset()$kill(all)$
> (%i1) assume(x<0);
> (%o1)[x<0]
> (%i2) radcan(sqrt(x^2)-x);
> (%o2)-2 x
>
> Similarly, maxima has already simplified this to -2*x by the time radcan
gets it.
You can see this if you trace(radcan).
Ray