Previous Page Contents

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

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

Method vectorize: vectorized form of a polynomial

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




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000