62.5 Univariate Polynomials

Some of the operations are actually defined on the larger domain of Laurent polynomials (see Laurent Polynomials). For this section you can simply ignore the word ``Laurent'' if it occurs in a description.

  • UnivariatePolynomial( ring, cofs[, ind] ) O

    constructs an univariate polynomial over the ring ring in the indeterminate ind with the coefficients given by coefs.

  • UnivariatePolynomialByCoefficients( fam, cofs, ind ) O

    constructs an univariate polynomial over the coeffcients family fam and in the indeterminate ind with the coefficients given by coefs. This function should be used in algorithms to create polynomials as it avoids overhead associated with UnivariatePolynomial.

  • DegreeOfLaurentPolynomial( pol ) A

    The degree of a univariate (Laurent) polynomial pol is the largest exponent n of a monomial xn of pol.

    gap> p:=UnivariatePolynomial(Rationals,[1,2,3,4],1);
    1+2*x+3*x^2+4*x^3
    gap> UnivariatePolynomialByCoefficients(FamilyObj(1),[9,2,3,4],73);
    9+2*x_73+3*x_73^2+4*x_73^3
    gap> CoefficientsOfUnivariatePolynomial(p);
    [ 1, 2, 3, 4 ]
    gap> DegreeOfLaurentPolynomial(p);
    3
    gap> IndeterminateNumberOfLaurentPolynomial(p);
    1
    gap> IndeterminateOfLaurentPolynomial(p);      
    x
    

    We remark that some functions for multivariate polynomials (which will be defined in the following sections) permit a different syntax for univariate polynomials which drops the requirement to specify the indeterminate. Examples are Value, Discriminant, Derivative, LeadingCoefficient and LeadingMonomial:

    gap> Value(p,Z(5));
    Z(5)^2
    gap> LeadingCoefficient(p);
    4
    gap> Derivative(p);
    2+6*x+12*x^2
    

  • RootsOfUPol( upol ) F
  • RootsOfUPol( field, upol ) F
  • RootsOfUPol( "split", upol ) F

    This function returns a list of all roots of the univariate polynomial upol in its default domain. If field is given the roots over field are taken, if the first parameter is the string "split" the field is taken to be the splitting field of the polynomial.

    gap> RootsOfUPol(50-45*x-6*x^2+x^3);
    [ 10, 1, -5 ]
    

  • UnivariatenessTestRationalFunction( f ) F

    takes a rational function f and tests whether it is univariate or even a laurent polynomial. It returns a list [isunivariate,indet,islaurent,cofs] where indet is the indeterminate number and cof (if applicable) the coefficients lists. As there is no proper multivariate gcd, it might return fail for isunivariate.

    The info class for univariate polynomials is InfoPoly.

    [Top] [Previous] [Up] [Next] [Index]

    GAP 4 manual
    February 2000