Function Repository Resource:

PolynomialDegree

Source Notebook

Compute the degree of a polynomial in any number of variables

Contributed by: Dennis M Schneider

ResourceFunction["PolynomialDegree"][poly,vars]

returns the degree of a polynomial in vars.

Details and Options

The second argument vars can be a list of any number of variables.

Examples

Basic Examples (4) 

Compute the degree of a basic polynomial expression:

In[1]:=
ResourceFunction["PolynomialDegree"][a + b x + c x^2, x]
Out[1]=

Compute the degree of a polynomial in two variables:

In[2]:=
ResourceFunction["PolynomialDegree"][a + b x + c x^2 + x y^4, {x, y}]
Out[2]=

The following expression is constant with respect to the variables z, w, u:

In[3]:=
ResourceFunction["PolynomialDegree"][
 a + \[Pi] x + c y^2 + x^2 y^4, {z, w, u}]
Out[3]=

The following expression is not a polynomial in x and y:

In[4]:=
ResourceFunction["PolynomialDegree"][
 a + b x + c y^\[Pi] + x^2 y^4, {x, y}]

Properties and Relations (1) 

A constant polynomial has degree 0 but the zero polynomial (even though it is a constant polynomial) does not have a degree (though some authors assign it to have degree -1 or ):

In[5]:=
ResourceFunction["PolynomialDegree"][a, z]
Out[5]=
In[6]:=
ResourceFunction["PolynomialDegree"][0, z]
Out[6]=

Publisher

Dennis M Schneider

Version History

  • 1.0.0 – 30 July 2019

Related Resources

License Information