CountRoots

CountRoots[f,x]

gives the number of real roots of the univariate function f in x.

CountRoots[f,{x,a,b}]

gives the number of roots between a and b.

Details

  • CountRoots counts roots with multiplicities.
  • The function f can be polynomial, holomorphic or meromorphic etc.
  • Roots that lie exactly at x=a or x=b are counted.
  • The limits a and b can be complex, in which case the range is taken to be the closed rectangle Re[a]Re[x]Re[b]Im[a]Im[x]Im[b].

Examples

open allclose all

Basic Examples  (4)

Count the number of polynomial roots between 0 and 10:

In[3]:=
Click for copyable input
Out[3]=

Count roots of a polynomial in a closed rectangle:

In[1]:=
Click for copyable input
Out[1]=

Count roots of a real elementary function in a real interval:

In[1]:=
Click for copyable input
Out[1]=

Count roots of a holomorphic function in a closed rectangle:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (20)

Applications  (4)

Properties & Relations  (5)

Possible Issues  (1)

Neat Examples  (1)

See Also

RootIntervals  Solve  Reduce  NSolve  FindRoot  NumberFieldSignature  Exponent

Introduced in 2007
(6.0)
| Updated in 2017
(11.1)