I have some polynomials of high degree with coefficients of the form a + b Sqrt[5] where a, b are integers (or at least rationals).

I want to rigorously determine when they have all real roots - that means symbolically, and not numerically.

It seems to me that CountRoots and RootIntervals do actually work exactly (presumably via Sturm sequences or similar) when the polynomials have integer coefficients, but do they work correctly and exactly for ANY symbolically defined coefficients?

  • 1
    $\begingroup$ No reports of errors on this site. $\endgroup$
    – bbgodfrey
    Aug 31, 2016 at 3:13
  • 1
    $\begingroup$ Sorry, I should have been clearer. Are the implementations in Mathematica known to be implementations of exact algorithms? $\endgroup$ Aug 31, 2016 at 5:04

1 Answer 1


Yes, CountRoots and RootIntervals use exact algorithms. For non-polynomial functions CountRoots may use numeric integration, but if it does it issues a warning message.

In[1]:= CountRoots[1 - x + Gamma[x], {x, 2 - I, 4 + I}]                         

CountRoots::nint: Warning: Numeric integration was used to count roots.

Out[1]= 2
  • $\begingroup$ Thanks, I think I accepted this answer, but the colour scheme is different from the other StackExchange sites I use, so I can't be sure. $\endgroup$ Sep 1, 2016 at 22:48
  • $\begingroup$ @GordonRoyle It is marked as "accepted". $\endgroup$ Sep 2, 2016 at 14:44
  • $\begingroup$ "exact algorithms" - it's still Collins-Krandick, correct? Or has it been replaced by something newer? (I'm no longer current with these things, I'm afraid.) $\endgroup$ Oct 2, 2016 at 13:18

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.