'Computes indefinite integral of ``f``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x, y
>>> Poly(x**2 + 2*x + 1, x).integrate()
Poly(1/3*x**3 + x**2 + x, x, domain=\'QQ\')
>>> Poly(x*y**2 + x, x, y).integrate((0, 1), (1, 0))
Poly(1/2*x**2*y**2 + 1/2*x**2, x, y, domain=\'QQ\')'

def integrate(self, *specs, **args):

    f = self
    if (args.get('auto', True) and f.rep.dom.is_Ring):
        f = f.to_field()
    if hasattr(f.rep, 'integrate'):
        if (not specs):
            return f.per(f.rep.integrate(m=1))
        rep = f.rep
        for spec in specs:
            if (type(spec) is tuple):
                (gen, m) = spec
            else:
                (gen, m) = (spec, 1)
            rep = rep.integrate(int(m), f._gen_to_level(gen))
        return f.per(rep)
    else:
        raise OperationNotSupported(f, 'integrate')
