Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: bug in Integrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78306] Re: bug in Integrate
  • From: dimitris <dimmechan at yahoo.com>
  • Date: Thu, 28 Jun 2007 04:19:31 -0400 (EDT)
  • References: <f5ivfs$avv$1@smc.vnet.net>


            Veit Elser       :
> In version 6.0, the Integrate function applied to
>
> Integrate[x Exp[-x] Log[x z], {x, 0, Infinity}, Assumptions -> z > 0]
>
> evaluates to 0. Version 5.2 gives the correct result,
>
> 1 - EulerGamma + Log[z]. Interestingly, back in version 6.0
>
> Integrate[x Exp[-x] Log[x z], {x, 0, Infinity}, Assumptions -> z == 1]
>
> does evaluate correctly to
>
> 1 - EulerGamma
>
> Let's hope this is fixed before the end of Euler's tercentennial.
>
>
> Veit Elser

Hi.

$VersionNumber->5.2

(I don't have version 6)

Note that if you give specific values in parameter(s)
you should use With instead of Assumptions->z==1...

That is I consider more suitable the following structure

In[76]:=
With[{z = 1}, Integrate[x*Exp[-x]*Log[x*z], {x, 0, Infinity}]]

Out[76]=
1 - EulerGamma

As you noticed Mathematica 5.2 gets correctly the integral.
Note however that,

In[99]:=
Integrate[x*Exp[-x]*Log[x*z], {x, 0, Infinity}]

Out[99]=
1 - EulerGamma + Log[z]

That is no need for assumptions.

(*check*)

In[101]:=
N[(1 - EulerGamma + Log[z] /. z -> #1 & ) /@ {2, 3, -4, I + 6, -3*I}]

Out[101]=
{1.1159315156584124, 1.5213966237665768, 1.8090786962183576 +
3.141592653589793*I, 2.228243291420579 + 0.16514867741462683*I,
  1.5213966237665768 - 1.5707963267948966*I}

In[102]:=
(NIntegrate[x*Exp[-x]*Log[x*#1], {x, 0, Infinity}] & ) /@ {2, 3, -4, I
+ 6, -3*I}

Out[102]=
{1.1159315184569099, 1.5213966033406756, 1.809078675792414 +
3.141592653589326*I, 2.2282432709945725 + 0.1651486774146023*I,
  1.5213966033406756 - 1.570796326794663*I}

What does the version 6 returns if you don't specify a range for the
parameter?

Here are some workarounds based on my experience with earlier versions
of Mathematica that
could work in Mathematica 6:

In[106]:=
f = HoldForm[Integrate[x*Exp[-x]*Log[x*z], {x, 0, Infinity}]]
ReleaseHold[f /. z -> Catalan] /. Catalan -> z

Out[106]=
HoldForm[Integrate[(x*Log[x*z])/E^x, {x, 0, Infinity}]]

Out[107]=
1 - EulerGamma + Log[z]

2)

In[92]:=
ReleaseHold[f /. Integrate[g_, h_] :> Integrate[g, x]]
Limit[%, x -> Infinity] - Limit[%, x -> 0, Direction -> -1]

Out[92]=
-E^(-x) + ExpIntegralEi[-x] - ((1 + x)*Log[x*z])/E^x

Out[93]=
1 - EulerGamma + Log[z]

Dimitris



  • Prev by Date: Re: Re: problem with Pick
  • Next by Date: Re: NonlinearRegress and errors on parameter fit
  • Previous by thread: bug in Integrate
  • Next by thread: Re: Re: bug in Integrate