## `degree` -- the degree of a polynomial

#### Introduction

`degree(`p`)` returns the total degree of the polynomial `p`.

`degree(`p, x`)` returns the degree of `p` with respect to the variable `x`.

#### Call(s)

`degree(p)`
`degree(p, x)`
`degree(f <, vars>)`
`degree(f <, vars>, x)`

#### Parameters

`p` | - | a polynomial of type `DOM_POLY`
`f` | - | a polynomial expression
`vars` | - | a list of indeterminates of the polynomial: typically, identifiers or indexed identifiers
`x` | - | an indeterminate

#### Returns

a nonnegative number. `FAIL` is returned if the input cannot be converted to a polynomial.

### Overloadable:

`p`, `f`

#### Related Functions

`coeff`, `degreevec`, `ground`, `lcoeff`, `ldegree`, `lmonomial`, `lterm`, `nterms`, `nthcoeff`, `nthmonomial`, `nthterm`, `poly`, `poly2list`, `tcoeff`

#### Details

- If the first argument `f` is not element of a polynomial domain, then `degree` converts the expression internally to a polynomial of type `DOM_POLY` via `poly``(f)`. If a list of indeterminates is specified, the polynomial `poly``(f, vars)` is considered.
- `degree(`f, vars, x`)` returns 0 if `x` is not an element of the list `vars`.
- The degree of the zero polynomial is defined as 0.
- `degree` is a function of the system kernel.

#### Example 1

The total degree of the terms in the following polynomial expression is computed:

    >> degree(x^3 + x^2*y^2 + 2)

                                         4

#### Example 2

`degree` may be applied to polynomials of type `DOM_POLY`:

    >> degree(poly(x^2*z + x*z^3 + 1, [x, z]))

                                         4

#### Example 3

The next expression is regarded as a bi-variate polynomial in `x` and `z`. The degree with respect to `z` is computed:

    >> degree(x^2*z + x*z^3 + 1, [x, z], z)

                                         3

#### Example 4

The degree of the zero polynomial is defined as 0:

    >> degree(0, [x, y])

                                         0

#### Changes

- no changes

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