code: def res(f, g, x):
      """
      The input polynomials f, g are in Z[x] or in Q[x].
  
      The output is the resultant of f, g computed by evaluating
      the determinant of the matrix sylvester(f, g, x, 1).
  
      References:
      ===========
      1. J. S. Cohen: Computer Algebra and Symbolic Computation
       - Mathematical Methods. A. K. Peters, 2003.
  
      """
      if f == 0 or g == 0:
          raise PolynomialError(
              "The resultant of %s and %s is not defined" % (f, g)
          )
      else:
          return sylvester(f, g, x, 1).det()
  
imports: from sympy.concrete.summations import summation
  from sympy.core.function import expand
  from sympy.core.numbers import nan
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy
  from sympy.functions.elementary.complexes import Abs, sign
  from sympy.functions.elementary.integers import floor
  from sympy.matrices.dense import eye, Matrix, zeros
  from sympy.printing.pretty.pretty import pretty_print
  from sympy.simplify.simplify import simplify
  from sympy.polys.domains import QQ
  from sympy.polys.polytools import degree, LC, Poly, pquo, quo, prem, rem
  from sympy.polys.polyerrors import PolynomialError
label_desc: Use image node_id 5 for calling a global function with example usage: res(f, g, x) and returns: sylvester