Only real roots (basic)



On 12/8/2013 8:20 AM, Stavros Macrakis wrote:
> On Sun, Dec 8, 2013 at 8:26 AM, Ricardo JF <rcrdjf at hotmail.com 
> <mailto:rcrdjf at hotmail.com>>wrote:
>
>     why this doesn't give only real roots:
>
>     f(x):=x^3-x^2+x+1;
>     declare(x,real);
>     solve(f(x));
>
>     i just want [x=(sqrt(11)/...)]
>
>
> It doesn't give only real roots because the "solve" command ignores 
> the "real" declaration. In fact, the "solve" command ignores most 
> declarations, e.g. assume(x>3)$ solve(x=0,x) will return [x=0].
>
> Should this be changed? Arguably yes, but I don't know if anyone is 
> interested in working on that....
>
>              -s

There is certainly an argument to be made that a command should exist 
that does something like
this.  There is an attempt to do this in Mathematica, with a command 
called Reduce.
Reduce has gotten more capable in later versions.  Example..

Reduce[x^2 - 7 y^2 == 1 && x > 0 && y > 0, {x, y}, Integers]

What should one do in general?

Find a simultaneous solution to a set of (a) equalities, (b) 
inequalities, (c) conditional constraints (d) domain restrictions...

There is also, in Mathematica, a command Solve.

There are areas of technology that have not , so far as I know, been 
exploited in
Maxima, e.g. cylindrical algebraic decomposition.  Also some people are 
big fans
of Grobner basis computations.

It would probably be possible to start with simple cases like linear 
equations ( :) ),
linear inequalities,  univariate polynomials, multivariate polynomial 
equations..

Some of this is already in Maxima but the task would be to try to put it 
all in "one place".
Putting yet more complexity into the command "solve" in Maxima would 
have to be
done very carefully so as to not break existing stuff, so I think it 
would be better to
have a different command, at least to start.

RJF