degree(x,f)
i1 : R = QQ[a..d];
i2 : degree(b, a*b^5+b^7-3*a^10-3) o2 = 7
The source of this document is in Macaulay2Doc/functions/degree-doc.m2:251:0.