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




> -----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.

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


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