According to this question, the solutions to the equation $x^3 + p x^2 + q x + r = 0$ ($p, q, r \in \mathbb R$) are positive iff $p < 0$, $q > 0$, $r < 0$, and $-27 r^2 - 2 p {\left(2 p^2-9 q\right)} r + q^2 {\left(p^2-4 q\right)} \geqslant 0$.
Mathematica is able to reduce the corresponding inequalities as follows:
{x1,x2,x3}=SolveValues[x^3+p*x^2+q*x+r==0,x,Cubics->False];
con1=ApplySides[FullSimplify,Reduce[{x1,x2,x3}\[VectorGreater]0,Reals]]
The output is not very inspiring, yet we can see that it is equivalent to the above conditions:
con0=And[p<0,q>0,r<0,Discriminant[x^3+p*x^2+q*x+r,x]≥0];
Resolve[ForAll[{p,q,r},con1\[Equivalent]con0],Reals]
True
However, I do not understand why the following code does not work:
con2=Reduce[ForAll[x,x^3+p*x^2+q*x+r==0,x>0],Reals];
Resolve[ForAll[{p,q,r},con2\[Equivalent]con0],Reals]
False
The documentation claims that “ForAll[x, cond, expr]
states that expr
is true ∀ x
satisfying the condition cond
”, so ForAll[x, x^3 + p x^2 + q x + r + x^3 == 0, x > 0]
should mean that all roots of x^3 + p*x^2 + q*x + r
must be positive. But why is con2
not equivalent to con0
?
con2
is condition for at least one positive root whilecon0
for all three roots positive. $\endgroup$Exists[x,x^3+p*x^2+q*x+r==0,x>0]
? Note thatExists[x, cond, expr]
states that there exists anx
satisfying the conditioncond
for whichexpr
is True. Therefore,Exists[x,x^3+p*x^2+q*x+r==0,x>0]
means that there exists anx
satisfyingx^3+p*x^2+q*x+r==0
wherex > 0
(in other words, one or more roots ofx^3 + p*x^2 + q*x + r
is positive). $\endgroup$con2
is condition that for all realx
the root is positive. Whileco0
is condition that for allx
the root is positive. $\endgroup$