New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrate(log(x)*exp(x), (x, 0, oo)) should return -EulerGamma #4187

Open
certik opened this Issue Sep 5, 2008 · 7 comments

Comments

Projects
None yet
6 participants
@certik
Copy link
Member

certik commented Sep 5, 2008

In [5]: integrate(log(x)*exp(x), (x, 0, oo))
    Out[5]:
    ∞
    ⌠
    ⎮  x
    ⎮ ℯ ⋅log(x) dx
    ⌡
    0

Original issue for #4187: http://code.google.com/p/sympy/issues/detail?id=1088

Original author: https://code.google.com/u/104039945248245758823/

@mattpap

This comment has been minimized.

Copy link
Member

mattpap commented Sep 4, 2008

We can't do it currently because (AXIOM):

(39) -> integrate(exp(x)*log(x), x)
(39) -> 
           x
   (39)  %e log(x) - Ei(x)

Such integrals (in general == without hacks) can't be handled by heuristic Risch
algorithm. However we can compute integrals involving the exponential integral Ei:

In [2]: class Ei(Function):
   ...:     def fdiff(self, argindex=1):
   ...:         return exp(self.args[0])/self.args[0]
   ...:  
   ...:     

In [3]: var('a b')
Out[3]: (a, b)

In [4]: %time a = integrate(Ei(a*x + b), x)
CPU times: user 4.16 s, sys: 0.05 s, total: 4.21 s
Wall time: 4.38 s

In [5]: trim(a)
Out[5]: 
                                   b + a⋅x
b⋅Ei(b + a⋅x) + a⋅x⋅Ei(b + a⋅x) - ℯ  
──────────────────────────────────────────
                    a

Original comment: http://code.google.com/p/sympy/issues/detail?id=1088#c1

Original author: https://code.google.com/u/101069955704897915480/

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Aug 4, 2010

@ness01

This comment has been minimized.

Copy link
Contributor

ness01 commented Aug 17, 2011

the original integral of this issue does not even exist. Maybe exp(-x) was meant instead? in gsoc-3:

In [90]: integrate(log(x)*exp(-x), (x, 0, oo))
Out[90]: -EulerGamma

Original comment: http://code.google.com/p/sympy/issues/detail?id=1088#c3
Original author: https://code.google.com/u/104531927090589914088/

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Mar 20, 2012

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Mar 16, 2013

This seems like it would work, except it hits some bug in the evalf/assumptions code:

ComplexResult: logarithm of a negative number

**Labels:** Evalf Assumptions  

Original comment: http://code.google.com/p/sympy/issues/detail?id=1088#c5
Original author: https://code.google.com/u/asmeurer@gmail.com/

@certik certik added imported labels Mar 7, 2014

skirpichev added a commit to diofant/diofant that referenced this issue Jan 7, 2016

@oldk1331

This comment has been minimized.

Copy link

oldk1331 commented May 20, 2016

In sympy 1.0:

In [12]: integrate(log(x)*exp(-x), (x, 0, oo))
Out[12]: -EulerGamma

This issue can be closed.

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented May 20, 2016

Found a related bug. The indefinite integral integrate(log(x)*exp(-x), x) gives a recursion error from manualintegrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment