Re: Converting a 3F2 to elementary functions
- To: mathgroup at smc.vnet.net
- Subject: [mg58189] Re: Converting a 3F2 to elementary functions
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Tue, 21 Jun 2005 06:03:38 -0400 (EDT)
- Organization: The University of Western Australia
- References: <d9632c$q2i$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <d9632c$q2i$1 at smc.vnet.net>, carlos at colorado.edu wrote: > In a fluid-mechanics application I need the 3F2 hypergeometric > function (parameter m is a positive integer) > > g32[m_,x_]:= x^2*HypergeometricPFQ[{1,2*m-1,1},{m+1/2,2},x^2]; > > For small m this converts (via FunctionExpand and Simplify) to > elementary functions: > > g32[1,x]= ArcSin[x]^2 > g32[2,x]= (3*(x*Sqrt[1-x^2]+(-1+2*x^2)*ArcSin[x]))/(4*x*Sqrt[1-x^2]) > g32[3,x]= (-5*(x*Sqrt[1-x^2]*(-3-20*x^2+20*x^4)+3* > (1+6*x^2-24*x^4+16*x^6)*ArcSin[x]))/(192*x^3*(1-x^2)^(3/2)) > g32[4,x]= (7*(x*Sqrt[1-x^2]*(45+180*x^2+1324*x^4-3008*x^6+1504*x^8)+ > 15*(-3-10*x^2-80*x^4+480*x^6-640*x^8+256*x^10)*ArcSin[x]))/ > (23040*x^5*(1-x^2)^(5/2)) > > The conversion time grows quickly, however, as m increases: > m=1: 0.05 sec, m=2: 0.92 sec, m=3: 22.7 sec, m=4: 35 min > so for m=5 I estimate several hours. > > Question: would there be a faster built-in way? (I would like > to go up to m ~ 12) Yes. I suspect that this computation is slow, not because of a problem with the evaluation of the 3F2, but with a set of 2F1's generated for integral m. To see this, consider a generalization of your function: g32[m_,n_][x_]:= x^2 HypergeometricPFQ[{1,2 m-1,1},{n+1/2,2},x^2] This evaluates very quickly for integral m. For example try g32[11,n][x] However, FunctionExpand on the resulting expression, involving 2F1's of the form HypergeometricPFQ[{i, i}, {n + j/2}, x^2] is _very_ slow. I do not know why the evaluation of these 2F1's is so slow. There is an alternative approach that is _much_ faster. Consider the function f[m_][z_] := HypergeometricPFQ[{1, 2 m - 1}, {m + 1/2}, z] The (indefinite) integral of this function is equivalent to g32: FunctionExpand[Integrate[f[m][z], z]] z HypergeometricPFQ[{1, 1, 2 m - 1}, {2, m + 1/2}, z] Evaluating f[m][z] for integral m is very quick, and integrating the resulting expression is acceptably fast. For example, with m = 11, here is the computation: [1] Compute and simplify the integrand: Collect[f[11][z], {ArcSin[_]}, Simplify[#, z > 0] & ] [2] Map the integration over each term, and simplify: FullSimplify[#, x > 0] & /@ (Collect[Integrate[#, z] & /@ %, {ArcSin[_]}, Simplify[#, z > 0] & ] /. z -> x^2) [3] Since we've used indefinite integration, the result can differ from the correct result by an arbitrary constant. Use Series expansion to eliminate this constant: % - Normal[% + O[x]] This is the result that you're after. [4] Here is a routine that puts this all together: g[m_ /; m > 1][x_] := Module[{z, int, ans}, int = Collect[f[m][z], {ArcSin[_]}, Simplify[#, z > 0] & ]; ans = FullSimplify[#, x > 0] & /@ (Collect[Integrate[#, z] & /@ int, {ArcSin[_]}, Simplify[#, z > 0] & ] /. z -> x^2); Factor /@ (ans - Normal[ans + O[x]])] Cheers, Paul -- Paul Abbott Phone: +61 8 6488 2734 School of Physics, M013 Fax: +61 8 6488 1014 The University of Western Australia (CRICOS Provider No 00126G) AUSTRALIA http://physics.uwa.edu.au/~paul http://InternationalMathematicaSymposium.org/IMS2005/