# Asymptotic expansion gives Euler-Mascheroni constant

Mathematica gives the following asymptotic expansion: $$\int_0^\Lambda \frac{1-\cos(qx)}{q} \mathrm{d}q \overset{\Lambda\to\infty}{\sim}\gamma+\log\left(x\Lambda\right) +\mathcal{O}\left(\frac{1}{x\Lambda}\right)$$ where $$\gamma\approx 0.577$$ is the Euler-Mascheroni constant. How can this expansion be obtained analytically? In particular, where does the $$\gamma$$ come from?

• Are you sure the integrand is that one and that we integrate wrt $q$? Also, have you tried using Taylor series? Commented Feb 16 at 13:33
• Yes, it is certainly wrt $q$. I don't think a Taylor expansion would be appropriate here as it would give a series in increasing powers of $x\Lambda$, which is large. Commented Feb 16 at 15:14

Let's denote $$\displaystyle I(R)=\int_0^R\frac{1-e^{i t}}tdt$$,
then the desired integral $$\displaystyle\int_0^\Lambda \frac{1-\cos(qx)}{q} \mathrm{d}q=\Re \,I(\Lambda x)$$
Integrating along the quarter-circle in the complex plane in the positive direction - adding a big arch of the radius $$R$$ (adding also a small quarter-circle around $$z=0$$ - to close the contour; integral along this small arch tends to zero) $$\oint\frac{1-e^{i z}}zdz=I(R)+\int_0^{\pi/2}\frac{1-e^{i R e^{i\phi}}}{Re^{i\phi}}iRe^{i\phi}d\phi+\int_R^0\frac{1-e^{-t}}tdt=0$$ as we do not have poles inside our contour. Denoting $$z=e^{i\phi}$$ in the second term, $$\Rightarrow\,\,I(R)=\int_0^R\frac{1-e^{-t}}tdt-\int_1^{e^{\pi i/2}}\frac{1-e^{iRz}}zdz$$ Integrating by parts, $$I(R)=\ln t(1-e^{-t})\bigg|_0^R-\int_0^Re^{-t}\ln tdt-\ln z\bigg|_1^i+\frac1{iR}\frac{e^{iRz}}z\bigg|_1^i+\frac1{iR}\int_1^i\frac{e^{iRz}}{z^2}dz$$ Dropping exponentially small terms, $$I(R)=\ln R-\int_0^\infty e^{-t}\ln tdt-\frac{\pi i}2-\frac{\sin R}R+O\Big(\frac1{R^2}\Big)$$ $$\boxed{\quad\Re\,\,I(R)=\ln R+\gamma-\frac{\sin R}R+O\Big(\frac1{R^2}\Big)\quad}$$
• Shouldn't it be $\Re\, I(\Lambda x)$ instead?