Re: Integrate with PrincipalValue->True

• To: mathgroup at smc.vnet.net
• Subject: [mg79974] Re: Integrate with PrincipalValue->True
• From: dimitris <dimmechan at yahoo.com>
• Date: Fri, 10 Aug 2007 01:40:17 -0400 (EDT)
• References: <f9em11\$k0v\$1@smc.vnet.net>

I guess the post of Chris Chiasson (link below)
might be interesting for you.

At least in version 5.2 the integral is evaluated with the convolution
method.

Dimitris

PS

Note in direct connection with your message but,
I think you may find useful the following

In[1]:=
\$Version

Out[1]=
"5.2 for Microsoft Windows (June 20, 2005)"

In[2]:=
f[x_] := Sqrt[x]/(1 - x^2)

In[3]:=
Plot[f[x], {x, 0, 5}]

In[5]:=
(Limit[f[x], x -> 1, Direction -> #1] & ) /@ {-1, 1} (*simple pole at
x=1*)

Out[5]=
{-Infinity, Infinity}

Let's take some numerical estimations.

In[6]:=
lst = Range[2, 10];

In[7]:=
o = 10^(-10); (*I know about the CaucyPrincipalValue package!*)
(NIntegrate[f[x], {x, 0, 1 - o}, MaxRecursion -> 10, WorkingPrecision -
> 30, PrecisionGoal -> 10] +
NIntegrate[f[x], {x, 1 + o, #1}, MaxRecursion -> 10,
WorkingPrecision -> 30, PrecisionGoal -> 10] & ) /@ lst

Out[8]=
{-0.0739430311049670432204230836`8.939604229977633,
-0.3887186027341901733414810109`9.432530200498425,
-0.5578425734600364471`9.068583719613938,
-0.6690501664513288361`9.285122568660134,
-0.7496922768944342099`8.870518013789683,
-0.8117464722762367919`8.956342895479304,
-0.8614604454149061598`9.006467398351345,
-0.9024721821182825622`9.082584062920915,
-0.9370688073879695108`9.154292337156724}

Let's see how someone could obtain the integral.

In[9]:=
F[x_] = Integrate[f[x], x]

Out[9]=
-ArcTan[Sqrt[x]] - (1/2)*Log[-1 + Sqrt[x]] + (1/2)*Log[1 + Sqrt[x]]

In[10]:=
myres = (Limit[#1, e -> 0] & )[Limit[F[x], x -> a] - Limit[F[x], x ->
1 + e, Assumptions -> 0 < e < 1] +
Limit[F[x], x -> 1 - e, Assumptions -> 0 < e < 1] - Limit[F[x], x -
> 0, Direction -> 1]]

Out[10]=
(1/2)*(-2*ArcTan[Sqrt[a]] - Log[-1 + Sqrt[a]] + Log[1 + Sqrt[a]])

In[11]:=
(N[#1, 10] & )[FullSimplify[(myres /. a -> #1 & ) /@ lst]]

Out[11]=
{-0.0739430311049662529312477775`10.,
-0.3887186027341893918416912875`10.,
-0.5578425734600356573194428417`10.,
-0.6690501664513280438666761403`10.,
-0.7496922768944334136540147013`10.,
-0.8117464722762359983781875487`10.,
-0.861460445414905367905256551`10.,
-0.9024721821182817711426768946`10.,
-0.9370688073879687198265482121`10.}

Agreement with the numerical estimations.

Let's see what Mathematica 5.2 does

In[12]:=
Integrate[f[x], {x, 0, a}, Assumptions -> a > 1, PrincipalValue ->
True]
res52 = (FullSimplify[#1, a > 1] & )[FunctionExpand[%]]

Out[12]=
-(Pi/2) + (2*Hypergeometric2F1[1/4, 1, 5/4, 1/a^2])/Sqrt[a]

Out[13]=
(1/2)*(-Log[1 - 1/Sqrt[a]] + Log[1 + 1/Sqrt[a]] + I*(Log[I - Sqrt[a]]
- Log[I + Sqrt[a]]))

In[14]:=
(N[#1, 10] & )[FullSimplify[(res52 /. a -> #1 & ) /@ lst]]

Out[14]=
{-0.0739430311049662529312477775`10.,
-0.3887186027341893918416912875`10.,
-0.5578425734600356573194428417`10.,
-0.6690501664513280438453002623`10.,
-0.7496922768944334136540147013`10.,
-0.8117464722762359983781875488`10.,
-0.8614604454149053679052565509`10.,
-0.9024721821182817711426768945`10.,
-0.937068807387968719826548212`10.}

Again correct.

In[15]:=
res6 = ArcCoth[Sqrt[a]] - ArcTan[Sqrt[a]];

In[16]:=
(N[#1, 10] & )[(res6 /. a -> #1 & ) /@ lst]

Out[16]=
{-0.0739430311049662529312477776`10.,
-0.3887186027341893918416912874`10.,
-0.5578425734600356573194428417`10.,
-0.6690501664513280438453002623`10.,
-0.7496922768944334136540147013`10.,
-0.8117464722762359983781875487`10.,
-0.8614604454149053679052565509`10.,
-0.9024721821182817711426768945`10.,
-0.937068807387968719826548212`10.}

Correct!

So it appears that Mathematica 6 is one step forward from version 5.2
since
not only it gets the correct symbolic answer but it also it returns a
much more

The funny is that Mathematica needs a little help in order to show
that the three expressions (i e res52, myres, res6) are equal.

In[17]:=
(FullSimplify[#1, a > 1] & )[{res6 == res52, res52 == myres, res6 ==
myres}]
Apply[Plus[#1 - #2] & , Drop[%, {3}], {1}]
% /. a -> 0
Together[D[%%, a]]

Out[17]=
{Log[I - Sqrt[a]] + Log[1 - I*Sqrt[a]] == Log[1 + I*Sqrt[a]] + Log[I +
Sqrt[a]],
(-I)*(Log[I - Sqrt[a]] - Log[I + Sqrt[a]]) == 2*ArcTan[Sqrt[a]],
True}

Out[18]=
{Log[I - Sqrt[a]] + Log[1 - I*Sqrt[a]] - Log[1 + I*Sqrt[a]] - Log[I +
Sqrt[a]],
-2*ArcTan[Sqrt[a]] - I*(Log[I - Sqrt[a]] - Log[I + Sqrt[a]])}

Out[19]=
{0, 0}

Out[20]=
{0, 0}

On 9    , 12:16, chuck009 <dmili... at comcast.com> wrote:
> Can someone explain to me how Integrate calculates the following improper integral?
>
> In[42]:= \$Version
> Integrate[Sqrt[x]/(1 - x^2), {x, 0, a},
>    PrincipalValue -> True, Assumptions ->
>      a > 1]
>
> Out[42]= "6.0 for Microsoft Windows (32-bit) (June 19, 2007)"
>
> Out[43]= ArcCoth[Sqrt[a]] - ArcTan[Sqrt[a]]
>
> Thanks,
> Charles

• Prev by Date: Re: data format on y axis
• Next by Date: Question about EventHandler - missing documentation
• Previous by thread: Integrate with PrincipalValue->True
• Next by thread: Re: Integrate with PrincipalValue->True