# 1.8 Polynomials¶

Polynomials are the commonly used algebraic types in symbolic
computation. Interactive users of FriCAS generally only see
one type of polynomial: `Polynomial(R)`

. This type represents polynomials
in any number of unspecified variables over a particular coefficient
domain R. This type represents its coefficients sparsely: only terms
with non-zero coefficients are represented.

In building applications, many other kinds of polynomial representations are useful. Polynomials may have one variable or multiple variables, the variables can be named or unnamed, the coefficients can be stored sparsely or densely. So-called distributed multivariate polynomials store polynomials as coefficients paired with vectors of exponents. This type is particularly efficient for use in algorithms for solving systems of non-linear polynomial equations.

The polynomial constructor most familiar to the interactive user is
`Polynomial`

.

```
(x^2 - x*y^3 +3*y)^2
```

_{Type: Polynomial Integer}

If you wish to restrict the variables used, `UnivariatePolynomial`

provides polynomials in one variable.

```
p: UP(x,INT) := (3*x-1)^2 * (2*x + 8)
```

_{Type: UnivariatePolynomial(x,Integer)}

The constructor `MultivariatePolynomial`

provides polynomials in one or
more specified variables.

```
m: MPOLY([x,y],INT) := (x^2-x*y^3+3*y)^2
```

_{Type: MultivariatePolynomial([x,y],Integer)}

You can change the way the polynomial appears by modifying the variable ordering in the explicit list.

```
m :: MPOLY([y,x],INT)
```

_{Type: MultivariatePolynomial([y,x],Integer)}

The constructor DistributedMultivariatePolynomial provides polynomials in one or more specified variables with the monomials ordered lexicographically.

```
m :: DMP([y,x],INT)
```

_{Type: DistributedMultivariatePolynomial([y,x],Integer)}

The constructor HomogeneousDistributedMultivariatePolynomial is similar except that the monomials are ordered by total order refined by reverse lexicographic order.

```
m :: HDMP([y,x],INT)
```

_{Type: HomogeneousDistributedMultivariatePolynomial([y,x],Integer)}

More generally, the domain constructor
`GeneralDistributedMultivariatePolynomial`

allows the user to provide an
arbitrary predicate to define his own term ordering. These last three
constructors are typically used in *Gröbner basis* applications and when a
flat (that is, non-recursive) display is wanted and the term ordering is
critical for controlling the computation.