Suppose we want to solve the inequality $ax^2+bx+c<0$. For simplicity, presume that $a>0$ and $b^2-4ac>0$. In this form, this is almost a trivial problem. Despite that, if we want to solve it with Mathematica (Reduce), version 8, the
Assuming[a > 0 && b^2 - 4*a*c > 0, Reduce[a*x^2 + b*x + c < 0, x, Reals]]
command generates dozens of lines (instead of simply being -(b/(2 a)) - 1/2 Sqrt[(b^2 - 4 a c)/a^2] < x < -(b/(2 a)) + 1/2 Sqrt[(b^2 - 4 a c)/a^2]
, in which this solution is present somewhere deeply, but it is full of
- unnecessary case separations (as if it couldn't interpret the $b^2-4ac<0$ condition, and although it was given as assumption, it repeats this in the solution in equivalent forms),
- impossible conditions (such as $a\leq 0$ which should have been ruled out by the assumptions),
- branches with clearly contradictory conditions (such as
x < -(b/(2 a)) - 1/2 Sqrt[(b^2 - 4 a c)/a^2] || x > -(b/(2 a)) - 1/2 Sqrt[(b^2 - 4 a c)/a^2]
at the very beginning).
The usage of
Reduce[{a > 0, b^2 - 4*a*c > 0, a*x^2 + b*x + c < 0}, x, Reals]
and especially
FullSimplify[Reduce[{a > 0, b^2 - 4*a*c > 0, a*x^2 + b*x + c < 0}, x, Reals]]
alleviates the issue a bit (which is itself surprising given of what Assuming
should do… or at least what I thought it should do…), but it is still far from what I've expected as a result. (Especially because this last command, although it produces the shortest output, it doesn't even give an explicit solution for $x$.)
Thank you in advance!
Best Answer
As far as I know,
Reduce
doesn't use the assumptions system, onlyRefine
,Simplify
,FullSimplify
andFunctionExpand
do.So you could manually put the assumptions into
Reduce
, then remove them from the result using the simplify mechanism:which yields
If you include $b\neq0$ in your assumptions, then you get the simple result that you're looking for: