# How can I prove this limit converges to the Euler-Mascheroni constant?

I'm trying to prove that

$$\lim_{N\to\infty}\;2\left[ \int_0^N \frac{\text{erf}(x)}{x}\,dx - \ln(2N) \right] = \gamma,$$

where $$\gamma$$ is the Euler-Mascheroni constant.

This looks similar to the definition of $$\gamma$$,

$$\gamma\equiv \lim_{N\to\infty}\;\left[ \sum_{k=1}^N \frac{1}{k} - \ln N \right] ,$$

so maybe there's a clean proof that manipulates the limit in the first expression into the second limit? I'd prefer proofs that don't involve hypergeometric series as I'm not familiar with them.

• Remark: Mathematica can evaluate this limit to indeed equal $\gamma$. – Greg Martin Jun 6 at 7:42
• Second remark: integrating by parts shows that it suffices to prove $$-\frac1{\sqrt\pi} \int_0^\infty \frac{\log x}{e^{x^2}} = \frac\gamma4+\frac{\log2}2.$$ – Greg Martin Jun 6 at 7:51

I figured it out thanks to the hint and some further research. The only "extra" result I need is

$$\frac{\Gamma'(z)}{\Gamma(z)}=-\frac{1}{z}-\gamma+z\sum_{k=1}^\infty \frac{1}{k}\cdot\frac{1}{z+k},$$

which is fine with me because Gamelin proves it in Ch. 14 of Complex Analysis.

Starting from my original expression,

$$\lim_{N\to\infty}\;2\left[ \int_0^N \frac{\text{erf}(x)}{x}\,dx - \ln(2N) \right] = \gamma,$$

integrate by parts (set $$u=\text{erf}(x)$$, $$dv = dx/x$$), giving

\begin{align} \\ &= \lim_{N\to\infty}\;2\left[ \ln x\cdot\text{erf}(x)\Big|_0^N - \frac{2}{\sqrt{\pi}}\int_0^N \ln x\cdot e^{-x^2}\,dx - \ln N - \ln 2 \right] \\ \\ \\ &= \lim_{N\to\infty}\;2\left[ - \frac{2}{\sqrt{\pi}}\int_0^N \ln x\cdot e^{-x^2}\,dx - \ln 2 \right] \\ \\ \\ &= -2\left[ \frac{2}{\sqrt{\pi}}\int_0^\infty \ln x\cdot e^{-x^2}\,dx - \ln 2 \right] \\ \\ \end{align}

Now substitute $$t=u^2$$ to give:

\begin{align} \\ &= -2\left[ \frac{2}{\sqrt{\pi}} \cdot \frac{1}{4} \int_0^\infty \ln t \cdot t^{-1/2 }e^{-t}\,dt - \ln 2 \right] \\ \\ \\ &= -\frac{1}{\sqrt{\pi}} \int_0^\infty \ln t \cdot t^{-1/2 }e^{-t}\,dt + 2 \ln 2 \\ \\ \\ &= -\frac{1}{\sqrt{\pi}} \frac{d}{dx} \left( \int_0^\infty t^{x-1}e^{-t}\,dt \right) \Bigg|_{x=1/2} + 2 \ln 2 \\ \\ \\ &= -\frac{1}{\sqrt{\pi}} \Gamma'\left(\frac{1}{2}\right) + 2 \ln 2 \\ \\ \end{align}

Now using the result quoted from Gamelin above, we have

\begin{align} \\ &= -\frac{1}{\sqrt{\pi}} \Gamma\left(\frac{1}{2}\right) \left[ -2-\gamma + \sum_{k=1}^\infty \frac{1}{k}\cdot\frac{1}{2k+1} \right] + 2 \ln 2 \\ \\ \\ &= 2 + \gamma - \left[ \sum_{k=1}^\infty \frac{1}{k}\cdot\frac{1}{2k+1} \right] - 2 \ln 2 \\ \\ \\ &= \gamma \end{align}

If anyone has a simpler proof, please share.

Appendix:

The sum was harder to evaluate than I expected. Maybe there's a simpler way, but here what I did:

\begin{align} \sum_{k=1}^\infty \frac{1}{k}\cdot\frac{1}{2k+1} &= \sum_{k=1}^\infty \left( \frac{1}{k} - \frac{2}{2k+1} \right) \\ \\ \\ &= 1 - \sum_{k=1}^\infty \left(\frac{2}{2k+1} - \frac{1}{k+1} \right) \\ \\ \\ &= 1 - 2 \sum_{k=1}^\infty \left(\frac{1}{2k+1} - \frac{1}{2k+2} \right) \\ \\ \\ &= 1 - 2 \sum_{k=3}^\infty \frac{(-1)^{k+1}}{k} \\ \\ \\ &= 1 +2\left( 1 - \frac{1}{2} \right) - 2 \sum_{k=1}^\infty \frac{(-1)^{k+1}}{k} \\ \\ \\ &= 2 - 2 \ln 2 \end{align}