In the case of quadratics, cubics & quartics, it may be impossible to determine without additional information about the actual values of variables which of the solutions is real and which are not.
I still think that this is a worthwhile goal, but it would require a substantial amount of work to produce what Gerd wants.
At 07:22 AM 1/22/2012, Richard Fateman wrote:
>Solve generally ignores declarations, except insofar as it might call some other program like simplification, that uses them.
>
>You will have to filter out the real solutions some other way.
>
>Designing another version of solve that considers assumptions and declaration might be worthwhile.
>
>RJF
>
>On 1/22/2012 5:59 AM, Gerd Kortemeyer wrote:
>>Hi,
>>
>>We have been using MAXIMA successfully inside of LON-CAPA for homework problems for several years now - it's a great tool, thanks everybody!!!
>>
>>While authoring a new kind of homework, I am struggling with "declare" - why does the following (sample) code not give the expected results?
>>
>>(%i4) declare(x,real);
>>(%o4) done
>>(%i5) solve(x^3=125,x);
>> 5 sqrt(3) %i - 5 5 sqrt(3) %i + 5
>>(%o5) [x = ----------------, x = - ----------------, x = 5]
>> 2 2
>>(%i6) facts();
>>(%o6) [kind(x, real)]
>>
>>Is there another way to tell "solve" to stay in the real realm?
>>
>>Thanks!
>>
>>- Gerd.