Re: troubling simple integral

*To*: mathgroup at smc.vnet.net*Subject*: [mg91356] Re: troubling simple integral*From*: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>*Date*: Sun, 17 Aug 2008 06:41:14 -0400 (EDT)*Organization*: The Open University, Milton Keynes, UK*References*: <g86844$hr7$1@smc.vnet.net>

did wrote: > Mathematica 6.0.3.0 has trouble computing the quite simple integral > > In[2]:= FullSimplify[ Integrate[ (b + k*x) / k^2 * Exp[-k*x] * > Sin[k*a] * Sin[k*y] , {k, 0,Infinity}, > Assumptions -> x > 0 && Im[a] == 0 && Im[b] == 0 && Im[y] == 0 ]] > > Out[2]= -(1/8) I (b + 2 I x Log[1 + (4 a y)/(x^2 + (a - y)^2)]) > > which is obviously wrong. Repeating the computation, I get different > results. > > What should I do to get a correct answer? > (This one I can do by hand, but I have more complicated similar ones > to evaluate.) Does the following result look better? In[1]:= Assuming[x > 0 && Im[a] == 0 && Im[b] == 0 && Im[y] == 0, FullSimplify[ Integrate[(b + k*x)/k^2*Exp[-k*x]*Sin[k*a]*Sin[k*y], {k, 0, Infinity}]]] Out[1]= 1/4 (2 b ((-a + y) ArcTan[(a - y)/x] + (a + y) ArcTan[(a + y)/ x] - x ArcTanh[(2 a y)/(a^2 + x^2 + y^2)]) + x Log[1 + (4 a y)/(x^2 + (a - y)^2)]) Note that *Assuming* passes the assumptions to both Integrate[] *and* FullSimplify[]. (In your original expression, only Integrate[] could take into account the assumptions.) HTH, -- Jean-Marc