This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Add-ons / Standard Packages / Algebra  /


This package provides functions for counting and isolating roots of polynomials.
For complex numbers , , and a polynomial with Gaussian rational coefficients, the function CountRoots gives the number of roots of in the interval


, multiplicities counted. The interval


means here the set of all complex

such that

which may be a point, a horizontal or vertical open interval, or an open rectangle.
An interval is an isolating interval for a root of a polynomial if is the only root of in

. Isolating roots of a polynomial means finding disjoint isolating intervals for all the roots of the polynomial. The package defines functions for isolating roots of polynomials with rational coefficients.

Functions for counting and isolating roots of polynomials.

  • This loads the package.
  • In[1]:= <<Algebra`RootIsolation`

  • This counts roots of f in the open interval (1, 2).
  • In[2]:= f = (x^2 - 2) (x^2 - 3) (x^2 - 4); CountRoots[f, {x, 1, 2}]


  • The polynomial has two roots in the vertical interval: a single root at

    and a triple root at 0.
  • In[3]:= CountRoots[(x^2+1) x^3, {x, -I, 2 I}]


  • This counts 17

    degree roots of unity in the open unit square.
  • In[4]:= CountRoots[x^17 - 1, {x, 0, 1 + I}]


  • Here are isolating intervals for the real roots of f.
  • In[5]:= RealRootIntervals[f]


  • The second list shows which interval contains a root of which polynomial.
  • In[6]:= RealRootIntervals[{f + 3, f + 5, f + 7}]


  • This gives isolating intervals for all complex roots of f+3.
  • In[7]:= ComplexRootIntervals[f + 3]


  • Here are isolating intervals for the third and fourth degree roots of unity. The second interval contains a root common to both polynomials.
  • In[8]:= ComplexRootIntervals[{x^3 - 1, x^4 - 1}]


  • Here is a small interval containing a tenth degree root of unity.
  • In[9]:= ContractInterval[Root[x^10 - 1, 5], 10]


  • Let's see how small the interval is.
  • In[10]:= N[%, 20]