# Cubic equation solution

Writing:

eqn = x^3 + c2 x^2 + c1 x + c0 == 0;
ass = {c2 -> 3, c1 -> 3, c0 -> 3};
sol = Assuming[c1 == c2^2/3, Simplify[Solve[eqn, x]]] /. ass;
eqn /. ass /. sol // FullSimplify


I get:

{False, False, False}

and I can't understand why! Ideas? Thank you!

• For a start, in the first case your assumptions in Assuming have no effect, because the result of Solve does not contain c1 or c2, since you have replaced them with explicit numerical values by doing eqn /. ass. Mar 22, 2019 at 18:48
• The Cardano-Tartaglia form of solution is not valid for that set of substitution values (it makes numerator and denominator vanish). Mar 22, 2019 at 20:44

The way you have it you are substituting your values too late. It works if the substitution occurs before it tries to solve.

eqn = x^3 + c2 x^2 + c1 x + c0 == 0;

ass = {c2 -> 3, c1 -> 3, c0 -> 3};

sol = Solve[eqn /. ass, x]
(*{{x -> -1 - 2^(1/3)}, {x -> -1 + (1 - I Sqrt[3])/2^(
2/3)}, {x -> -1 + (1 + I Sqrt[3])/2^(2/3)}}*)

sol = Solve[eqn, x]


Gives you a solution, but when you substitute your values you get indeterminates. Taking limits may help, but the problem is avoided by making the substitution first.

I think it's much more robust to use Root objects instead of radicals. If you do that with your example, there is no issue:

eqn = x^3+c2 x^2+c1 x+c0==0;
ass = {c2->3,c1->3,c0->3};
sol = Assuming[c1==c2^2/3,
Simplify[Solve[eqn, x, Cubics->False]]
] /. ass;
eqn /.ass/. sol //FullSimplify


{True, True, True}