radcan vs radexpand and documentation



Commercial macsyma gives abs(x-1).
Raymond Toy wrote:


> 
>     (%i10) radcan(sqrt(x^2-2*x+1));
> 
>     (%o10) x-1
> 
> Uh, that's not the documentation says.
> 
> What is supposed to happen here?
> 
> Ray

Here is the commercial on-line documentation

RADEXPAND default:TRUE

If set to ALL will cause 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) will become 4*X .  Also, if RADEXPAND is ALL,
SQRT(X*Y) will become SQRT(X)*SQRT(Y) .

In particular, consider SQRT(X^2).

(a) If RADEXPAND is ALL or ASSUME(X>0) has been done, SQRT(X^2) will
     become X.
(b) If RADEXPAND is TRUE and DOMAIN is REAL (its default), SQRT(X^2)
     will become ABS(X).
(c) If RADEXPAND is FALSE, or RADEXPAND is TRUE and DOMAIN is COMPLEX,
     SQRT(X^2) will be returned.

(The notion of DOMAIN with settings of REAL or COMPLEX is still in
its infancy.  Note that its setting here only matters when RADEXPAND is
TRUE.)

Do EXAMPLE(RADEXPAND); for an example.

See also RADCAN, ROOTSCONTRACT, ROOTSCONMODE, DENEST_SQRT.

............
Since the original RADCAN was written (by me, in 1970 or so)
it has been re-worked by others who either didn't know what
it was supposed to do, or decided that it should do something
else. RADEXPAND was not part of the original deal. Neither was abs().
I can tell you what the original RADCAN did, but that doesn't
help here.

RJF