--------------------------------------------------
From: "Richard Fateman" <fateman at cs.berkeley.edu>
Sent: Saturday, August 28, 2010 8:45 PM
To: <drgst at web.de>
Cc: <maxima at math.utexas.edu>
Subject: Re: [Maxima] I need advice on how to use radcan
> 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).
I think people today don't like ambiguity. abs(a-b) = sqrt(a^2-2*a*b+b^2) can be thought of as an identity if you take
just the positive root, which is its appeal, I think. You could do the same thing in other, maybe better ways, like
using %union(). Personally I think %union() is better in cases like solve() and abs(a-b) better in others when I want
to cover all the possibilities and I am not trying to present abs(a-b) as an answer to a question like solve(). Just my
2 cents worth.
> Each value for z is differentiable. abs(a-b) is not.
>
diff(abs(x),x) =signum(x) except at 0 but then on the other hand at 0, a equals b. So what is wrong with that?
> 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
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>