# Is there a rapider or more elegant way to evaluate $\int_0^{+\infty} \frac{\cos(\pi x)\ \text{d}x}{e^{2\pi \sqrt{x}}-1}$?

$$\int_0^{+\infty} \frac{\cos(\pi x)\ \text{d}x}{e^{2\pi \sqrt{x}}-1}$$

First attempt

• $x\to t^2$

• Geometric series by writing the denominator as $e^{2\pi t}(1 - e^{-2\pi t})$

• $\cos(\pi t^2) = \Re e^{i\pi t^2}$

$$2\sum_{k = 0}^{+\infty} \int_0^{+\infty} t e^{i\pi t^2}e^{-\alpha t}\ \text{d}t$$

Where $\alpha = 2\pi (k+1)$.

Now I thought about writing it again as

$$-2\sum_{k = 0}^{+\infty}\frac{d}{d\alpha} \int_0^{+\infty} e^{i\pi t^2}e^{-\alpha t}\ \text{d}t$$

The last integral can be evaluated with the use of the Imaginary Error Function, hence a Special Function method.

Yet it doesn't seem me the best way.

Second Attempt

Basically like the previous one with the difference that

• $\cos( \cdot )$ stays as it;

• $\pi t^2 \to z$;

And this brings

$$-\frac{1}{\sqrt{\pi}}\frac{d}{d\alpha} \sum_{k = 0}^{+\infty}\int_0^{+\infty} \frac{\cos(z)}{z} e^{-\alpha \sqrt{\frac{z}{\pi}}}\ \text{d}z$$

But in both cases what I am thinking are just numerical methods. Or at least I could give a try with the stationary phase but... meh.

I don't know if I can use residues for this, actually. Even if taking a look at the initial integral, there is this additional way:

$$\frac{1}{e^{2\pi t} -1} = \frac{1}{(e^{\pi t}+1)(e^{\pi t}-1)}$$

Which for example has a pole at $t = +i$...

But using residues I would obtain

$$\pi \cos(\pi)$$

Where as the correct numerical result (which I checked with Mathematica) is

$$\color{blue}{0.0732233(...)}$$

And it seems there is not a closed form for this.

Any hint/help?

• I'm not sure I understand: have you found the value of the integral? $\pi \cos(\pi)=-\pi$, which is not the value. Before asking about "a more elegant method" wouldn't it be better to ask for any method that works, or indeed if this integral even has a closed form Apr 1, 2018 at 11:59
• @YuriyS I am perfectly aware on how to solve it with numerical methods that provide correct result. Hence why to waste time in asking for closed form? I found two ways to proceed without numerical analysis, yet they seem to be pretty tedious. The residues attempt is clearly wrong, according to W. M. hence the question clearly aims to get a method to solve it. It any, then I'll get satisfied with mine. Apr 1, 2018 at 12:04
• $\int_0^{\infty } \frac{\cos (\pi x)}{\exp \left(2 \pi \sqrt{x}\right)-1} \, dx=\frac{1}{4}-\frac{\sqrt{2}}{8}$ Apr 1, 2018 at 12:54
• I have two more: $\int_0^{\infty } \frac{\cos \left(\frac{\pi x}{2}\right)}{\exp \left(\frac{\pi \sqrt{x}}{2}\right)-1} \, dx=\frac{5}{4}-\frac{1}{4} \sqrt{4+2 \sqrt{2}}$ and $\int_0^{\infty } \frac{\cos (\pi x)}{\exp \left(\pi \sqrt{x}\right)-1} \, dx=\frac{3}{8}-\frac{\sqrt{2}}{8}$ Apr 1, 2018 at 13:13
• See Ramanujan's paper at ramanujan.sirinudi.org/Volumes/published/ram12.pdf Apr 4, 2018 at 7:59

$$\color{blue}{\int_0^\infty {\frac{{\cos (\pi x)}}{{{e^{2\pi \sqrt x }} - 1}}dx} = \frac{{2 - \sqrt 2 }}{8}}$$

