## `Dom::UnivariatePolynomial` -- the domains of univariate polynomials

#### Introduction

`Dom::UnivariatePolynomial``(Var, R, ..)` creates the domain of univariate polynomials in the variable `Var` over the commutative ring `R`.

#### Domain

`Dom::UnivariatePolynomial( <Var <, R <, Order>>>)`

#### Parameters

`Var` | - | an indeterminate given by an identifier; default is `x`.
`R` | - | a commutative ring, i.e. a domain of category `Cat::CommutativeRing`; default is `Dom::ExpressionField(normal)`.
`Order` | - | a monomial ordering, i.e. one of the predefined orderings `LexOrder`, `DegreeOrder` or `DegInvLexOrder` or an element of domain `Dom::MonomOrdering`; default is `LexOrder`.

#### Details

- `Dom::UnivariatePolynomial` represents univariate polynomials over arbitrary commutative rings.

  All usual algebraic and arithmetical polynomial operations are implemented, including Gröbner basis computations.

- `Dom::UnivariatePolynomial``(Var, R, Order)` creates a domain of univariate polynomials in the variable `Var` over a domain of category `Cat::CommutativeRing` in sparse representation with respect to the monomial ordering `Order`.
- ``Dom::UnivariatePolynomial`()` creates the univariate polynomial domain in the variable `x` over the domain `Dom::ExpressionField``(normal)` with respect to the lexicographic monomial ordering.
- ``Dom::UnivariatePolynomial`(Var)` creates the univariate polynomial domain in the variable `Var` over the domain `Dom::ExpressionField``(normal)` with respect to the lexicographic monomial ordering.

- Only commutative coefficient rings of type `DOM_DOMAIN` which inherit from `Dom::BaseDomain` are allowed. If `R` is of type `DOM_DOMAIN` but inherits not from `Dom::BaseDomain`, the domain `Dom::ExpressionField``(normal)` will be used instead.

- For this domain only identifiers are valid variables.

- It is highly recommend to use only coefficient rings with unique zero representation. Otherwise it may happen that, e.g., a polynomial division will not terminate or a wrong degree will be returned.

- Please note that for reasons of efficiency not all methods check their arguments, not even at the interactive level. In particular this is true for many access methods, converting methods and technical methods. Therefore, using these methods inappropriately may result in strange error messages.

#### Creating Elements

``Dom::UnivariatePolynomial`(Var, R, Order)(p)`
``Dom::UnivariatePolynomial`(Var, R, Order)(lm)`

#### Parameters

`p` | - | a polynomial or a polynomial expression.
`lm` | - | list of monomials, which are represented as lists containing the coefficients together with the exponents or exponent vectors.

#### Categories

`Cat::UnivariatePolynomial(R)`

#### Related Domains

`Dom::Polynomial`, `Dom::DistributedPolynomial`, `Dom::MultivariatePolynomial`

#### Entries

characteristic

  The characteristic of this domain.

coeffRing

  The coefficient ring of this domain as defined by the parameter `R`.

key

  The name of the domain created.

one

  The neutral element w.r.t. `"_mult"`.

ordering

  The monomial order as defined by the parameter `Order`.

variables

  The list of the variable as defined by the parameter `Var`.

zero

  The neutral element w.r.t. `"_plus"`.

#### Method coeff: coefficients of a polynomial

- `coeff(dom a)`
- `coeff(dom a, Var, NonNegativeInteger n)`
- `coeff(dom a, NonNegativeInteger n)`
- - `coeff(a)` returns a sequence with all coefficients of `a` as elements of `R`. The coefficients are ordered according to the monomial ordering `Order`.
  - `coeff(a, Var, n)` returns the coefficient of the term `Var^n` as an element of `R`.
  - `coeff(a, n)` returns the coefficient of the term `Var^n` as an element of `R`.
  - This method overloads the function `coeff` for polynomials.

#### Method vectorize: vectorized form of a polynomial

- `vectorize(dom a <, PositiveInteger n>)`
- - Returns `a` in its vectorized form, i.e. a list of all (zero and nonzero) coefficients of `a` as elements of `R` in increasing order. If `n` is explicitly given, whereby `n` must be greater than `degree(a)`, a list of `n` coefficient entries maybe filled up with zeros is returned.

#### Example 1

To create the ring of univariate polynomials in `x` over the integers one may define

    >> UP:=Dom::UnivariatePolynomial(x,Dom::Integer)

               Dom::UnivariatePolynomial(x, Dom::Integer, LexOrder)

Now, let us create two univariate polynomials.

    >> a:=UP((2*x-1)^2*(3*x+1))

                                   3      2
                               12 x  - 8 x  - x + 1

    >> b:=UP(((2*x-1)*(3*x+1))^2)

                              4       3       2
                          36 x  - 12 x  - 11 x  + 2 x + 1

The usual arithmetical operations for polynomials are available:

    >> a^2+a*b

                  7        6        5        4       3       2
             432 x  - 288 x  - 264 x  + 200 x  + 35 x  - 36 x  - x + 2

The leading coefficient, leading term, leading monomial and reductum of `a` are

    >> lcoeff(a),lterm(a),lmonomial(a),UP::reductum(a)

                                3      3       2
                           12, x , 12 x , - 8 x  - x + 1

and `a` is of degree

    >> degree(a)

                                         3

The method `gcd` computes the greatest common divisor of two polynomials

    >> gcd(a,b)

                                   3      2
                               12 x  - 8 x  - x + 1

and `lcm` the least common multiple:

    >> lcm(a,b)

                              4       3       2
                          36 x  - 12 x  - 11 x  + 2 x + 1

Computing the definite and indefinite integral of a polynomial is also possible,

    >> int(a)

                               4        3        2
                            3 x  - 8/3 x  - 1/2 x  + x

which is in the case of indefinite integration simply the antiderivative of the polynomial.

    >> D(int(a)), domtype(D(int(a)))

              3      2
          12 x  - 8 x  - x + 1, Dom::UnivariatePolynomial(x,

             Dom::Fraction(Dom::Integer), LexOrder)

But, since for representing the indefinite integral of `a` the coefficient ring chosen as the integers is not appropriate, the polynomial ring over its quotient field is used instead.

Furthermore, interpreting the polynomials as polynomial functions is also allowed in applying coefficient ring elements, polynomials of this domain or arbitrary expressions with option `Expr` to them:

    >> a(5)

                                       1296

    >> a(b)

                  12           11           10           9          8
          559872 x   - 559872 x   - 326592 x   + 414720 x  + 73872 x  -

                     7         6          5         4         3
             123120 x  - 9924 x  + 18408 x  + 1144 x  - 1364 x  -

                 2
             97 x  + 38 x + 4

    >> a(sin(x),Expr)

                                 3           2
                        12 sin(x)  - 8 sin(x)  - sin(x) + 1

To get a vector of coefficients of a polynomial, which gives the dense representation of it, one may use the method `vectorize`.

    >> UP::vectorize(a), UP::vectorize(a,6)

                      [1, -1, -8, 12], [1, -1, -8, 12, 0, 0]

#### Example 2

#### Example 3

#### Super-Domain

`Dom::MultivariatePolynomial`

#### Axioms

if `R` has `Ax::normalRep`, then
`Ax::normalRep`
if `R` has `Ax::canonicalRep`, then
`Ax::canonicalRep`

#### Changes

- `Dom::UnivariatePolynomial` is a new domain.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000