The homogenize command makes all of the terms of a polynomial F have the same total degree by multiplying each term by a suitable power of a variable Y.
f = x^2+x+1; homogenize(f,y); y^2+y*x+x^2