# Limit yielding wrong result for Hypergeometric2F1 but not for Hypergeometric2F1Regularized

I have to deal with an expression with some $$_2F_1$$ and take some limits for some values of the parameters. Let's call this parameter $$m$$. The issue is that I get a different result whether I take the limit of $$m \to \infty$$ or I set $$m$$ to some very large number. As an example

 N[Hypergeometric2F1[1/(1 + m), 11/10 + 1/(1 + m), 2/(1 + m), 1/3] /. m -> 10^40, 50]
N[Limit[Hypergeometric2F1[1/(1 + m), 11/10 + 1/(1 + m), 2/(1 + m), 1/3], m -> Infinity], 50]


gives me two different results.

1.2810348079943079401346432576733365035908779571267
1.0000000000000000000000000000000000000000000000000


Mathematica warns me that it cannot decide whether some quantities are numerically zero or not. If instead I use the regularized 2F1, this problem is not there (at least not in this case)

N[Hypergeometric2F1Regularized[1/(1 + m), 11/10 + 1/(1 + m), 2/(1 + m), 1/3] /. m -> 10^40, 50]
N[Limit[Hypergeometric2F1Regularized[1/(1 + m), 11/10 + 1/(1 + m), 2/(1 + m), 1/3], m -> Infinity], 50]


give me

2.5620696159886158802692865153466730071817954806353*10^-40
0


I assume that this happens because in the $$m \to \infty$$ limit the third argument of the $$_2F_1$$ is zero, so the function is better behaved in the case where I regularize it. But is there a way to tell Mathematica to always use the hypergeometric regularized $$_2F_1$$? My expression has several $$_2F_1$$ and in general if I do something of the kind

Hypergeometric2F1[1/(1 + m), -(11/10) + 1/(1 + m), -(1/10), 2/3] /. Hypergeometric2F1[a_, b_, c_, z_] -> Hypergeometric2F1Regularized[a, b, c, z] Gamma[c]


it simplifies the regularized $$_2F_1$$ and the gamma function and gives me back the thing I started from

Hypergeometric2F1[1/(1 + m), -(11/10) + 1/(1 + m), -(1/10), 2/3]


Thanks

• The result of Limit[Hypergeometric2F1[1/(1 + m), 11/10 + 1/(1 + m), 2/(1 + m), 1/3], m -> Infinity] 1 is accompanied by Beep: The Wolfram System beeped to let you know that a warning or error message was generated by the kernel. You can disable this beep by resetting MessageOptions in the Option Inspector. Jun 6, 2019 at 16:09

Let's call

f[m_] = Hypergeometric2F1[1/(1+m), 11/10 + 1/(1+m), 2/(1+m), 1/3];
Plot[f[m], {m, 1, 1000}]


The short version of what follows is that to compute the limit $$m\to\infty$$ correctly we can do

f[m] /. Hypergeometric2F1[a_, b_, c_, z_] :>
FullSimplify[1 +
Sum[Limit[Pochhammer[a,k]*Pochhammer[b,k]/Pochhammer[c,k]*z^k/k!, m -> ∞],
{k, 1, ∞}]]
(*    1/2 + 3/4*(3/2)^(1/10)    *)
% // N
(*    1.281034807994308    *)


It seems that when taking the limit $$m\to\infty$$, Mathematica takes the limits of the hypergeometric arguments and then inserts the results into Hypergeometric2F1:

Limit[f[m], m -> ∞]
(*    Limit::ztest message    *)
(*    1                       *)
Hypergeometric2F1[0, 11/10, 0, 1/3]
(*    1                       *)


The correct way of taking this limit is to look at the definition of the hypergeometric function,

u[k_,m_] = Pochhammer[1/(1+m),k]*Pochhammer[11/10+1/(1+m),k]*(1/3)^k/
(Pochhammer[2/(1+m),k]*k!);
f[m] == Sum[u[k,m], {k, 0, ∞}] // FullSimplify
(*    True    *)


Notice that $$k=0$$ is a bit of a special term in this sum and we need to treat it specially:

u[0, m] // FullSimplify
(*    1    *)


The remaining terms $$k\ge1$$ can be series-expanded around $$m=\infty$$:

Series[u[k, m], {m, ∞, 3}]
(*    lengthy output    *)


The lowest-order term will give the result in the limit $$m\to\infty$$:

1 + Sum[Limit[u[k, m], m -> ∞], {k, 1, ∞}] // FullSimplify
(*    1/2 + 3/4*(3/2)^(1/10)    *)
% // N
(*    1.281034807994308    *)


This is the correct limit $$\lim_{m\to\infty}f(m)=\frac12+\frac34\left(\frac32\right)^{\frac{1}{10}}$$, as you can see in the above plot.

For large but finite $$m$$ we can take the next-order term into account:

1 + Sum[Normal[Series[u[k, m], {m, ∞, 1}]], {k, 1, ∞}]
(*    lengthy output    *)
% // N // Expand
(*    1.28103 + (0.197065 + 0. I)/m    *)


This last result, $$f(m)\approx \frac12+\frac34\left(\frac32\right)^{\frac{1}{10}}+\frac{0.19706494389461254\ldots}{m}$$, is probably what you could be using for calculating the hypergeometric function $$f(m)$$ for very large values of $$m$$:

Plot[{f[m], 1/2 + 3/4 (3/2)^(1/10) + 0.19706494389461254/m}, {m, 1, 30}]


• Thanks for this treatment! Helped me find a typo in my answer. Jun 6, 2019 at 20:12
• Your answer is much better. Cheers! Jun 6, 2019 at 20:13

Note that your trouble happens with Hypergeometric2F1[1/(1 + m), 11/10 + 1/(1 + m), 2/(1 + m), 1/3] only because its lower parameter goes to zero. So to simplify, consider applying an identity that sets the third parameter to something finite in the limit.

In this case one of the upper parameters is half the third parameter, so that we can use this identity:

identity = { Hypergeometric2F1[a_, b_, c_, z_]/; c == 2 a -> Hypergeometric2F1[b/2, a - b/2, a + 1/2, z^2/(4 (z - 1))]/(1 - z)^(b/2) }


applying it to the function gives

Hypergeometric2F1[1/(1 + m), 11/10 + 1/(1 + m), 2/(1 + m), 1/3] /. identity


In this case this makes the limit trivial:

%/.m->Infinity


which numerically amounts to

% // N


1.28103

You might have to apply different identities to different troublesome hypergeometrics. Just explore the wolfram functions webpage, it has quite a few identities you can use.