Discussion:
radcan vs radexpand and documentation
Raymond Toy
2005-12-02 16:06:30 UTC
Permalink
The documentation for radcan says:

When `radexpand' is `false', certain transformations are inhibited.
`radcan (sqrt (1-x))' remains `sqrt (1-x)' and is not simplified
to `%i sqrt (x-1)'. `radcan (sqrt (x^2 - 2*x + 11))' remains
`sqrt (x^2 - 2*x + 1)' and is not simplified to `x - 1'.

(Note that there's a typo: 11 not 1.)

So, let's try it:

(%i7) display2d:false;

(%o7) false
(%i8) radexpand:false;

(%o8) false
(%i9) radcan(sqrt(1-x));

(%o9) sqrt(1-x)

This looks good.

(%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
Richard Fateman
2005-12-02 16:31:06 UTC
Permalink
Commercial macsyma gives abs(x-1).
Post by Raymond Toy
(%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

Loading...