>-----Original Message-----
>From: Richard Fateman Sent: Friday, August 02, 2013 1:50 PM To: Richard
>Hennessy Cc: David.Ronis at McGill.CA ; Mailing Maxima Subject: Re: [Maxima]
>Atan2 doesn't symplify as expected.
>>On 8/2/13 10:26 AM, Richard Hennessy wrote:
>>
>>
>> -----Original Message----- From: Richard Fateman
>> Sent: Thursday, August 01, 2013 5:13 PM
>> To: David.Ronis at McGill.CA ; Mailing Maxima
>> Subject: Re: [Maxima] Atan2 doesn't symplify as expected.
>>
>> It may not be something that Maxima (or some of
>> its programmers) apparently agrees with, but
>> noting that q is greater than zero does not, mathematically speaking,
>> tell you that sqrt(q) is greater than zero. The
>> object q still has 2 square roots in general.
>>
>> Also, if nothing at all is known about q,
>> sqrt(q^2), which Maxima simplifies to abs(q),
>> is nonsense as well, since there are two values,
>> q and -q, neither of which is abs(q).
Is this okay? It is known that x is real and not much more, I think. Do you
think the user should see, or would know, that n2 is the right way to enter
this expression, not n1. See below for variables n1 and n2. What am I
missing?
(%i17) display2d:false;
(out17) false
(%i18) domain;
(out18) real
(%i19) n1:sqrt(x^4-2*x^2+1);
(out19) sqrt(x^4-2*x^2+1)
(%i20) n2:scanmap('factor,n1);
(out20) abs(x-1)*abs(x+1)
(%i21) facts();
(out21)
[kind(sinh,one_to_one),kind(log,one_to_one),kind(tanh,one_to_one),kind(log,increasing)]
>>
>> RJF
>>
>> I don't think it is necessary to say one interpretation of sqrt(x^2) is
>> preferable than another, absolutely.
>If a system uniformly transforms sqrt(x^2) to abs(x) then it is likely to
>support simple various "proofs"
>like -1 = 1. Etc.
Probably, but the user should know that Maxima is not computerized theorem
proving software. It has many other uses including that but that is not its
purpose, so caution is in order.
>> The sqrt() function is going to be part of an argument to a Maxima
>> function that it is passed to by the user.
>If a user types in sqrt(x^2) but means abs(x), then he is "in error" since
>they are not the same.
Is the user wrong to type in n1 instead of n2?
>If a program computes a result including sqrt() without specifying which
>sqrt, then it is in error
>unless it doesn't matter which sqrt.
>> Clearly if you are working within the scope of pw.mac's (a package with
>> real numbers as it's main focus) integration command you have to say
>> sqrt(x^2) = abs(x) because integration requires a function as its
>> argument and functions by definition are single valued expressions.
>This doesn't follow. Sqrt() is ambiguous. It could be either of two
>single-valued functions.
>Sometimes it helps to think: does my program generalize to (say) cube
>roots or 3/8 roots?
>> Given that, the user knows sqrt(x^2) is going to be, most likely
>> abs(x).
>This makes sense in some very limited contexts. e.g. if you are given
>f(x):= sqrt(g(x)^2), and you know that
>f(x)>=0 then abs(g(x)) is OK. If you know that g(x)>0 THAT TELLS YOU
>NOTHING!!.
I agree with that.
>> If the user want to change that default interpretation they can always
>> change their input to -sqrt(x^2).
>This misses the point, because -abs(x) is just as wrong as abs(x).. Neither
>is a solution to y^2=x^2.
>> I don't think any user would expect an expression containing sqrt(x^2) to
>> be interpreted as -abs(x).
>If an expression is 40 pages long, a user will not necessarily notice such
>details. Basing the design
>of a computer algebra system on what a programmer expects that
> a user will probably expect by "eyeballing' an expression is of
>limited use.
Well, slightly limited, since in most cases you can find errors by other
methods.
>RJF
>>
>> Rich
>>