polys: Fixed #3729 and added a test in sympy.integrals
polys: New domain unification algorithm