Your reply to Jens's answer suggests that you do not want to manually replace variables. This function just automates the method in Jens answer...
cme[hgm_, symb_: c] := Module[
{ places, symbs },
places = Position[hgm, eps];
symbs = Array[symb, Length[places]];
FullSimplify[Normal[Series[
ReplacePart[hgm, (Rule @@ # &) /@ Transpose[{places, symbs}]],
Sequence @@ ({#, 0, 0} & /@ symbs)
]]]
];
On the machine I'm sitting at, it takes 3.4 ms to do your example in Mathematica 10.0.2.0, Linux x64.
AbsoluteTiming[
cme[Hypergeometric2F1[1, 1 - eps/2, 3 - eps, 1/2]]
]
yields
{0.003400, 4 - 2 Log[4]}
Edit 13 May 2015:
To address Jens comment about hard-coded order, and also to produce a series instead of just the leading order terms:
cme[hgm_, symb_: eps, ord_: 0] := Module[
{ places, symbs, c },
places = Position[hgm, symb];
symbs = Array[c, Length[places]];
Series[
FullSimplify[Normal[Series[
ReplacePart[hgm, (Rule @@ # &) /@ Transpose[{places, symbs}]],
Sequence @@ ({#, 0, ord} & /@ symbs)] /. c[_] -> symb
]]
, {symb, 0, ord}]
]
(If one does not care about having a series as the result, drop "Series[
" and ", {symb, 0, ord}]
" each appearing on their own lines.) On the same machine as the prior timing data,
AbsoluteTiming[
cme[Hypergeometric2F1[1, 1 - eps/2, 3 - eps, 1/2]]
]
yields
{0.003157, 4 - 2 Log[4]}
and
AbsoluteTiming[
cme[Hypergeometric2F1[1, 1 - eps/2, 3 - eps, 1/2], eps, 3]
]
yields
{0.064078,
(4-2 Log[4]) +
(2-\[Pi]^2/3+Log[4]-1/2 (Hypergeometric2F1^(0,1,0,0))[1,1,3,1/2]) eps +
1/24 (48+4 \[Pi]^2-72 Zeta[3]+12 (Hypergeometric2F1^(0,1,1,0))[1,1,3,1/2]+3 (Hypergeometric2F1^(0,2,0,0))[1,1,3,1/2]) eps^2 +
1/720 (1440-28 \[Pi]^4+1080 Zeta[3]-180 (Hypergeometric2F1^(0,1,2,0))[1,1,3,1/2]-90 (Hypergeometric2F1^(0,2,1,0))[1,1,3,1/2]-15 (Hypergeometric2F1^(0,3,0,0))[1,1,3,1/2]) eps^3 +
O[eps]^4
}
We could attempt the same sort of expansion and collapse for the derivatives of the hypergeometric functions, but this temds to just produce higher order derivatives and a lot of large (eventually) cancelling terms. Instead, I refer you to the HypExp package, discussed at the question "Expanding derivatives of hypergeometric functions".
HypExp will also do epsilon expansions of exactly the form you are interested. Invocation is via
HypExp[Hypergeometric2F1[...], eps, order]
as described in section 5.1 of the HypExp paper for the package.
Hypergeometric2F1[1, 1 - eps/2, 3 - eps, 1/2] /. eps -> 0
or plot withPlot[ Hypergeometric2F1[1, 1 - eps/2, 3 - eps, 1/2], {eps, -2, 2}]
$\endgroup${eps, 0, 0}
seems to be a Typo. $\endgroup$eps
and are divergent if one just putseps
to0
(e.gGamma[eps]
etc.). This is why I must useSeries
and it is very unfortunate that for this particular case it fails in MMA 10, while in the version 8 everything is fine. $\endgroup${eps,0,1}
or{eps,0,2}
. This still takes ages, unfortunately. $\endgroup$