The resultant command computes the resultant of polynomial A and B in the variable X. An optional fourth argument P specifies the modulus.
f = (x-1)*(x^2+x+1); g = (x-1)*(x^3+x+1); resultant(f,g,x); 0