# SturmCount -- the number of real roots of a rational univariate polynomial

## Synopsis

• Usage:
SturmCount(f,a,b)
SturmCount(f)
• Inputs:
• f, , a rational univariate polynomial
• a, , a lower bound of the interval
• b, , an upper bound of the interval
• Optional inputs:
• Multiplicity => ..., default value false, option for computing roots with multiplicity
• Outputs:
• an integer, the number of real roots of f in the interval $(a,b]$

## Description

This computes the difference in variation of the Sturm sequence of f on the interval $(a,b]$. If a and b are not specified, the interval will be taken from $-\infty$ to $\infty$. If the coefficients of f are inexact, then the computations may be unreliable.

 i1 : R = QQ[t] o1 = R o1 : PolynomialRing i2 : f = (t - 5)*(t - 3)^2*(t - 1)*(t + 1) 5 4 3 2 o2 = t - 11t + 38t - 34t - 39t + 45 o2 : R i3 : roots f o3 = {-1, 1, 3, 3, 5} o3 : List i4 : SturmCount(f) o4 = 4 i5 : SturmCount(f,0,5) o5 = 3 i6 : SturmCount(f,-2,2) o6 = 2 i7 : SturmCount(f,-1,5) o7 = 3

In the above example, multiplicity is not counted. To include it, make the multiplicity option true.

 i8 : SturmCount(f,Multiplicity=>true) o8 = 5 i9 : SturmCount(f,0,5,Multiplicity=>true) o9 = 4 i10 : SturmCount(f,0,3,Multiplicity=>true) o10 = 3

If a is an InfiniteNumber, then the lower bound will be $-\infty$, and if b is an InfiniteNumber, then the upper bound is $\infty$.

 i11 : SturmCount(f,-infinity, 0) o11 = 1 i12 : SturmCount(f,0,infinity) o12 = 3 i13 : SturmCount(f,-infinity,infinity) o13 = 4

• SturmSequence -- the Sturm sequence of a rational univariate polynomial

## Ways to use SturmCount :

• "SturmCount(RingElement)"
• "SturmCount(RingElement,InfiniteNumber,InfiniteNumber)"
• "SturmCount(RingElement,InfiniteNumber,QQ)"
• "SturmCount(RingElement,InfiniteNumber,RR)"
• "SturmCount(RingElement,InfiniteNumber,ZZ)"
• "SturmCount(RingElement,QQ,InfiniteNumber)"
• "SturmCount(RingElement,QQ,QQ)"
• "SturmCount(RingElement,QQ,RR)"
• "SturmCount(RingElement,QQ,ZZ)"
• "SturmCount(RingElement,RR,InfiniteNumber)"
• "SturmCount(RingElement,RR,QQ)"
• "SturmCount(RingElement,RR,RR)"
• "SturmCount(RingElement,RR,ZZ)"
• "SturmCount(RingElement,ZZ,InfiniteNumber)"
• "SturmCount(RingElement,ZZ,QQ)"
• "SturmCount(RingElement,ZZ,RR)"
• "SturmCount(RingElement,ZZ,ZZ)"

## For the programmer

The object SturmCount is .