Please consider
FindInstance[m >= 0 && x >= 0 && x <= m, {x}]
for which, I would like a parametric answer x = m
or x=m/2
.
But this yields an error:
FindInstance: The system contains a nonconstant expression m independent of variables {x}.
How can I achieve this goal?
1 Answer
FindInstance wants to have all the variables listed expicitly. So you can do:
FindInstance[m >= 0 && x >= 0 && x <= m, {x, m}]
To see many answers:
FindInstance[m >= 0 && x >= 0 && x <= m, {x, m}, 5]
If you want a specific answer (like x==m/2), then you'll need to say that you want that form
FindInstance[m >= 0 && x >= 0 && x <= m && x == m/2, {x, m}, 5]
Thus FindInstance finds a numerical example, not a symbolic one. If you want to keep things symbolic, perhaps you can use Reduce or Solve, for example
Reduce[m >= 0 && x >= 0 && x <= m && x == m/2]
reduces to a smaller number of statements (two) that is equivalent to the four conditions input.
Reduce
is what you need? $\endgroup$