<s>[INST] Real solutions to the depressed cubic equation How can I find the allowed domain to this depressed cubic inequality
$$x^3 - 3 x + 2 \cos(\frac{3 \sqrt{3} n}{2}) \geq 0$$
where $n$ is a real non-negative number. Using Cardano's method, I can obtain some solutions for $x$ ($x_1$, $x_2$, and $x_3$) that should be real and not complex.
How can the solutions $x_j$ to define the feasible region satisfying the inequality for fixed $n$?
 [/INST] Let $\alpha = \frac{n\sqrt 3}{2}$.
Using $\cos 3\alpha = 4\cos^3 \alpha - 3 \cos \alpha$, the equation is written as
$$x^3 - 3x + 2(4\cos^3 \alpha - 3 \cos \alpha) = 0$$
or
$$(x^3 + (2\cos \alpha)^3) - 3(x + 2\cos \alpha) = 0$$
or
$$(x + 2\cos\alpha)(x^2 - 2x\cos\alpha + 4\cos^2\alpha - 3) = 0$$
or
$$(x + 2\cos\alpha)((x - \cos \alpha)^2 - 3\sin^2\alpha) = 0$$
or
$$(x + 2\cos\alpha)(x - \cos \alpha - \sqrt 3 \sin\alpha)(x - \cos \alpha + \sqrt 3\sin\alpha) = 0.$$
Thus, the roots are $x_1 = -2\cos \alpha, ~ x_2 = \cos \alpha + \sqrt 3 \sin\alpha, ~ x_3 = \cos \alpha - \sqrt 3 \sin \alpha$.
Note that $x_1 = x_2 = x_3$ implies
$\cos \alpha = \sin \alpha = 0$ which is impossible.
To find the domain, we need to sort $x_1, x_2, x_3$.
For example, if $x_1 < x_2 < x_3$,
then the allowed domain of $(x-x_1)(x-x_2)(x-x_3)\ge 0$ is $[x_1, x_2]\cup [x_3, \infty)$;
if $x_1 = x_2 < x_3$, then the allowed domain is $[x_3, \infty)$.
</s>