Method on @sym: degree (p)
Method on @sym: degree (p, x)

Return the degree of a polynomial expression.

Examples:

syms x
degree(x^2 + 6)
  ⇒ (sym) 2

You can specify the variable or rely on the symvar default:

syms x y
degree(x^2 + y*x + 1)
  ⇒ (sym) 2
degree(x^2 + y*x + 1, x)
  ⇒ (sym) 2
degree(x^2 + y*x + 1, y)
  ⇒ (sym) 1

FIXME: degree(x^n, x) does not work here (nor in SMT).

See also: @sym/sym2poly, poly2sym.

Package: symbolic