Dieter Kaiser wrote:
> I have collected known properties of the sqrt function in a wxMaxima
> file to document the knowledge of Maxima about the sqrt function.
>
>
..
Thanks for this collection, but I suspect that the troubling cases (and
many more that are not listed!)
are caused by different interpretations of roots, and can be resolved if
you decide to return
BOTH square roots. Or in the case of nested ones, perhaps 2^n. I
continue your example..
> Now an example where radcan fails but rootscontract is correct:
>
> (%i10) expr:sqrt(sqrt(1-z^2)-1)/sqrt(1-sqrt(1-z^2))
> -sqrt(-z^2)/sqrt(z^2);
> (%o10) sqrt(sqrt(1-z^2)-1)/sqrt(1-sqrt(1-z^2))-%i
>
> For a positive or negative number no simplification to zero, but
> approximately zero:
>
> (%i11) expr,z=2;
> (%o11) sqrt(sqrt(3)*%i-1)/sqrt(1-sqrt(3)*%i)-%i
> (%i13) rectform(expr),z=2,bfloat;
> (%o13) 0.0b0
>
> (%i14) expr,z=-2;
> (%o14) sqrt(sqrt(3)*%i-1)/sqrt(1-sqrt(3)*%i)-%i
> (%i15) rectform(%),z=-2,bfloat;
> (%o15) 0.0b0
>
> Radcan simplifies to a wrong result:
>
> (%i16) radcan(expr);
> (%o16) -2*%i
>
Try expr,z=%i;
rectform(%);
---> -2*%i
So maybe radcan is right for certain values of z. Maybe "most" of them..
The question is, do you simplify only on the real line? (By suitable
manipulation you
could change to some other line...).
Radcan is not intended for nested radicals, by the way, and it doesn't
pretend to
produce "one correct answer". It produces a particular one which may
not be your favorite.