When I try to solve the following cubic equation for $a$ on mathematica :
S=Solve[a^3 - 4 x - 2 a^2 x + 8 x^3 + a (- 6 - 4 x^2) == 0,a];
I get a complex expression for the root I am interested in (accessible in S[[3,1,2]]) :
root[x_]:=1/12 (8 x + (
4 (-2)^(2/3) (9 + 8 x^2))/(54 x - 32 x^3 +
3 I Sqrt[6] Sqrt[27 + 2 x^2 (9 + 64 x^2)])^(1/3) -
4 (-2)^(1/
3) (54 x - 32 x^3 + 3 I Sqrt[6] Sqrt[27 + 2 x^2 (9 + 64 x^2)])^(
1/3))
It is a valid expression for the root :
FullSimplify[root[x]^3 - 4 x - 2 root[x]^2 x + 8 x^3 + root[x] (- 6 - 4 x^2)]==0
However the root is real, but Mathematica believes there is a very small imaginary part :
Plot[root[x],{x,-2,2}]
How can I get rid of the imaginary part of my solution ? I have tried commands such as Re@ComplexExpand[root[x]] But it gives very tedious expressions to work with. From the context of the project I am working on I firmly believe there exist a much nicer expression for root[x].
I am open for any ideas or remarks, thank you very much.


Chop[root[x]]– Ulrich Neumann Jun 24 '20 at 19:18