For example applied to y^2*x^3 + z^2+1 it should give 5 due to the y^2*x^3component.
Asked
Active
Viewed 413 times
1
user3257842
- 872
- 4
- 7
2 Answers
3
Max[Total@*First /@ CoefficientRules[y^2*x^3 + z^2 + 1]]
5
This extracts rules for all coefficient combinations, ignores the constant multiplier for them, sums powers in each of them, and takes the largest sum.
kirma
- 19,056
- 1
- 51
- 93
1
may be this will work in general. Did not test it fully
ClearAll[x,y,z];
p = y^2* x^3 + z^2 + 1;
Exponent[p /. {y -> x, z -> x}, x]
(* 5 *)
Nasser
- 143,286
- 11
- 154
- 359
Exponent[p /. Alternatives @@ Variables@p -> x, x]. – kirma Apr 24 '20 at 09:28