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
    Commented 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$ Commented 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$ Commented Sep 1, 2016 at 22:48
  • $\begingroup$ @GordonRoyle It is marked as "accepted". $\endgroup$ Commented 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$ Commented Oct 2, 2016 at 13:18

Your Answer

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

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