> factor(b)
But of course the idea is not how to make it happen, but rather what
the default behavior is.
On Sep 23, 2011 2:56 AM, "Dmitry Shkirmanov" <piminusmeson at bk.ru> wrote:
> I found radexpand option variable in the reference manual:
>> radexpand
>> Option variable
>> Default value: true
>> radexpand controls some simpli?cations of radicals.
>> When radexpand is all, causes nth roots of factors of a product which
>> are powers
>> of n to be pulled outside of the radical. E.g. if radexpand is all,
>> sqrt (16*x^2)
>> simpli?es to 4*x.
>> More particularly, consider sqrt (x^2).
>> ? If radexpand is all or assume (x > 0) has been executed, sqrt(x^2)
>> simpli?es
>> to x.
>> ? If radexpand is true and domain is real (its default), sqrt(x^2)
>> simpli?es to
>> abs(x).
>> ? If radexpand is false, or radexpand is true and domain is complex,
>> sqrt(x^2)
>> is not simpli?ed.
>> Note that domain only matters when radexpand is true.
>
> But it does not work for me(version of maxima is 5.25.1):
>
> (%i1) radexpand:true;
> (%o1) true
> (%i2) b: ((1-x)/sqrt(1-2*x+x^2));
> 1 - x
> (%o2) ------------------
> 2
> sqrt(x - 2 x + 1)
> (%i3) radcan(b);
> (%o3) - 1
> (%i4) radexpand: false;
> (%o4) false
> (%i5) radcan(b);
> (%o5) - 1
>
maybe the default is now all instead of true?
>
>> http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions
>> which seems to find a bug in radcan. ?Here is the relevant Maxima
>> session.
>>
>>
>> (%i3) b:((1-x)/sqrt(1-2*x+x^2));
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 - x
>> (%o3) ? ? ? ? ? ? ? ? ? ? ? ? ------------------
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sqrt(x ?- 2 x + 1)
>> (%i4) radcan(b);
>> (%o4) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - 1
>>
>> which seems a little aggressive.
>
> Radcan will consistently choose a branch for the square root. ?It may not be
> the one you would choose, but it does so by picking a main variable (here, x
> is the only one) and looking at the sign of the leading coefficient. ?If it
> is negative, it takes out a factor of sqrt(-1).
I see. That should probably be more explicit in the documentation for
radcan, then. Or?
>>
>> (%i7) d:((1-x)/sqrt((1-x)^2));
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 - x
>> (%o7) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ----------
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? abs(x - 1)
>
> This of course has nothing to do with radcan, and I personally view this
> transformation as a bug.
> A correct result for d is a representation of the pair {-1,1}. The answer
> above is neither 1, -1, or the pair, but a step function except at x=1 where
> it is possibly undefined.
Right. So you are saying that (1-x)/abs(x-1) is NOT a function, but
purely a symbolic expression which may happen to take on the value 1
or -1? But that is not how most users of Maxima will see it, I think.
>> doesn't give very many details. But I'm certainly not an expert in
>> making expressions canonical :)
>
> There's plenty of detail in my PhD dissertation, TR-95, MIT Project MAC.
> http://publications.csail.mit.edu/lcs/specpub.php?id=663
Yes, since you *are* an expert.
Which reiterates my suggestion that radcan could have a lot more
detail in its documentation (and not pointing to a dissertation...)
+++
Thanks for all three of your suggestions.