'Returns LCM of ``a`` and ``b``.
>>> from sympy.polys.domains import QQ
>>> from sympy import S, lcm
>>> QQ.lcm(QQ(2, 3), QQ(4, 9))
4/3
>>> lcm(S(2)/3, S(4)/9)
4/3'

def lcm(self, a, b):

    try:
        ring = self.get_ring()
    except DomainError:
        return (a * b)
    p = ring.lcm(self.numer(a), self.numer(b))
    q = ring.gcd(self.denom(a), self.denom(b))
    return (self.convert(p, ring) / q)
