<s>[INST] solving a system of cubic equations with real roots Consider the following system of equations:
\begin{align}
\frac{1}{8} (\alpha +2 x)^2 \left((\alpha +2 x)^2-12\right)+\\ +\frac{4}{9} y^2 \left((\alpha
   +2 x)^2+2\right)+\frac{32 y^4}{81}&=0\\
\alpha ^3-6 \alpha +8 x^3-4 \alpha  x^2-2 \left(\alpha ^2+2\right) x&=0
\end{align}
I would like to eliminate the $\alpha$ value in order to have an equation of the form $f(x,y)=0$.
Using Cardano's formula or Mathematica, I end up with imaginary values. However if I solve them  numerically I obtain a nice shape $f(x,y)=0$
Due to the numerical plots I obtain I am thinking that there must be a nice (analytical) solution for these equations. How could I derive such an expression for $f(x,y)=0$?

 [/INST] The second equation write
$$\alpha^3-2x\alpha^2-2(3+2x^2)\alpha+4x(2 x-1)=0$$ The discriminant is
$$\Delta=32 \left(128 x^4+18 x^2+27\right) > 0 \qquad \forall x$$
Using the trigonometric method for three real roots leads to
$$\alpha_k=\frac{2}{3} \left(x+ \sqrt{2(8 x^2+9)} \cos \left(\frac{1}{3} \left(2 \pi  k-\cos
   ^{-1}\left(\frac{\sqrt{2} x \left(27-16 x^2\right)}{\left(8 x^2+9\right)^{3/2}}\right)\right)\right)\right)$$ with $k=0,1,2$.
Replace in the first equation to have $f(x,y)=0$ for each value of $k$. This would lead to
$$c_0+c_1\cos(A)+c_2\cos(2A)+c_3\cos(3A)+c_4\cos(4A)=0$$ with
$$c_0=32 \left(70 x^4+3 x^2 \left(4 y^2+9\right)+y^4\right)+27 \left(8 y^2-9\right)$$
$$c_1=128 \sqrt{2} x \sqrt{8 x^2+9} \left(7 x^2+y^2\right)$$
$$c_2=2 \left(8 x^2+9\right) \left(112 x^2+8 y^2-9\right)$$
$$c_3=16 \sqrt{2} x \left(8 x^2+9\right)^{3/2}$$
$$c_4=\left(8 x^2+9\right)^2$$
$$A=\frac{1}{3} \left(2 \pi  k-\cos
   ^{-1}\left(\frac{\sqrt{2} x \left(27-16 x^2\right)}{\left(8 x^2+9\right)^{3/2}}\right)\right)$$
</s>