0
$\begingroup$

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!

$\endgroup$
  • 3
    $\begingroup$ 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. $\endgroup$ – MarcoB Mar 22 '19 at 18:48
  • $\begingroup$ @MarcoB: Thanks, in fact I hadn't thought about it well. But in the second case I don't understand why the correct solution is not obtained. Thanks again! $\endgroup$ – TeM Mar 22 '19 at 19:43
  • 3
    $\begingroup$ The Cardano-Tartaglia form of solution is not valid for that set of substitution values (it makes numerator and denominator vanish). $\endgroup$ – Daniel Lichtblau Mar 22 '19 at 20:44
  • $\begingroup$ I don't understand what formulation MMA refers to, I know this one that has no denominators: it.wikipedia.org/wiki/… $\endgroup$ – TeM Mar 22 '19 at 21:54
2
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.