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+1⁢x+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:
degree⁡p,=0
degree⁡p,x1,x2,...=degree⁡p,x1+degree⁡lcoeff⁡p,x1,x2,...
The total degree is then defined as
degree⁡p,x1,…,xn={maxall termstofpdegree⁡t,x1,…,xn,ifpis a sumdegree⁡p,x1,…,xn,otherwise
Notice that the vector degree is sensitive to the order of the indeterminates, whereas the total degree is not.
a≔x4−10⁢x2+1
degree⁡a,x
4
ldegree⁡a,x
0
b≔x−2−2+3⁢x
b≔1x2−2+3⁢x
degree⁡b,x
1
ldegree⁡b,x
−2
c≔x2⁢y+3⁢x⁢y2+x3⁢y3−x5
c≔x3⁢y3−x5+x2⁢y+3⁢x⁢y2
degree⁡c,x
5
degree⁡c,y
3
degree⁡c
6
ldegree⁡c,x
ldegree⁡c,y
ldegree⁡c
f≔x⁢y3+x2
degree⁡f,x,degree⁡f,y
2,3
Find the total degree of f.
degree⁡f
degree⁡f,x,y
Find the vector degree of f, which is sensitive to the order of the indeterminates.
2
degree⁡f,y,x
Examples of non-polynomial inputs
degree⁡y⁢sin⁡x,x
FAIL
degree⁡y⁢sin⁡x,y
degree⁡x+1x+2,x
Here collect with normalization is necessary.
zero≔y⁢xx+1+1x+1−1
degree⁡zero,x
degree⁡zero,y
collect⁡zero,x,normal
degree⁡collect⁡zero,x,normal,x
−∞
degree⁡collect⁡zero,y,normal,y
See Also
collect
indets
lcoeff
tcoeff
Download Help Document