Re: NIntegrate HypergeometricU
- To: mathgroup at smc.vnet.net
- Subject: [mg84920] Re: NIntegrate HypergeometricU
- From: sashap <pavlyk at gmail.com>
- Date: Sat, 19 Jan 2008 06:04:48 -0500 (EST)
- References: <fmkf3a$9fg$1@smc.vnet.net> <fmmk6e$eog$1@smc.vnet.net>
Hi David,
It was my bad, I was solving the incorrect integral...
nres[a_, b_, R_, p : OptionsPattern[NIntegrate]] /;
NumericQ[a] && NumericQ[b] && NumericQ[R] :=
NIntegrate[HypergeometricU[a, b, R/Sin[t]^2], {t, 0, Pi/2}, p]
exactAnswer[a_, b_, R_] := With[{g = 1/Gamma[1 + a - b]},
If[g == 0,
(Sqrt[\[Pi]] (1/R)^
a Gamma[1/2 + a] HypergeometricPFQ[{a, 1/2 + a,
a + 1 - b}, {1 + a}, -(1/R)])/(2 Gamma[1 + a]),
Sqrt[Pi]/2 1/(Gamma[a] Gamma[1 + a - b])
MeijerG[{{1 - a}, {1}}, {{0, 1/2, 1 - b}, {}}, R]
]
]
Then:
In[31]:= exactAnswer[1/3, 1/5, 1`20]
Out[31]= 0.9716099205356616740
In[32]:= nres[1/3, 1/5, 1, WorkingPrecision -> 20]
Out[32]= 0.97160992053566167392
In[33]:= exactAnswer[1, 2, 1`20]
Out[33]= 0.78539816339744830962
In[34]:= nres[1, 2, 1, WorkingPrecision -> 20]
Out[34]= 0.78539816339744830962
Now few words as to how I arrived to the result.
After the substitution, where I made a mistake, we integrate
Integrate[ HypergeometricU[a,b,R/x]/(2Sqrt[x(1-x)]), {x,0,1}]
We now use the functions.wolfram.com to learn that
HypergeometricU[a,b,R/x]==MeijerG[{{1 - a}, {}}, {{0, 1 - b}, {}}, R/
x]/(
Gamma[a] Gamma[1 + a - b])
and
UnitStep[1-Abs[x]]*Sqrt[x]/Sqrt[1-x] == Sqrt[Pi] MeijerG[{{}, {1}},
{{1/2}, {}}, x]
thus we integrate:
Sqrt[Pi]/(2 Gamma[a] Gamma[1 + a - b]) Integrate[ MeijerG[{{1 - a},
{}}, {{0, 1 - b}, {}}, R/x] *
MeijerG[{{}, {1}}, {{1/2}, {}}, x]/x, {x, 0, Infinity}]
Indeed:
In[2]:= Assuming[R > 0 && a >= 1 && b >= 1,
Sqrt[Pi]/(2 Gamma[a] Gamma[1 + a - b]) Integrate[
MeijerG[{{1 - a}, {}}, {{0, 1 - b}, {}}, R/x]*
MeijerG[{{}, {1}}, {{1/2}, {}}, x]/x, {x, 0, Infinity}] -
Integrate[
HypergeometricU[a, b, R/x]/(2 Sqrt[x] Sqrt[1 - x]), {x, 0, 1}] //
FullSimplify]
Out[2]= 0
Now we use convolution theorem to obtain the result in terms of
MeijerG.
Oleksandr Pavlyk
Wolfram Research