MathGroup Archive 2009

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

Search the Archive

Re: Integrate Bug

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100439] Re: Integrate Bug
  • From: Valeri Astanoff <astanoff at gmail.com>
  • Date: Thu, 4 Jun 2009 03:31:39 -0400 (EDT)
  • References: <gv2jh5$97b$1@smc.vnet.net>

On 21 mai, 05:58, Ney Lemke <ney.nle... at gmail.com> wrote:
> I am trying to calculate this integral that should be positive.But the
> answer is 0.
>
> In:Integrate[(1)/(z^2 + b^2 + a^2 - 2 z b Sin[\[Theta]] -
>     2 a b Cos[\[Theta]])^(1/2), {\[Theta], 0, 2 \[Pi]},
>  Assumptions -> {a > 0, b > 0, z > 0}]
>
> Out:0
>
> Anybody have notice a situation like that?
>
> My platform is MacOSX 10.4 and Mathematica 7.
>
> Best wishes,

Good day,

A half-manual half-guessed tentative solution
to get around the bug :

In[1]:= f[a_, b_, z_, t_] = 1/Sqrt[a^2 + b^2 + z^2 - 2a*b*Cos[t] -
2b*z*Sin[t]];

In[2]:= F[a_, b_, z_] /; b < a || b < z :=
-((4 Sqrt[a^2 + b^2 + z^2 + 2b Sqrt[a^2 + z^2]]*
 Im[EllipticK[(a^4 + b^4 + 6b^2*z^2 + z^4 +
 4b^3*Sqrt[a^2 + z^2] + 4b*z^2Sqrt[a^2 + z^2] +
 2a^2*(3*b^2 + z^2 + 2b*Sqrt[a^2 + z^2]))/
 (a^2 - b^2 + z^2)^2]])/(a^2 - b^2 + z^2));

F[a_, b_, z_] /; b > a && b > z :=
 4 Sqrt[a^2 + b^2 + z^2 + 2b Sqrt[a^2 + z^2]]*
 Im[EllipticK[(a^4 + b^4 + 6b^2 z^2 + z^4 +
 4b^3*Sqrt[a^2 + z^2] + 4b*z^2Sqrt[a^2 + z^2] +
 2a^2*(3*b^2 + z^2 + 2b*Sqrt[a^2 + z^2]))/
 (a^2 - b^2 + z^2)^2]/(a^2 - b^2 + z^2)];


Numeric check :

In[4]:= F[2, 3, 4]

Out[4]= (-(4/11))*Sqrt[29 + 12Sqrt[5]]*
 Im[EllipticK[(1/121)*(1217 + 600 Sqrt[5] + 8*(43 + 12 Sqrt[5]))]]

In[5]:= % // N

Out[5]= 1.62239

In[6]:= NIntegrate[f[2, 3, 4, t], {t, 0, 2 Pi}]

Out[6]= 1.62239

In[7]:= F[2, 5, 4]

Out[7]= 4 Sqrt[45 + 20 Sqrt[5]]*
 Im[(-(1/5))*
 EllipticK[(1/25)*(3297 + 1640 Sqrt[5] + 8*(91 + 20 Sqrt[5]))]]

In[8]:= % // N

Out[8]= 1.80576

In[9]:= NIntegrate[f[2, 5, 4, t], {t, 0, 2 Pi}]

Out[9]= 1.80576

--
V.Astanoff


  • Prev by Date: Re: problem writing debugging utility function
  • Next by Date: Re: Tube in ParametricPlot3D with too many details
  • Previous by thread: Re: Integrate Bug
  • Next by thread: Re: Integrate Bug