6

In an earlier question, the integral $$I_n(c)=\int_0^\infty x^n (1+x)^n e^{-n c x^2} dx$$ was considered with particular focus on its behavior for positive integer $n$. In trying to analyze this, it appears that Mathematica runs into issues in taking certain limits. At risk of being a CAS-centric question, I will dispense with the original integral and instead focus on a specific example arising from it (namely, that of $n=c=1$).

After extensive offline manipulation, the discrepancy arises as follows. Let $$f(\epsilon )={_2}F_2 \left(\begin{array}{c}1/2,-\epsilon/2\\ 3/2,-\epsilon \end{array}\Bigg{\vert} -1\right)+\frac16~ {_2}F_2 \left(\begin{array}{c}3/2,1+\epsilon/2\\ 5/2,2+\epsilon \end{array}\Bigg{\vert} -1\right)$$ (Here I've let $\epsilon=n-1$, so as to focus on a zero limit.) Empirically (i.e., having Mathematica compute for $\epsilon \approx 0$) it appears that $f(0)\to 1$ as $\epsilon \to 0$. This is also consistent with the original integral, which can be computed by elementary means in the case of $n=1$ (though verifying $f(0)=1$ by this route requires the extensive manipulations alluded to earlier).

However, if Mathematica directly evaluates $f(0)$ it instead obtains

$$f(0)\underset{?}{=}\frac{3}{2}-\frac{\sqrt{\pi}}{4}\operatorname{erf}(1)\approx 1.12659$$ where $\text{erf}(x)$ is the error function. So for some reason Mathematica behaves as though $f(\epsilon)$ is well-defined but discontinuous at $\epsilon=0$. What I haven't been able to suss out is if this is a software issue or something more substantive. The limit is not entirely trivial, since when $\epsilon \to 0$ the hypergeometric function picks up integer parameters which can introduce complications.

So what I'm looking for is a direct proof that $f(0)=1$, and hopefully some means of clarifying Mathematica's error.

Semiclassical
  • 18,592
  • 1
    Thanks for asking about this phenomenon---I was puzzled by this behavior myself. Maple produces the same issues. – Travis Willse Jun 13 '24 at 01:50
  • 1
    @TravisWillse Yeah, your answer was the main motivation for me to try to track this down. (I imagine the coaxing you had to do for Maple was similar to what I had to insert for Mathematica to give an answer.) – Semiclassical Jun 13 '24 at 01:52
  • Fixed another critical sign error: there should not have been a minus in front of the second hypergeometric function. – Semiclassical Jun 13 '24 at 13:40
  • Sorry if I misunderstood something, but it seems that WolframAlpha says $\displaystyle\lim_{\epsilon\to 0}f(\epsilon)\color{red}{\not=}1$ since $$f(10^{-5})\approx 0.87341224+\frac 16\times 0.999998657981$$ $$f(10^{-10})\approx 0.87341207+\frac 16\times 0.999999999987$$ – mathlove Jun 18 '24 at 16:01
  • I went back through my Mathematica work offline and confirmed: I had another transcription error in the second hypergeometric function. (Should have been $1+\epsilon/2$ not $\epsilon/2$.) It's fixed now and does produce the correct behavior @mathlove – Semiclassical Jun 18 '24 at 23:16

2 Answers2

1

Here is some partial progress which I decided to hive off from the question itself. We use the series definition of the generalized hypergeometric function to write the first term as

$${_2}F_2 \left(\begin{array}{c}1/2,-\epsilon/2\\ 3/2,-\epsilon \end{array}\Bigg{\vert} -1\right)=\sum_{k=0}^\infty \frac{ (1/2)_k} {(3/2)_k}\frac{(-\epsilon/2)_k}{(-\epsilon)_k}\frac{(-1)^k}{k!}$$ where $(a)_k$ is the Pochhammer symbol. The first ratio can be simplified to $1/(2k+1)$ without issue, but the second ratio is problematic. If we naively take $\epsilon=0$, then Mathematica compute it to be identically equal to $1$. If we instead first fix some particular integer $k$, Mathematica now concludes that the ratio converges to $1/2$ as $\epsilon\to 0$. Yet even this is likely too naive: If I hold $\epsilon>0$ fixed and take $k\to\infty$, then the ratio diverges. Similarly, the second term can be written as

\begin{align} \frac16 {_2}F_2 \left(\begin{array}{c}3/2,1+\epsilon/2\\ 5/2,2+\epsilon \end{array}\Bigg{\vert} -1\right) &=\frac16 \sum_{k=0}^\infty \frac{ (3/2)_k} {(5/2)_k}\frac{(1+\epsilon/2)_k}{(2+\epsilon)_k}\frac{(-1)^k}{k!}\\ &=\sum_{k=0}^\infty \frac{ 1} {6+4k}\frac{(1+\epsilon/2)_k}{(2+\epsilon)_k}\frac{(-1)^k}{k!} \end{align}

and thus the second ratio is again problematic. The issue thus likely seems to be that of order of limits: one should hold $\epsilon\neq 0$ fixed, sum $k=1$ to $\infty$, and only then take $\epsilon\to 0$. (But this is not the same as a proof!)

Finally, let $$S_n(\epsilon)=\sum_{k=0}^{n-1}\left[\frac{1} {2k+1}\frac{(-\epsilon/2)_k}{(-\epsilon)_k}+\frac{ 1} {6+4k}\frac{(1+\epsilon/2)_k}{(2+\epsilon)_k}\right]\frac{(-1)^k}{k!},$$ i.e., the $n$th combined partial sum of the two hypergeometric series. Based on Mathematica, I conjecture that $$\lim_{\epsilon\to 0} S_n(\epsilon)=1-\frac12 \frac{(-1)^n}{(2n+1)n!}$$ which would seem enough to establish $f(0)=1$. (I use weasel words here because I'm paranoid about order of limits.) Curiously, the sequence $\{(2n+1)n!\}_{n=0}^\infty$ is already extent on OEIS as A007680. The principal reference is its role in the series expansion of the error function:

$$\operatorname{erf}(x)=\frac{2}{\sqrt{\pi}}\sum_{k=0}^\infty \frac{(-1)^k x^{2k+1}}{(2k+1)k!}$$ Given the earlier appearance of the error function, it seems unlikely that this could be coincidental. But I can't immediately see how the two appearances are related. (Also recall the well-known fact that, while the above series for the error function does converge, it does so quite slowly: One has to go out until $k>x^2-2$ before the series satisfies the conditions of the alternating series test. This seems of a kind with the sensitivity to limit ordering displayed thus far.)


I think I've resolved the Mathematica issue to my satisfaction. First, playing around with Mathematica further the limit $\epsilon\to 0$ is not actually problematic for the second hypergeometric function. Hence we use Mathematica to obtain to $$\sum_{k=0}^\infty \frac{ 1} {6+4k}\frac{(1)_k}{(2)_k}\frac{(-1)^k}{k!}=\frac12-\frac{\sqrt{\pi}}{4}\operatorname{erf}(1) $$

This leaves the first term. If we take $\epsilon\to 0$ immediately, the ratio of Pochammer symbols evaluates to $1$ and the hypergeometric series becomes

$$\sum_{k=0}^\infty \frac{1} {2k+1}\frac{(-1)^k}{k!}=\frac{\sqrt{\pi}}{2}\operatorname{erf}(1)$$

If we first take $k=0$, then $(a)_0=1$ and the ratio is again 1. But for any other integer, we have

$$\frac{(-\epsilon/2)_k}{(-\epsilon)_k}=\frac{-\epsilon/2}{-\epsilon}\frac{1-\epsilon/2}{1-\epsilon}\cdots \frac{n-1-\epsilon/2}{n-1-\epsilon}$$ In the limit $\epsilon\to 0$, every factor cancels aside from the first. Hence $\frac{(-\epsilon/2)_k}{(-\epsilon)_k}\to 1/2$ if $k$ is a positive integer. Therefore, the correct summation is

$$1+\sum_{k=1}^\infty \frac{1} {2(2k+1)}\frac{(-1)^k}{k!}=\frac12 + \frac{\sqrt{\pi}}{4}\operatorname{erf}(1)$$

This error function is then able to cancel that from the second term, leaving a total of $1/2+1/2$. Expressed as a single summation, we have

$$\sum_{k=0}^\infty\left[\frac{1}{2k+1}+\frac{1}{(2k+3)(k+1)}\right]\frac{(-1)^k}{k!}=1$$ which Mathematica validates. Indeed, we seem to have more generally

$$\sum_{k=0}^{n-1}\left[\frac{1}{2k+1}+\frac{1}{(2k+3)(k+1)}\right]\frac{(-1)^k}{k!}=1-\frac{1}{(2n+1)n!}$$ for the $n$th partial sum. This form suggests the series can be made telescopic but I don't immediately see it.

Semiclassical
  • 18,592
1

I think what you have done is very nice.

For the first term, I think the following way should also work (the following way might be almost the same as yours, though) :

We may suppose that $0\lt\epsilon\lt 1$.

We can write $$\begin{align}&{_2}F_2 \left(\begin{array}{c}1/2,-\epsilon/2\\ 3/2,-\epsilon \end{array}\Bigg{\vert} -1\right) \\\\&=\sum_{k=0}^\infty \frac{ (1/2)_k} {(3/2)_k}\frac{(-\epsilon/2)_k}{(-\epsilon)_k}\frac{(-1)^k}{k!} \\\\&=1+\sum_{k=1}^\infty \frac{ (1/2)_k} {(3/2)_k}\frac{-\epsilon/2}{-\epsilon}\frac{(-\epsilon/2+1)_{k-1}}{(-\epsilon+1)_{k-1}}\frac{(-1)^k}{k!} \\\\&=1+\sum_{k=1}^\infty \frac{ (1/2)_k} {(3/2)_k}\frac 12\frac{(-\epsilon/2+1)_{k-1}}{(-\epsilon+1)_{k-1}}\frac{(-1)^k}{k!}\end{align}$$

Since the limit $\epsilon\to 0$ is not problematic here, we have $$\begin{align}&\lim_{\epsilon\to 0}{_2}F_2 \left(\begin{array}{c}1/2,-\epsilon/2\\ 3/2,-\epsilon \end{array}\Bigg{\vert} -1\right) \\\\&=1+\sum_{k=1}^\infty \frac{ (1/2)_k} {(3/2)_k}\frac 12\frac{(1)_{k-1}}{(1)_{k-1}}\frac{(-1)^k}{k!} \\\\&=1+\sum_{k=1}^\infty \frac{(-1)^k} {2(2k+1)\cdot k!} \\\\&=\frac12 + \frac{\sqrt{\pi}}{4}\operatorname{erf}(1)\end{align}$$


Indeed, we seem to have more generally $$\sum_{k=0}^{n-1}\left[\frac{1}{2k+1}+\frac{1}{(2k+3)(k+1)}\right]\frac{(-1)^k}{k!}=1-\frac{1}{(2n+1)n!}$$ for the $n$th partial sum. This form suggests the series can be made telescopic but I don't immediately see it.

Yes, we can get it using the idea of telescopic sum as follows :

Letting $F(k)=\dfrac{(-1)^{k}}{(2k+1)k!}$, we have $$\begin{align}&\sum_{k=0}^{n-1}\left(\frac{1}{2k+1}+\frac{1}{(2k+3)(k+1)}\right)\frac{(-1)^k}{k!} \\\\&=\sum_{k=0}^{n-1}\left(\frac{(-1)^k}{(2k+1)k!}\color{red}-\frac{(-1)^{k+1}}{(2k+3)(k+1)!}\right) \\\\&=\sum_{k=0}^{n-1}\left(F(k)-F(k+1)\right) \\\\&=F(0)-F(n) \\\\&=1-\dfrac{(-1)^{n}}{(2n+1)n!}\end{align}$$


Added :

I'm going to write what WolframAlpha (wrongly or correctly) says.

(1) WolframAlpha says $$\lim_{\epsilon\to 0}{_2}F_2 \left(\begin{array}{c}1/2,-\epsilon/2\\ 3/2,-\epsilon\end{array}\Bigg{\vert} -1\right)\underset{?}{=}1$$

(2) WolframAlpha says $$\lim_{\epsilon\to 0}\sum_{k=0}^\infty \frac{ (1/2)_k} {(3/2)_k}\frac{(-\epsilon/2)_k}{(-\epsilon)_k}\frac{(-1)^k}{k!}\underset{?}{=}1$$

(3) WolframAlpha says $$\sum_{k=0}^{\infty}\bigg(\lim_{\epsilon\to 0}\frac{ (1/2)_k} {(3/2)_k}\frac{(-\epsilon/2)_k}{(-\epsilon)_k}\frac{(-1)^k}{k!}\bigg)\underset{?}{=}\frac 14\sqrt\pi\operatorname{erf}(1)$$

(4) WolframAlpha says $$\lim_{\epsilon\to 0}\sum_{k=\color{red}1}^\infty \frac{ (1/2)_k} {(3/2)_k}\frac{(-\epsilon/2)_k}{(-\epsilon)_k}\frac{(-1)^k}{k!}\rightarrow\text{insufficient time to determine limit}$$

(5) WolframAlpha says $$\sum_{k=\color{red}1}^{\infty}\bigg(\lim_{\epsilon\to 0}\frac{ (1/2)_k} {(3/2)_k}\frac{(-\epsilon/2)_k}{(-\epsilon)_k}\frac{(-1)^k}{k!}\bigg)=-\frac 12+\frac 14\sqrt\pi\operatorname{erf}(1)$$


Comments :

It might be difficult for WolframAlpha to determine if the following is OK.

$$\lim_{\epsilon\to 0}\sum_{k=1}^{\infty}g_k(\epsilon)=\sum_{k=1}^{\infty}\lim_{\epsilon\to 0}g_k(\epsilon)$$

mathlove
  • 151,597