On 2/9/2011 11:50 PM, "Ren? K?lin" wrote:
> Hello
>
> I tried this (with Maxima 5.21.1):
>
> domain:real$
> t:x^(1/2)*x^(1/2);
> assume(x<0);
> t;
> forget(x<0)$
> assume(x>=0);
> t;
>
> with the output:
>
> (%o2) x
> (%o3) [x<0]
> (%o4) x
> (%o6) [x>=0]
> (%o7) x
>
> I only want to consider some real numbers. Because the squareroot of x is not defined for x<0, %o4 is wrong, isn't it?
>
> The Problem seems to be that t:x^(1/2)*x^(1/2) is simplified immediately to x in any case.
>
> (I sent this post 2 days ago with a wrong title. Sorry if you received it twice.)
It seems hopeless to point out that x>0 does not mean that sqrt(x)>0,
mathematically.
There are 2 square roots. For example sqrt(16) is {-4, 4}, even though
16>0.
The square root of x, for x<0 IS defined. It just happens to be imaginary.
There is no simple way of making Maxima forget about complex numbers,
even if you decide that certain of the inputs represent real numbers.
What you seem to be insisting on is
not that x>0, but that sqrt(x)>=0.
Perhaps you should
define a new function positive_sqrt(x):= .... if (x<0) then error else
....
Yes, I know that in Maxima sqrt(z^2) comes out abs(z), but if you do
assume(z>0), then abs(z) comes out as z.
This first step, sqrt(z^2) to abs(z) is, in general, wrong, so there
you are, with the subsequent step propagating the questionable result.