Repository: sympy/sympy

Issue:
integrate(log(x)*(1-x)**(-1), (x, 0, 1)) causes an error
The integral evaluates to `-pi**2/6`

I am surprised by this because `integrate(log(x)*(1+x)**(-2), (x, 0, 1))` is correctly evaluated

`>>> integrate(log(x)*(1-x)**(-1), (x, 0, 1))`
Traceback (most recent call last):

  File "<ipython-input-5-ba95d81624e1>", line 1, in <module>
    integrate(log(x)*(1-x)**(-1), (x, 0, 1))

  File "C:\Users\Roland\Anaconda3\lib\site-packages\sympy\integrals\integrals.py", line 1295, in integrate
    risch=risch, manual=manual)

  File "C:\Users\Roland\Anaconda3\lib\site-packages\sympy\integrals\integrals.py", line 553, in doit
    evalued = Add(*others)._eval_interval(x, a, b)

  File "C:\Users\Roland\Anaconda3\lib\site-packages\sympy\core\expr.py", line 815, in _eval_interval
    if B.has(S.NaN, S.Infinity, S.NegativeInfinity, S.ComplexInfinity):

AttributeError: 'int' object has no attribute 'has'

Discussion:

Patch:
diff --git a/sympy/functions/special/zeta_functions.py b/sympy/functions/special/zeta_functions.py
index 2abda6d7c3..88dd8d14b9 100644
--- a/sympy/functions/special/zeta_functions.py
+++ b/sympy/functions/special/zeta_functions.py
@@ -5,7 +5,7 @@
 from sympy.core.function import ArgumentIndexError
 from sympy.core.compatibility import range
 from sympy.functions.combinatorial.numbers import bernoulli, factorial, harmonic
-from sympy.functions.elementary.exponential import log
+from sympy.functions.elementary.exponential import log, exp_polar
 from sympy.functions.elementary.miscellaneous import sqrt
 
 ###############################################################################
@@ -299,10 +299,10 @@ def eval(cls, s, z):
         elif s == -1:
             return z/(1 - z)**2
         # polylog is branched, but not over the unit disk
-        if z.is_polar:
-            from sympy.functions.elementary.complexes import Abs, unpolarify
-            if (Abs(z) <= S.One) == True:
-                return cls(s, unpolarify(z))
+        from sympy.functions.elementary.complexes import (Abs, unpolarify,
+            polar_lift)
+        if z.has(exp_polar, polar_lift) and (Abs(z) <= S.One) == True:
+            return cls(s, unpolarify(z))
 
     def fdiff(self, argindex=1):
         s, z = self.args


Test patch:
diff --git a/sympy/integrals/tests/test_integrals.py b/sympy/integrals/tests/test_integrals.py
index 6bae8e3a88..3702b4b3d3 100644
--- a/sympy/integrals/tests/test_integrals.py
+++ b/sympy/integrals/tests/test_integrals.py
@@ -288,6 +288,7 @@ def test_transcendental_functions():
 
 def test_log_polylog():
     assert integrate(log(1 - x)/x, (x, 0, 1)) == -pi**2/6
+    assert integrate(log(x)*(1 - x)**(-1), (x, 0, 1)) == -pi**2/6
 
 
 def test_issue_3740():