I’m using Maple to solve some second and third order equations, and I find it difficult to chose the one root I want from the set of solutions.
My question is: when I get a solution in form of a RootOf, is there a simple way to chose (automatically) one of the allvalues? (for example in degree two, "the one with the minus sign before the sqrt").
In the same order of idea, I have a solution involving a (<big expression>)^1/2.
Now I know that my solution corresponds to the domain where the big expression is \(< 0\). Is there a way to tell that to Malpe, so that it can simplify the solution, knowing the result is real?
Well, you may be able to use "select" in some cases, if you can write a boolean function that will be true only for the root you want.
But in this particular case (assuming all the parameters are constants, and the solutions are real), you could just use "min". Another possibility is to use the version of "RootOf" that has an additional argument giving an approximate value of the root in question.
Thus if the solution involves RootOf(_Z^3 + _Z - 3), you can specify that you want the
root near 1 by replacing this with RootOf(_Z^3 + _Z - 3, 1).
"allvalues" can’t deal with this (at least in Release 3, I haven’t checked in Release 4 (the same behaviour in Release 4, U. Klein) ), but "evalf" can.
In the same order of idea, I have a solution involving a (<big | expression>)^1/2....
You can use "assume":