(f, g, K)
return gcd, f, g
Extract common content from a pair of polynomials in ``K[x]``.

    Examples
    ========

    >>> from sympy.polys import ring, ZZ
    >>> R, x = ring("x", ZZ)

    >>> R.dup_extract(6*x**2 + 12*x + 18, 4*x**2 + 8*x + 12)
    (2, 3*x**2 + 6*x + 9, 2*x**2 + 4*x + 6)
Extract common content from a pair of polynomials in ``K[x]``.
Extract common content from a pair of polynomials in K [ x ] .
def dup_extract(f, g, K):
    """
    Extract common content from a pair of polynomials in ``K[x]``.

    Examples
    ========

    >>> from sympy.polys import ring, ZZ
    >>> R, x = ring("x", ZZ)

    >>> R.dup_extract(6*x**2 + 12*x + 18, 4*x**2 + 8*x + 12)
    (2, 3*x**2 + 6*x + 9, 2*x**2 + 4*x + 6)

    """
    fc = dup_content(f, K)
    gc = dup_content(g, K)

    gcd = K.gcd(fc, gc)

    if not K.is_one(gcd):
        f = dup_quo_ground(f, gcd, K)
        g = dup_quo_ground(g, gcd, K)

    return gcd, f, g
def dup_extract ( f , g , K ) : fc = dup_content ( f , K ) gc = dup_content ( g , K ) gcd = K . gcd ( fc , gc ) if not K . is_one ( gcd ) : f = dup_quo_ground ( f , gcd , K ) g = dup_quo_ground ( g , gcd , K ) return gcd , f , g