Simple manipulation gives $$\int_0^\infty {\frac{{\cos (\pi x)}}{{{e^{2\pi \sqrt x }} - 1}}dx} = 2\int_0^\infty {\frac{{x\cos (\pi {x^2})}}{{{e^{2\pi x}} - 1}}dx} = \frac{1}{2} \int_0^\infty {\frac{{\sin (\pi {x^2})}}{{{{\sinh }^2}\pi x}}dx}$$ we evaluate the last integral.

Consider the function $$f(z) = \frac{{{e^{i\pi {z^2}}}{e^{2\pi z}}}}{{{{\sinh }^2}\pi z\sinh 2\pi z}}$$ note that $$f(z) - f(z + 2i) = 2\frac{{{e^{i\pi {z^2}}}}}{{{{\sinh }^2}\pi z}}$$

Integrate $f(z)$ around the rectangle with vertices $-R, R, R+2i, -R+2i$, with semicircle indentations at $0$ and $2i$. The indentation at $0$ is above the $x$-axis, while indentation at $2i$ is also above the line $\Im(z) = 2$, denote these two circles as $C_1$ and $C_2$ respectively, both with radius $r$.

Then $$\tag{1} 2\pi i \sum_{k=1}^4 \text{Res}[f(z),\frac{k}{2}i] = 2 \mathcal{P}\mathcal{V} \int_{ - \infty }^\infty {\frac{{{e^{i\pi {z^2}}}}}{{{{\sinh }^2}\pi z}}dz} + \int_{C_1} f(z) dz + \int_{C_2} f(z) dz$$

As $r\to 0$, \begin{aligned} \int_{C_1} f(z) dz + \int_{C_2} f(z) dz &= - \int_0^\pi {ri{e^{ix}}\left[ {f(r{e^{ix}}) - f(2i + r{e^{ix}})} \right]dx} \\ &= - \int_0^\pi {\frac{2}{{{\pi ^2}{r^2}{e^{2ix}}}}ri{e^{ix}}dx} + o(1) \\ &= - \frac{4}{{{\pi ^2}r}} + o(1) \end{aligned} where we used the expansion of $f(z)-f(z+2i)$ around $0$. Note the dominant term is real.

Thus $(1)$ becomes $$2\pi i\left( {\frac{1}{\pi } - \frac{1}{{\sqrt 2 \pi }} + \frac{i}{{\sqrt 2 \pi }}} \right) = 2\mathcal{P}\mathcal{V}\int_{ - \infty }^\infty {\frac{{{e^{i\pi {z^2}}}}}{{{{\sinh }^2}\pi z}}dz} - \frac{4}{{{\pi ^2}r}} + o(1)$$

Comparing imaginary part gives $$\int_0^\infty {\frac{{\sin (\pi {x^2})}}{{{{\sinh }^2}\pi x}}dx} = \frac{{2 - \sqrt 2 }}{4}$$

Denote $$I(a) = \int_0^\infty {\frac{{\cos (a\pi x)}}{{{e^{2\pi \sqrt x }} - 1}}dx}$$ then additional values include

\begin{aligned}I(2) &= \frac{1}{{16}} \\ I(3) &= \frac{1}{4} - \frac{{\sqrt 2 }}{{24}} - \frac{{\sqrt 6 }}{{18}} \\ I(\frac{1}{2}) &= \frac{1}{{4\pi }} \\ I(\frac{1}{3}) &= 1 - \frac{{3\sqrt 6 }}{8} \\ I(\frac{2}{3}) &= \frac{1}{3} - \frac{{3\sqrt 3 }}{{16}} + \frac{{\sqrt 3 }}{{8\pi }} \end{aligned}

In general, $I(r)$ for rational $r$ is algebraic over $\mathbb{Q}(\pi)$.

I just realized the question has been answered here, but that answer is not quite complete.

• A beautiful solution! Apr 1, 2018 at 14:36
• Stuff like this gives me motivation Apr 2, 2018 at 1:38