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

Open
opened this Issue Sep 5, 2008 · 7 comments

Projects
None yet
6 participants
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/
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/
Member

### asmeurer commented Aug 4, 2010

 ``````**Labels:** Integration `````` Original comment: http://code.google.com/p/sympy/issues/detail?id=1088#c2 Original author: https://code.google.com/u/asmeurer@gmail.com/
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/
Member

### asmeurer commented Mar 20, 2012

 ``````**Status:** Valid `````` Original comment: http://code.google.com/p/sympy/issues/detail?id=1088#c4 Original author: https://code.google.com/u/asmeurer@gmail.com/
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/

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

``` Integral.doit: Vectorize _eval_interval calls only if antideriv has I… ```
```…ntegral

Fixes sympy/sympy#4187```
``` cfcf7f3 ```

### 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.
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.