import sympy
from sympy.polys.subresultants_qq_zz import *

from sympy import symbols, pprint

x = symbols('x')

f = x**6 - 7*x**4 + 5*x**2 + 3
g = x**5 + 3*x**3 - 2*x + 7

pprint(sylvester(f, g, x, 1))
print('\n')
pprint(sylvester(f, g, x, 2))
