(f, g, *gens, **args)
Compute resultant of ``f`` and ``g``.

    Examples
    ========

    >>> from sympy import resultant
    >>> from sympy.abc import x

    >>> resultant(x**2 + 1, x**2 - 1)
    4
Compute resultant of ``f`` and ``g``.
Compute resultant of f and g .
def resultant(f, g, *gens, **args):
    """
    Compute resultant of ``f`` and ``g``.

    Examples
    ========

    >>> from sympy import resultant
    >>> from sympy.abc import x

    >>> resultant(x**2 + 1, x**2 - 1)
    4

    """
    includePRS = args.pop('includePRS', False)
    options.allowed_flags(args, ['polys'])

    try:
        (F, G), opt = parallel_poly_from_expr((f, g), *gens, **args)
    except PolificationFailed as exc:
        raise ComputationFailed('resultant', 2, exc)

    if includePRS:
        result, R = F.resultant(G, includePRS=includePRS)
    else:
        result = F.resultant(G)

    if not opt.polys:
        if includePRS:
            return result.as_expr(), [r.as_expr() for r in R]
        return result.as_expr()
    else:
        if includePRS:
            return result, R
        return result
def resultant ( f , g , * gens , * * args ) : includePRS = args . pop ( 'includePRS' , False ) options . allowed_flags ( args , [ 'polys' ] ) try : ( F , G ) , opt = parallel_poly_from_expr ( ( f , g ) , * gens , * * args ) except PolificationFailed as exc : raise ComputationFailed ( 'resultant' , 2 , exc ) if includePRS : result , R = F . resultant ( G , includePRS = includePRS ) else : result = F . resultant ( G ) if not opt . polys : if includePRS : return result . as_expr ( ) , [ r . as_expr ( ) for r in R ] return result . as_expr ( ) else : if includePRS : return result , R return result