Macaulay2 » Documentation
Packages » RealRoots :: sylvesterCount
next | previous | forward | backward | up | index | toc

# sylvesterCount -- a signed count of the real roots of a univariate polynomial with rational coefficients

- Usage:
    `sylvesterCount(f,g,a,b)`
    `sylvesterCount(f,g)`
- Inputs:
  - f, a ring element, a univariate polynomial with rational coefficients
  - g, a ring element, a univariate polynomial with rational coefficients in the same variable as f
  - a, a rational number, (optional) the left endpoint of the interval
  - b, a rational number, (optional) the right endpoint of the interval
- Optional inputs:
  - Multiplicity => ..., default value false, option for computing roots with multiplicity
- Outputs:
  - an integer, the difference between the number of real roots of f in the interval $(a,b]$ where g is positive, and the number of real roots of f in the interval $[a,b)$ where g is negative

## Description

This computes the difference between the number of real roots of f in the interval $(a,b]$ where g is positive, and the number of real roots of f in the interval $[a,b)$ where g is negative. This is computed by taking the difference in variations of the reduced Sylvester sequence of f and g.

    i1 : R = QQ[t]

    o1 = R

    o1 : PolynomialRing

    i2 : f = (t - 2)*(t - 1)*(t + 3)

          3
    o2 = t  - 7t + 6

    o2 : R

    i3 : g = t + 1

    o3 = t + 1

    o3 : R

    i4 : a = -5

    o4 = -5

    i5 : b = 4

    o5 = 4

    i6 : sylvesterCount(f,g,a,b)

    o6 = 1

## See also

- sylvesterSequence -- the Sylvester sequence of two univariate polynomials with rational coefficients
- sturmCount -- the number of real roots of a univariate polynomial with rational coefficients

## Ways to use sylvesterCount:

- `sylvesterCount(RingElement,RingElement)`
- `sylvesterCount(RingElement,RingElement,QQ,QQ)`

## For the programmer

The object sylvesterCount is a method function with options.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/RealRoots.m2:801:0.