Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Indeed:

sage: sympy.integrate(*map(sympy.sympify, [(1/x^a)*(1/(1-x)),x])).simplify()
x**(1 - a)*lerchphi(x, 1, 1 - a)

By the way :

sage: sx, sa=sympy.symbols("sx, sa")
sage: foo=sympy.integrate(1/(sx^sa)*(1/(1-sx)),sx).simplify() ; foo
sx**(1 - sa)*lerchphi(sx, 1, 1 - sa)
sage: type(foo)
<class 'sympy.core.mul.Mul'>

And, indeed,

sage: foo._sage_()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-17-59090414f898> in <module>()
----> 1 foo._sage_()

/usr/local/sage-9/local/lib/python3.7/site-packages/sage/interfaces/sympy.py in _sympysage_mul(self)
    217     s = 1
    218     for x in self.args:
--> 219         s *= x._sage_()
    220     return s
    221 

/usr/local/sage-9/local/lib/python3.7/site-packages/sage/interfaces/sympy.py in _sympysage_function(self)
    304         else:
    305             # the function defined in sympy is not known in sage
--> 306             raise AttributeError
    307 
    308     return func(*args)

AttributeError: 
sage:

This can be corrected at the price of implementing sympy's lerchphi (a. k. a. Lerch transcendent (Lerch phi function)) in Sage. Quite possibly as an interface to sympy's function...

HTH,