degree
degree of a polynomial
ldegree
low degree of a polynomial
Calling Sequence
Parameters
Description
Examples
degree(a, x)
ldegree(a, x)
a
-
any expression
x
(optional) indeterminate or a list or set of indeterminates
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 x+1x+2−x2, 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:
degreep,=0
degreep,x1,x2,...=degreep,x1+degreelcoeffp,x1,x2,...
The total degree is then defined as
degreep,x1,…,xn={maxall termstofpdegreet,x1,…,xn,ifpis a sumdegreep,x1,…,xn,otherwise
Notice that the vector degree is sensitive to the order of the indeterminates, whereas the total degree is not.
a≔x4−10x2+1
degreea,x
4
ldegreea,x
0
b≔x−2−2+3x
b≔1x2−2+3x
degreeb,x
1
ldegreeb,x
−2
c≔x2y+3xy2+x3y3−x5
c≔x3y3−x5+x2y+3xy2
degreec,x
5
degreec,y
3
degreec
6
ldegreec,x
ldegreec,y
ldegreec
f≔xy3+x2
degreef,x,degreef,y
2,3
Find the total degree of f.
degreef
degreef,x,y
Find the vector degree of f, which is sensitive to the order of the indeterminates.
2
degreef,y,x
Examples of non-polynomial inputs
degreeysinx,x
FAIL
degreeysinx,y
degreex+1x+2,x
Here collect with normalization is necessary.
zero≔yxx+1+1x+1−1
degreezero,x
degreezero,y
collectzero,x,normal
degreecollectzero,x,normal,x
−∞
degreecollectzero,y,normal,y
See Also
collect
indets
lcoeff
tcoeff
Download Help Document