# Find regions in which the roots of a third degree polynomial are real

I have to find the roots of a third degree polynomial in $\phi$ that depends from 3 parameters, namely $t,s,w\in \mathbb R$. In order to do that I've used the command Solve, in the following way:

Solve[
1/6*ϕ*(t^2 + ϕ^2) - 1/2*t*(s + (t*ϕ)/2) +w - (s*ϕ)/2
+ 1/12*t*(t - ϕ)*ϕ == 0, {ϕ}]


Mathematica gives me three solution, as expected, without worrying about the parameters:

 {{ϕ -> t/6 - (-36 s - t^2)/(3 2^(2/3) (756 s t + 2 t^3 +
Sqrt[4 (-36 s - t^2)^3 + (756 s t + 2 t^3 -
1296 w)^2] - 1296 w)^(1/3)) +
(756 s t + 2 t^3 +
Sqrt[4 (-36 s - t^2)^3 + (756 s t + 2 t^3 - 1296 w)^2] -
1296 w)^(1/3)/(6 2^(1/3))},
{ϕ -> t/6 + ((1 + I Sqrt[3]) (-36 s - t^2))/(6 2^(2/3) (756 s t +
2 t^3 + Sqrt[4 (-36 s - t^2)^3 + (756 s t + 2 t^3 - 1296 w)^2]
- 1296 w)^(1/3)) - ((1 - I Sqrt[3]) (756 s t + 2 t^3+
Sqrt[4 (-36 s - t^2)^3 + (756 s t + 2 t^3 - 1296 w)^2] -
1296 w)^(1/3))/(12 2^(1/3))},
{ϕ -> t/6 + ((1 - I Sqrt[3]) (-36 s - t^2))/(6 2^(2/3) (756 s t +
2 t^3 + Sqrt[4 (-36 s - t^2)^3 + (756 s t + 2 t^3 - 1296 w)^2]-
1296 w)^(1/3)) - ((1 + I Sqrt[3]) (756 s t + 2 t^3 +
Sqrt[4 (-36 s - t^2)^3 + (756 s t + 2 t^3 - 1296 w)^2] -
1296 w)^(1/3))/(12 2^(1/3))}}


From now on, we will call the first output $\phi_1$, the second one with $\phi_2$ and the third one $\phi_3$.

Now, I want to explicetely find $Z_1,Z_2,Z_3$ such that

1. for parameters $(t,s,w)\in Z_1$, $\phi_1$ is real (while $\phi_2, \phi_3$ can be both real or both complex);
2. for parameters $(t,s,w)\in Z_2$, $\phi_2$ is real (while $\phi_1, \phi_3$ can be both real or both complex);
3. for parameters $(t,s,w)\in Z_3$, $\phi_3$ is real (while $\phi_2, \phi_3$ can be both real or both complex).

So, in order to clarify (I hope) a little bit, we have that:

• in $Z_1\cap Z_2\cap Z_3$ all the three solutions $\phi_1,\phi_2,\phi_3$ are real;
• in $Z_1\setminus (Z_2\cap Z_3)$ we have that $\phi_1$ is real while $\phi_2, \phi_3$ aren't;
• in $Z_2\setminus (Z_1\cap Z_3)$ we have that $\phi_2$ is real while $\phi_1, \phi_3$ aren't;
• in $Z_3\setminus (Z_2\cap Z_1)$ we have that $\phi_3$ is real while $\phi_1, \phi_2$ aren't.

My goal is to find explicitly $Z_1,Z_2,Z_3$. What can I do?

I've also tried to to this:

Solve[1/6*\[Phi]*(t^2 + \[Phi]^2) - 1/2*t*(s + (t*\[Phi])/2) +
w - (s*\[Phi])/2 + 1/12*t*(t - \[Phi])*\[Phi] == 0,
{\[Phi]}, Reals]


and the output is:

{{\[Phi] -> ConditionalExpression[Root[-6 s t + 12 w - 6 s #1 - t #1^2 + 2 #1^3 &,1],
(36 s + t^2 > 0 && -378 s t - t^3 + Sqrt[(36 s + t^2)^3] + 648 w > 0 &&
378 s t + t^3 + Sqrt[(36 s + t^2)^3] - 648 w >0) ||
(36 s + t^2 > 0 && -378 s t - t^3 + Sqrt[(36 s + t^2)^3]+648 w<0) ||
(36 s + t^2 > 0 && 378 s t + t^3 + Sqrt[(36 s + t^2)^3]-648 w < 0) ||
36 s + t^2 < 0]},
{\[Phi] -> ConditionalExpression[Root[-6 s t + 12 w - 6 s #1 - t #1^2 + 2 #1^3 &, 2],
-378 s t - t^3 + Sqrt[(36 s + t^2)^3] + 648 w > 0 &&
378 s t + t^3 + Sqrt[(36 s + t^2)^3] - 648 w > 0 &&
36 s + t^2 > 0]},
{\[Phi] -> ConditionalExpression[Root[-6 s t + 12 w - 6 s #1 - t #1^2 + 2 #1^3 &, 3],
-378 s t - t^3 + Sqrt[(36 s + t^2)^3] + 648 w > 0 &&
378 s t + t^3 + Sqrt[(36 s + t^2)^3] - 648 w > 0 &&
36 s + t^2 > 0]}}


What do these conditional expressions mean? For example, is the conditional expression after $\phi_1$ exactly $Z_1$? And also are the conditional expressions after $\phi_2,\phi_3$ respectively $Z_2,Z_3$?

I'm not sure about that, because, if it were so, we would have that $Z_i\setminus (Z_j\cap Z_k)= \varnothing$ for $i,j,k$ different, $i,j,k\in\{1,2,3\}$. But this would imply that this equation has always only real solutions for any values of the parameters.

Mistake found:

$Z_2\setminus (Z_1\cap Z_3)=\varnothing$, $Z_3\setminus(Z_1\cap Z_2)=\varnothing$, $Z_1\setminus(Z_2\cap Z_3)\neq \varnothing$.

So, this means that:

1. there are no values of the parameters such that exactly $\phi_2$ is real and $\phi_1,\phi_3$ are both complex;
2. there are no values of the parameters such that exactly $\phi_3$ is real and $\phi_1,\phi_2$ are both complex;
3. there are values of the parameters such that exactly $\phi_1$ is real and $\phi_2,\phi_3$ are both complex.

Obviously these conclusions are true if $Z_1,Z_2,Z_3$ that I want to find are exactly the ConditionalExpression after $\phi_1,\phi_2,\phi_3$.

• Solve[..., Reals] gives certain ConditionalExpressions. Could you check them? – ybeltukov Nov 11 '15 at 15:50
• Is there a reason you don't want to use the discriminant of the cubic polynomial to determine whether the roots are real or not? This probably works out to be equivalent to the ConditionalExpressions you've found, but it might be a nicer way to show it. – Michael Seifert Nov 11 '15 at 16:24
• Discriminant[] is a built-in function. – J. M. will be back soon Nov 11 '15 at 16:47
• Reduce[] would actually be the appropriate function in this case, since you're dealing with an inequality as opposed to an equation. – J. M. will be back soon Nov 11 '15 at 16:53
• Something like RegionPlot3D[ Evaluate@Reduce[Discriminant[eq, \[Phi]] > 0, {t, s, w}], {t, -10, 10}, {s, -10, 10}, {w, -10, 10}, PlotPoints -> 30] – Dr. belisarius Nov 11 '15 at 16:54