'Clear denominators in a rational function ``f/g``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x, y
>>> f = Poly(x**2/y + 1, x)
>>> g = Poly(x**3 + y, x)
>>> p, q = f.rat_clear_denoms(g)
>>> p
Poly(x**2 + y, x, domain=\'ZZ[y]\')
>>> q
Poly(y*x**3 + y**2, x, domain=\'ZZ[y]\')'

def rat_clear_denoms(self, g):

    f = self
    (dom, per, f, g) = f._unify(g)
    f = per(f)
    g = per(g)
    if (not (dom.is_Field and dom.has_assoc_Ring)):
        return (f, g)
    (a, f) = f.clear_denoms(convert=True)
    (b, g) = g.clear_denoms(convert=True)
    f = f.mul_ground(b)
    g = g.mul_ground(a)
    return (f, g)
