3
$\begingroup$

Cubic polynomials always have explicit solutions and Mathematica certainly knows about them. But Mathematica will by default show the explicit solution only sometimes. I'm guessing there is something about the 'complexity' of the expression that Mathematica uses to choose to hide it as a root object — but does anybody know exactly when it might choose to, or not?

For example, here's a cubic with three real distinct roots that are returned as a root object:

Solve[x^3 - x^2 - 3 x + 1 == 0, x]

enter image description here

You can force Mathematica to show the explicit expressions with the following command though the result contains complex numbers. (Even though they should simplify to real numbers, Simplify wouldn't do it)

Solve[x^3 - x^2 - 3 x + 1 == 0, x] // ToRadicals

enter image description here

$\endgroup$
6
  • $\begingroup$ If you have a Root, it's usually the better solution. It's just a rigorous representation of an algebraic number. One advantage is that numerical evaluation of a real Root yields a real number, while radical expressions are prone to little parasitic imaginary parts. $\endgroup$
    – John Doty
    Jun 19, 2020 at 19:24
  • $\begingroup$ @JohnDoty Thanks for the reply though that wasn't what I was asking. When is a Root shown, and when is the explicit expression shown instead when it exists? $\endgroup$ Jun 19, 2020 at 19:26
  • 4
    $\begingroup$ (1) You can set Cubics->True, (2) The remark "...hough the result contains complex numbers. (Even though they should simplify to real numbers, Simplify wouldn't do it)" is simply incorrect, at least if the expectation is that the result will remain in terms of radicals. Look up "casus irreducibilis". $\endgroup$ Jun 19, 2020 at 19:27
  • $\begingroup$ @DanielLichtblau Ah! Thank you Both of your tips were helpful in understanding more of this question. Do you think its safe to say that Mathematica will show Root[] whenever the cubic discriminant > 0 ? $\endgroup$ Jun 19, 2020 at 19:35
  • $\begingroup$ Should have also added, and the rational root test fails? $\endgroup$ Jun 19, 2020 at 19:52

1 Answer 1

2
$\begingroup$

To obtain the real roots of a cubic with three of them in terms of radicals, you wind up needing complex numbers. See this. But you can keep everything real by using Root.

If you absolutely must have bronze-age radicals rather than space-age Roots, you may give the Cubics -> True option to Solve.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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