Fix for bug [ 1370433 ] trigsimp(sqrt(%i2)) !=sqrt(trigsimp(%i2))?
Subject: Fix for bug [ 1370433 ] trigsimp(sqrt(%i2)) !=sqrt(trigsimp(%i2))?
From: Robert Dodier
Date: Fri, 10 Nov 2006 10:08:53 -0700
On 11/10/06, Andrey G. Grozin <A.G.Grozin at inp.nsk.su> wrote:
> > (%i2) sqrt(x^2);
> > (%o2) abs(x)
> But this is wrong! maxima should stop doing this. For example, for
> x = 1 + %i
> with the standard cut along the negative real half-axis,
> sqrt(x^2) = 1 + %i = x
> but
> abs(x) = sqrt(2)
Here Maxima is making an unstated assumption that symbols
represent real variables unless declared complex.
(declare(y, complex), sqrt(y^2)) => sqrt(y^2)
I don't know if that policy is followed 100%.
Also, Maxima recognizes cabs as the absolute value of a complex
variable (as opposed to abs for the absolute value of a real variable).
Again, I don't know if Maxima consistently makes that distinction.
Hope this helps
Robert Dodier