MathGroup Archive 2007

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

Search the Archive

Re: Re: bug in Integrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78353] Re: [mg78306] Re: bug in Integrate
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 29 Jun 2007 05:39:31 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

$Version

6.0 for Mac OS X x86 (32-bit) (April 20, 2007)

Integrate[x*Exp[-x]*Log[x*z], {x, 0, Infinity}]

Log[z] - EulerGamma

Integrate[x*Exp[-x]*Log[x*z], {x, 0, Infinity}, Assumptions -> z > 0]

0

Integrate[x*Exp[-x]*Log[x*z], {x, 0, Infinity}, Assumptions -> z < 0]

I*Pi

Integrate[x*Exp[-x]*Log[x*z] // ExpToTrig, {x, 0, Infinity}, 
 Assumptions -> z > 0]

Log[z] - EulerGamma + 1

Integrate[x*Exp[-x]*Log[x*z] // ExpToTrig, {x, 0, Infinity}, 
 Assumptions -> z < 0]

Log[-z] + I*Pi - EulerGamma + 1


Bob Hanlon

---- dimitris <dimmechan at yahoo.com> wrote: 
> 
> 
>             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: Second argument of BeginPackage, revisited
  • Next by Date: Re: How to save/export a Manipulate[...] run to a movie file?
  • Previous by thread: Re: bug in Integrate
  • Next by thread: Just one "1" in a list