Fix for bug [ 1370433 ] trigsimp(sqrt(%i2))!=sqrt(trigsimp(%i2))?



>>>>> "Richard" == Richard Fateman <fateman at cs.berkeley.edu> writes:

    >> -----Original Message-----
    >> From: maxima-bounces at math.utexas.edu [mailto:maxima-
    >> bounces at math.utexas.edu] On Behalf Of Robert Dodier
    >> Sent: Friday, November 10, 2006 12:56 PM
    >> To: Raymond Toy
    >> Cc: maxima at math.utexas.edu
    >> Subject: Re: [Maxima] Fix for bug [ 1370433 ]
    >> trigsimp(sqrt(%i2))!=sqrt(trigsimp(%i2))?
    >> 
    >> On 11/10/06, Raymond Toy <raymond.toy at ericsson.com> wrote:
    >> 
    >> >     Robert> Here Maxima is making an unstated assumption that symbols
    >> >     Robert> represent real variables unless declared complex.
    >> >     Robert> (declare(y, complex), sqrt(y^2)) => sqrt(y^2)
    >> >     Robert> I don't know if that policy is followed 100%.
    >> >
    >> > This is also controlled by the domain variable.  The default is real,
    >> > so sqrt(x^2) -> abs(x).  If the domain is complex, sqrt(x^2) remains.

    Richard> If x is real, then the sqrt of x^2 is still not abs(x).
    Richard> If you need a more elaborate example, consider Sqrt(
    Richard> x^2-2*x*y+y^2) which is either (x-y) or (y-x) [or
    Richard> preferably, both :) ]

I wasn't arguing either way.  I just wanted to say that the domain
variable is documented to do what it does, for whatever reason.

    Richard> If you choose abs(x-y) instead, then sqrt(%)-
    Richard> simplified(sqrt(%)) is zero when x>=y.  Is this what we
    Richard> would expect?

I don't know because I don't know what % is in this case, and I don't
know what you mean by "simplified(sqrt(%))" versus just "sqrt(%)". 

Ray