On 8/28/2010 1:28 PM, drgst (at) web (dot) de wrote:
> Hi all,
>
> here is a simple example which frightens me:
>
> (%i1) sqrt(a^2-2*a*b+b^2);
> (%i2) radcan(%);
> (%o2) b-a
> Obviously, the mathematically correct answer would read abs(b-a) or
> abs(a-b).
Actually, this is not obvious.
sqrt(a^2-2*a*b+b^2) is a shorthand for one, or the other, or both, of
the roots with respect to z of
z^2=a^2-2*a*b+b^2.
The values for z are a-b and b-a.
Note that neither of them is abs(a-b).
Each value for z is differentiable. abs(a-b) is not.
The introduction of abs() in the answers to radcan makes a hash of its
attempt to make algebraic sense.
Unfortunately, people seem to want something else, and someone mucked
about with the original
definition.
Richard Fateman (who first wrote radcan in 1969 or so)
> But at least, this behaviour of radcan() is documented.
> But I firstly do not understand why "radexpand:false" does not work as
> documented and secondly, how I should proceed to simplify the
> expressions if I don't know (suppose a as well as b are complicated
> expressions depending on parameters) whether a<b or b<a, respectively.
Since maxima will change sqrt(x^2) to abs(x), all you need to do is
factor the argument to sqrt, I suppose.
>
> Regards
> Dragan
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima