MathGroup Archive 2003

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

Search the Archive

Re: Integrate Result depends on symbol used

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42886] Re: Integrate Result depends on symbol used
  • From: "Dana DeLouis" <delouis at bellsouth.net>
  • Date: Fri, 1 Aug 2003 01:25:54 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Jim.  I think this is a known bug with Mathematica.  The names of
symbols make a difference in the answer.  Here is an old integration
posting where the consensus was that the answer should return Pi.  I was
checking how Mathematica version 5 handled it.  I do not remember the two
different answers from before, but the one thing that stands out is how
long it now takes with version 5.  The wrong answer was returned much
faster in earlier versions.  Here, the integration variable is x.  I am
going by memory, but the previous versions had the problem you describe.
The integration variable had to come later in the alphabet then the
other variable names.  I think the first example returned the wrong
answer in version 4.2, but again, I am going by memory and do not
remember.  (I think each took 0.0 Seconds in earlier versions)

Here are two similar equations: (changing 'd' or 'z')

Timing[Integrate[Sin[z + x]/(z + x),{x, -Infinity, Infinity}]]

Timing[Integrate[Sin[d + x]/(d + x),{x, -Infinity, Infinity}]]
 = = = = = = = 

Here are the two results:

Timing[Integrate[Sin[z + x]/(z + x), {x, -Infinity, Infinity}]]
 
 {85.843*Second, If[Im[z] != 0, Pi, 
   Integrate[Sin[x + z]/(x + z), 
    {x, -Infinity, Infinity}, Assumptions -> 
     Im[z] == 0]]}

Timing[Integrate[Sin[d + x]/(d + x),{x, -Infinity, Infinity}]]
 
 {66.215*Second, If[Im[d] != 0 && Re[d] > 0, 
   Cos[d]*(Pi*Cos[d] + d*((-I)*Pi + 
        Log[-(1/d)] - Log[d] + Log[d^2])) + 
    ((-I)*Pi + Cos[d]*(-2 + 2*I*Pi - 
        2*Log[-(1/d)]) + Log[-(1/d)] + Log[d])*
     Sin[d], Integrate[Sin[d + x]/(d + x), 
    {x, -Infinity, Infinity}, Assumptions -> 
     Im[d] == 0 || Re[d] <= 0]]}



-- 
Dana DeLouis
Windows XP
Mathematica 5.0 for Windows 
delouis at bellsouth.net
= = = = = = = = = = = = = = = = = 


"Jim Hanson" <hanson at physics.auburn.edu> wrote in message
news:bg7vj2$hi7$1 at smc.vnet.net...
> Mathematica's ability to do a definite integral depends on the symbol
> used.
> Here's an example with Mathematica 5.0.0.0 on a Macintosh running OSX
10.2.6.
> Note that Mathematica can do the integral with  a symbol z
> (which comes after the variable of integration y in the alphabet) but
> can't do it with a symbol x. This seems very odd to me. Does anyone
> know why this happens?
> 
> In[1]:= Integrate[Sqrt[y - x]/(y^2 Sqrt[1 - y^2]), { y , x, 1},
> Assumptions -> {x > 0, x < 1}]
> 
>                    Sqrt[-x + y]
> Out[1]= Integrate[---------------, {y, x, 1}, Assumptions -> {x > 0, x
> < 1}]
>                    2           2
>                   y  Sqrt[1 - y ]
> 
> In[2]:= Integrate[Sqrt[y - z]/(y^2 Sqrt[1 - y^2]), {y, z, 1},
> Assumptions -> {z > 0, z < 1}]
> 
>                 2
> Out[2]= (Pi (------- - 
>              Sqrt[z]
>  
>                                             1   1  3    1  5    2
>           2 Sqrt[2 Pi] HypergeometricPFQ[{-(-), -, -}, {-, -}, z ]
>                                             4   4  4    2  4
> >         -------------------------------------------------------- + 
>                                    1        5
>                              Gamma[-] Gamma[-]
>                                    4        4
>  
>                                          1  3  5    3  7    2
>          Sqrt[2 Pi] z HypergeometricPFQ[{-, -, -}, {-, -}, z ]
>                                          4  4  4    2  4
> >        -----------------------------------------------------)) / 4
>                                  1         7
>                          Gamma[-(-)] Gamma[-]
>                                  4         4
>


  • Prev by Date: Re: New version, new bugs
  • Next by Date: sparse matrix i/o
  • Previous by thread: Re: Integrate Result depends on symbol used
  • Next by thread: Palette Question