MathGroup Archive 2005

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

Search the Archive

Re: Re: Some bugs in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59411] Re: [mg59379] Re: [mg59188] Some bugs in Mathematica
  • From: Andrzej Kozlowski <akozlowski at gmail.com>
  • Date: Tue, 9 Aug 2005 03:30:43 -0400 (EDT)
  • References: <200508010505.BAA24522@smc.vnet.net> <1192.12.210.86.190.1123296535.squirrel@webmail.wolfram.com> <BAY106-DAV184D0BD361AEF55157E0CBC9C60@phx.gbl> <42F50087.5050308@wolfram.com> <BAY106-DAV47DC8237BFF1A81020924C9C60@phx.gbl> <200508070747.DAA18027@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 7 Aug 2005, at 09:47, danl at wolfram.com wrote:

>
>
>> 3) It seems to me that your Mathematica does not understand that  
>> square
>> root
>> in the denominator can be cancelled out by square root in the  
>> numerator,
>> thus eliminating any singularity.
>>
>
> Do you mean in the antiderivative? I would surmise that definite
> integation code has no trouble with that if parameters {a,b} are  
> suitably
> constrained. My guess is the AppellF1 is the issue. In any case I  
> plan to
> look a bit more next week.
>


Mathematica behaves quite correctly. The expression:


Integrate[1/(r^3*Sqrt[r^2 - a^2]*Sqrt[r^2 - b^2]),
   {r, x, c}, GenerateConditions -> False]


(c - x)*((2*(a^2 - c^2)*(c^2 - b^2) -
      (a^2 + b^2)*Sqrt[1 - a^2/c^2]*Sqrt[1 - b^2/c^2]*c^2*
       AppellF1[1, 1/2, 1/2, 2, a^2/c^2, b^2/c^2])/
     (4*a^2*b^2*c^2*Sqrt[c^2 - a^2]*Sqrt[c^2 - b^2]*
      (c - x)) - ((a^2 + b^2)*Sqrt[1 - a^2/x^2]*
       Sqrt[1 - b^2/x^2]*AppellF1[1, 1/2, 1/2, 2, a^2/x^2,
        b^2/x^2]*x^2 + 2*(a^2 - x^2)*(b^2 - x^2))/
     (4*a^2*b^2*x^2*(x - c)*Sqrt[x^2 - a^2]*
      Sqrt[x^2 - b^2]))

involves the factor

Sqrt[1 - a^2/c^2]/Sqrt[c^2 - a^2]

This is the cancellation that Mathematica it is being claimed  
Mathematica should perform. But to do so would be of course wrong.

Indeed, Mathematica knows that


Simplify[Sqrt[1 - a^2/c^2]/Sqrt[c^2 - a^2],
   (c | a) â?? Reals]


1/Abs[c]

But it is easy to find complex c and a for which this is not the case


Sqrt[1 - a^2/c^2]/Sqrt[c^2 - a^2] /.
   {a -> Sqrt[2], c -> I}

-I


As I pointed out earlier, one can do this:

Limit[Integrate[1/(r^3*Sqrt[r^2 - a^2]*Sqrt[r^2 - b^2]),
     {r, x, c}, GenerateConditions -> False], c -> a,
    Direction -> 1]


x^2/(2*a^2*b^2*Sqrt[x^2 - a^2]*Sqrt[x^2 - b^2]) +
    (Sqrt[1 - a^2/x^2]*Sqrt[1 - b^2/x^2]*
      AppellF1[1, 1/2, 1/2, 2, a^2/x^2, b^2/x^2])/
     (4*a^2*Sqrt[x^2 - a^2]*Sqrt[x^2 - b^2]) +
    (Sqrt[1 - a^2/x^2]*Sqrt[1 - b^2/x^2]*
      AppellF1[1, 1/2, 1/2, 2, a^2/x^2, b^2/x^2])/
     (4*b^2*Sqrt[x^2 - a^2]*Sqrt[x^2 - b^2]) +
    (Sqrt[-(1/a)]*Sqrt[-a]*Sqrt[(a^2 - b^2)/a^2]*
      ArcTanh[b/a])/(2*a^2*b*Sqrt[a^2 - b^2]) +
    (Sqrt[-(1/a)]*Sqrt[-a]*Sqrt[(a^2 - b^2)/a^2]*
      ArcTanh[b/a])/(2*b^3*Sqrt[a^2 - b^2]) -
    1/(2*a^2*Sqrt[x^2 - a^2]*Sqrt[x^2 - b^2]) -
    1/(2*b^2*Sqrt[x^2 - a^2]*Sqrt[x^2 - b^2]) +
    1/(2*Sqrt[x^2 - a^2]*Sqrt[x^2 - b^2]*x^2)

It seems hard to test for which range of parameters this may be true;  
I do not intend to try doing so myself.

One should also note that the Mathematica documentation for AppellF1  
gives the following example:


Integrate[x^m*(a*x^r + b)^n*(c*x^r + d)^k, x]


(1/(m + 1))*((x^(m + 1)*(a*x^r + b)^n*(c*x^r + d)^k*
     AppellF1[(m + 1)/r, -n, -k, (m + 1)/r + 1,
      -((a*x^r)/b), -((c*x^r)/d)])/(((a*x^r)/b + 1)^n*
     ((c*x^r)/d + 1)^k))

The alleged "bug" in Mathematica is the result of Mathematica using a  
very general formula  rather than relying on a few special formulae  
that may be simpler as far as they apply but which do not generalise  
beyond that. To me at least it seems pretty obvious that  
Mathematica's approach is the only one that makes sense for a  
computer program.


Andrzej Kozlowski


  • Prev by Date: PlotVectorField
  • Next by Date: List to string ?
  • Previous by thread: Re: Some bugs in Mathematica
  • Next by thread: Re: Some bugs in Mathematica