MathGroup Archive 2003

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

Search the Archive

Re: Bug in Integrate? (v. 5.0)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45284] Re: [mg45232] Bug in Integrate? (v. 5.0)
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Sat, 27 Dec 2003 05:00:21 -0500 (EST)
  • References: <200312231013.FAA12219@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 23 Dec 2003, at 19:13, Antonio González wrote:

> Trying to find the Fourier series of
>
>  f[t_]=Sinh[a Cos[t]]
>
> I tried the integral
>
>  J = Integrate[4 Cos[t] Sinh[a Cos[t]]/Pi,{t,0,Pi/2}]
>
> whose result should be
>
>  J = 2 BesselI[1,a]
>
> and, in fact, this is the answer in Mathematica 4.1.
> In Mathematica 5.0, I got the wrong result
>
>  J = 0
>
> Can anybody explain why?
>
>   Antonio
>
>
>
>
First transform the integrand so that Sinh is expressed asa sum of 
exponentials. You can do it as follows:


Apart[4*Cos[t]*(Sinh[a*Cos[t]]/Pi) /.
    Sinh[x_] -> TrigToExp[Sinh[x]]]


-((2*Cos[t])/(E^(a*Cos[t])*Pi)) + (2*E^(a*Cos[t])*Cos[t])/
    Pi

Now let's take the two terms separately and evaluate first in version 
5.0 and then in 4.2. Version 5 gives:


Integrate[(2*E^(a*Cos[t])*Cos[t])/Pi, {t, 0, Pi/2}]


-((a*BesselI[1, a])/Sqrt[a^2]) + StruveL[-1, a]

and


Integrate[(2*Cos[t])/(E^(a*Cos[t])*Pi), {t, 0, Pi/2}]


-((a*BesselI[1, a])/Sqrt[a^2]) + StruveL[-1, a]


Note that we got the same answers, so they cancel giving the (wrong) 
answer 0.

In Mathematica 4.2 on the other hand the answers are:


Integrate[(2*E^(a*Cos[t])*Cos[t])/Pi, {t, 0, Pi/2}]


BesselI[1, a] + StruveL[-1, a]


Integrate[(2*Cos[t])/(E^(a*Cos[t])*Pi), {t, 0, Pi/2}]


-BesselI[1, a] + StruveL[-1, a]

Hence subtracting the answers we get the correct value 2 BesselI[1, a] .


To conclude: the wrong answer given by Mathematica 5.0 appears to be 
caused by the following:


J=Integrate[(2*E^(a*Cos[t])*Cos[t])/Pi, {t, 0, Pi/2}]


-((a*BesselI[1, a])/Sqrt[a^2]) + StruveL[-1, a]

which is correct only when a<0


FullSimplify[J, a < 0]


BesselI[1, a] + StruveL[-1, a]

but wrong when a>0:


FullSimplify[J, a > 0]


-BesselI[1, a] + StruveL[-1, a]



Andrzej Kozlowski
Chiba, Japan
http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: Re: bug???
  • Next by Date: Re: How to copy pattern from one expression to another?
  • Previous by thread: Bug in Integrate? (v. 5.0)
  • Next by thread: polynomialsorting.html + tensor