 degree - Maple Help

degree

degree of a polynomial

ldegree

low degree of a polynomial Calling Sequence degree(a, x) ldegree(a, x) Parameters

 a - any expression x - (optional) indeterminate or a list or set of indeterminates Description

 • If x is a single indeterminate, the degree and ldegree commands compute the degree and low degree, respectively, of the polynomial a in x. If x is not specified then the degree and ldegree commands compute the total degree and total low degree, respectively, of the polynomial a in all of its indeterminates. The definitions for the cases where x is a list or set of indeterminates are given below.
 • The polynomial a can have negative integer exponents in x. Thus degree and ldegree functions can return a negative or positive integer.  If a is not a polynomial in x in this generalized sense, then FAIL is returned.
 • The identically 0 polynomial is defined to have degree -infinity and ldegree +infinity.
 • The polynomial a must be in collected form in order for degree/ldegree to return an accurate result.  For example, given $\left(x+1\right)\left(x+2\right)-{x}^{2}$, degree would not detect the cancellation of the leading term, and would incorrectly return a result of 2.  Applying collect with normalization or expand to the polynomial before calling degree avoids this problem.
 • If x is a set of indeterminates, the total degree/ldegree is computed.  If x is a list of indeterminates, then the vector degree/ldegree is computed. Finally, if x is not specified, this is short for degree(a,indets(a)), meaning that the total degree in all the indeterminates is computed. The vector degree is defined as follows:

$\mathrm{degree}\left(p,\left[\right]\right)=0$

$\mathrm{degree}\left(p,\left[\mathrm{x1},\mathrm{x2},...\right]\right)=\mathrm{degree}\left(p,\mathrm{x1}\right)+\mathrm{degree}\left(\mathrm{lcoeff}\left(p,\mathrm{x1}\right),\left[\mathrm{x2},...\right]\right)$

 • The total degree is then defined as

$\mathrm{degree}\left(p,\left\{\mathrm{x1},\dots ,\mathrm{xn}\right\}\right)=\left\{\begin{array}{cc}{\mathrm{max}}_{\mathrm{all terms}\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}t\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}\mathrm{of}\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}p}\mathrm{degree}\left(t,\left\{\mathrm{x1},\dots ,\mathrm{xn}\right\}\right),& \mathrm{if}\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}p\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}\mathrm{is a sum}\\ \mathrm{degree}\left(p,\left[\mathrm{x1},\dots ,\mathrm{xn}\right]\right),\phantom{\rule[-0.0ex]{0.5ex}{0.0ex}}& \mathrm{otherwise}\end{array}$

 • Notice that the vector degree is sensitive to the order of the indeterminates, whereas the total degree is not. Examples

 > $a≔{x}^{4}-10{x}^{2}+1$
 ${a}{≔}{{x}}^{{4}}{-}{10}{}{{x}}^{{2}}{+}{1}$ (1)
 > $\mathrm{degree}\left(a,x\right)$
 ${4}$ (2)
 > $\mathrm{ldegree}\left(a,x\right)$
 ${0}$ (3)
 > $b≔{x}^{-2}-2+3x$
 ${b}{≔}\frac{{1}}{{{x}}^{{2}}}{-}{2}{+}{3}{}{x}$ (4)
 > $\mathrm{degree}\left(b,x\right)$
 ${1}$ (5)
 > $\mathrm{ldegree}\left(b,x\right)$
 ${-2}$ (6)
 > $c≔{x}^{2}y+3x{y}^{2}+{x}^{3}{y}^{3}-{x}^{5}$
 ${c}{≔}{{x}}^{{3}}{}{{y}}^{{3}}{-}{{x}}^{{5}}{+}{{x}}^{{2}}{}{y}{+}{3}{}{x}{}{{y}}^{{2}}$ (7)
 > $\mathrm{degree}\left(c,x\right)$
 ${5}$ (8)
 > $\mathrm{degree}\left(c,y\right)$
 ${3}$ (9)
 > $\mathrm{degree}\left(c\right)$
 ${6}$ (10)
 > $\mathrm{ldegree}\left(c,x\right)$
 ${1}$ (11)
 > $\mathrm{ldegree}\left(c,y\right)$
 ${0}$ (12)
 > $\mathrm{ldegree}\left(c\right)$
 ${3}$ (13)
 > $f≔x{y}^{3}+{x}^{2}$
 ${f}{≔}{x}{}{{y}}^{{3}}{+}{{x}}^{{2}}$ (14)
 > $\mathrm{degree}\left(f,x\right),\mathrm{degree}\left(f,y\right)$
 ${2}{,}{3}$ (15)

Find the total degree of f.

 > $\mathrm{degree}\left(f\right)$
 ${4}$ (16)
 > $\mathrm{degree}\left(f,\left\{x,y\right\}\right)$
 ${4}$ (17)
 > $\mathrm{degree}\left(f,\left\{y,x\right\}\right)$
 ${4}$ (18)

Find the vector degree of f, which is sensitive to the order of the indeterminates.

 > $\mathrm{degree}\left(f,\left[x,y\right]\right)$
 ${2}$ (19)
 > $\mathrm{degree}\left(f,\left[y,x\right]\right)$
 ${4}$ (20)

Examples of non-polynomial inputs

 > $\mathrm{degree}\left(y\mathrm{sin}\left(x\right),x\right)$
 ${\mathrm{FAIL}}$ (21)
 > $\mathrm{degree}\left(y\mathrm{sin}\left(x\right),y\right)$
 ${1}$ (22)
 > $\mathrm{degree}\left(\frac{x+1}{x+2},x\right)$
 ${\mathrm{FAIL}}$ (23)

Here collect with normalization is necessary.

 > $\mathrm{zero}≔y\left(\frac{x}{x+1}+\frac{1}{x+1}-1\right)$
 ${\mathrm{zero}}{≔}{y}{}\left(\frac{{x}}{{x}{+}{1}}{+}\frac{{1}}{{x}{+}{1}}{-}{1}\right)$ (24)
 > $\mathrm{degree}\left(\mathrm{zero},x\right)$
 ${\mathrm{FAIL}}$ (25)
 > $\mathrm{degree}\left(\mathrm{zero},y\right)$
 ${1}$ (26)
 > $\mathrm{collect}\left(\mathrm{zero},x,\mathrm{normal}\right)$
 ${0}$ (27)
 > $\mathrm{degree}\left(\mathrm{collect}\left(\mathrm{zero},x,\mathrm{normal}\right),x\right)$
 ${-}{\mathrm{\infty }}$ (28)
 > $\mathrm{degree}\left(\mathrm{collect}\left(\mathrm{zero},y,\mathrm{normal}\right),y\right)$
 ${-}{\mathrm{\infty }}$ (29)