# Integral $\int_0^\infty\frac{\cos(\pi x^2)}{\cosh (\pi x)(\cosh (4\pi)-\cos(4\pi x))}dx$

I encountered the integral $$\int_0^\infty\frac{\cos(\pi x^2)}{\cosh (\pi x)(\cosh (4\pi)-\cos(4\pi x))}dx=\frac{1}{\sinh (4\pi)}\left(\frac{\coth(\pi)}{\sqrt{2}}-\frac{1+\sqrt{2}}{16\,\pi\sqrt{\pi }}\Gamma^2\left(\frac{1}{4}\right)\right)$$

The value is checked in high precision via CAS.

Some posts on the site considered integrals of similar forms, e.g.

Does $\int_{0}^{\infty}{\sin{(\pi{x^2})}\over \sinh{(\pi{x}})\tanh(x\pi)}\mathrm{d}x$ have a simple closed from?

tough integral involving $\sin(x^2)$ and $\sinh^2 (x)$

integral $\int_{0}^{\infty}\frac{\cos(\pi x^{2})}{1+2\cosh(\frac{2\pi}{\sqrt{3}}x)}dx=\frac{\sqrt{2}-\sqrt{6}+2}{8}$

I thought of integrating on contours similar to those above, so I tried functions like $$\frac{e^{i \pi z^2}}{\cosh (\pi z) (1-e^{i\pi z})}$$ and integrated them on rectangular contours. However, all attempts failed. I was more convinced that contour integration cannot directly find the answer because of the $$\Gamma^2\left(\dfrac{1}{4}\right)$$ term. That made me think that the integral somehow relates to elliptic functions. After all my effort, I could not work out the result on my own.

How can we evaluate the integral? Maybe some really clever contour integration, or applying special functions formulas?

Any help would be appreciated.

• Just a thought but the answer seems oddly close to: $$\frac{1}{\sqrt{2}}\frac{1}{e^{4 \pi}+e^{-4 \pi}}$$ Commented Apr 5, 2023 at 20:33

Notations:

$$K(k)=\displaystyle\int_0^1\frac{d\phi}{\sqrt{1-k^2\sin^2\phi}}$$ is a complete elliptic integral of the first kind

$$K'(k)=K(\sqrt{1-k^2})$$

$$k_r$$ is the modulus of a singular value, specifically, the solution to $$\dfrac{K'(k_r)}{K(k_r)} =\sqrt r$$

It turns out that the integral is both related to contour integration and elliptic functions (at least for my approach), which is quite interesting for me.

Generalization holds for $$n$$ a positive integer, $$I_n=\int_{0}^{\infty}\frac{\cos(\pi x^2)}{\cosh (\pi x)\big(\cosh (n\pi)-\cos(n\pi x)\big)}dx\\ =\begin{cases} \displaystyle \frac{1}{\sqrt{2} \sinh (n\pi)}\left(\coth\left(\frac\pi4n\right)-{\color{red}{\frac1\pi K(k_{n^2/4})}}\right) & n\text{ even}\\[7pt] \displaystyle \frac{1}{\sqrt{2} \sinh (n\pi)}\left(\frac{\cosh(\pi n/2)+2}{\sinh (\pi n/2)}-{\color{red}{\frac{2k_{n^2}+1}{\pi }K(k_{n^2})}}\right) & n\text{ odd} \end{cases}$$ Utilizing the singular values that are well known in literature (e.g. in the MathWorld site linked above) one can tabulate values for small $$n$$ as follows $$\begin{gathered} I_1=\frac{1}{\sqrt{2} \sinh (\pi )} \left(\frac{2+\cosh \left(\frac{\pi }{2}\right)}{\sinh \left(\frac{\pi }{2}\right)}-(\sqrt{2}+1)\kappa\right)\\ I_2=\frac{1}{\sqrt{2} \sinh (2 \pi )} \left(\coth \left(\frac{\pi }{2}\right)-\kappa\right)\\ I_3=\frac{1}{\sqrt{2} \sinh (3 \pi )} \left(\frac{2+\cosh \left(\frac{3 \pi }{2}\right)}{\sinh \left(\frac{3 \pi }{2}\right)}-\frac{\sqrt[4]{3}}{3\sqrt{2}} \left(2 \sqrt{2}-2 \sqrt[4]{3}+\sqrt{3}+1\right)\kappa \right)\\ I_4=\frac{1}{\sqrt{2} \sinh (4 \pi )} \left(\coth (\pi )-\frac{\sqrt{2}+2}{4}\kappa \right)\\ I_5=\frac{1}{\sqrt{2} \sinh (5 \pi )} \left(\frac{2+\cosh \left(\frac{5 \pi }{2}\right)}{\sinh \left(\frac{5 \pi }{2}\right)}-\frac{1}{5} \left(2-2 \sqrt[4]{5} \sqrt{2}+3 \sqrt{2}+\sqrt{5}\right) \kappa \right)\\ I_6=\frac{1}{\sqrt{2} \sinh (6 \pi )} \left(\coth \left(\frac{3 \pi }{2}\right)-\frac{\sqrt{2 \sqrt{3}+3}}{3}\kappa\right) \end{gathered}$$ Here $$\kappa=\frac1{4\pi^{3/2}}\Gamma^2 \left(\frac{1}{4}\right)$$ It is worth noticing that the red part of both cases are always an algebraic multiple of $$\kappa$$, a consequence of $$\mathbb Q(\sqrt{-n^2})=\mathbb Q(\sqrt{-1})$$. Appreciate help from @pisco on this point.

The following is a proof.

Take the real part of the trivial expansion $$\frac1{1-e^{-t+ix}}=\sum_{r\ge0}e^{-rt}e^{irx}$$ to get $$\frac{\sinh t}{\cosh t-\cos x}=1+2\sum_{r\ge1}e^{-rt}\cos(rx)$$ Now plug in $$t=n\pi,x\to n\pi x$$ and return to $$I_n$$ $$\sinh(n\pi)I_n=\int_{0}^{\infty}\frac{\cos(\pi x^2)}{\cosh (\pi x)}dx+2\sum_{r\ge1}\int_{0}^{\infty}\frac{\cos(\pi x^2)\cos(n\pi rx)}{\cosh (\pi x)}dx$$ It suffice to find the Fourier transform of $$\dfrac{\cos(\pi x^2)}{\cosh (\pi x)}$$.

Integrate on the rectangular contour while $$R\to \infty$$ $$f(z)=\frac{\exp(i\pi z^2+iwz)}{\cosh (\pi z)\sinh(2\pi z+w)}\\[5pt] C: -R-i\to R-i\to R+i\to -R+i \to -R-i$$ The integrand has 3 polse in and 2 on $$C$$ (small semi circle pertubation is used to avoid them) and the residue theorem states $$\int_{-\infty}^{\infty}f(x-i)-f(x+i)dx=4\int_{0}^{\infty}\frac{\exp(i\pi x^2+wx)}{\cosh (\pi x)}dx\\ =2\pi i \text{Res}\left[f(z),i\frac\pi2;-i\frac\pi2;-w\right]+\pi i \text{Res}\left[f(z),i-\frac w{2\pi};-i-\frac w{2\pi}\right]$$ That is $$\int_{0}^{\infty}\frac{\exp(i\pi x^2+wx)}{\cosh (\pi x)}dx=\left(e^{-i\pi/4}+i \exp\left(-\frac{i w^2}{4 \pi }\right)\right) \text{sech}\left(\frac{w}{2}\right)$$ We only need the real part. Substitute $$w=nr\pi$$ so that $$\int_{0}^{\infty}\frac{\cos(\pi x^2)\cos(n\pi rx)}{\cosh (\pi x)}dx=\frac{\sqrt{2}}{4} \left(\sqrt{2} \sin \left(\frac{n^2\pi}{4}r^2\right)+1\right) \text{sech}\left(\frac{n\pi }{2}r\right)\\ \int_{0}^{\infty}\frac{\cos(\pi x^2)}{\cosh (\pi x)}dx=\frac{\sqrt{2}}{4}$$ Then $$I_n=\frac{\sqrt2}{4\sinh(n\pi)}\left(1+2\sum_{r\ge1}e^{-nr\pi}\text{sech}\left(\frac{n\pi }{2}r\right)\left(\delta(n,r)+1\right) \right)$$ where $$\delta(n,r):=\sqrt{2} \sin \left(\frac{\pi n^2}{4} r^2\right)=\cases{ 1 & \text{n and r odd}\\[5pt] 0 & \text{otherwise} }$$ For even $$n$$ s, all $$\delta(n,r)$$ vanish so $$I_n=\frac{\sqrt2}{4\sinh(n\pi)}\left(1+4\sum_{r\ge1}\frac{e^{-rn\pi}}{e^{rn\pi/2}+e^{-rn\pi/2}}\right)$$ Let $$q=e^{-n\pi/2}$$ be the nome, and the remaining series turns into $$\sum_{r\ge1}\frac{q^{-2r}}{q^r+q^{-r}}=\sum_{r\ge1}q^r-\frac1{q^r+q^{-r}}=\frac1{e^{n\pi/2}-1}-\sum_{r\ge1}\frac1{q^r+q^{-r}}$$ to evaluate the last sum, utilize the Fourier series of $$\text{dn}(2Kv,k)=\frac{\pi}{2K}+\frac{2\pi}{K}\sum_{r\ge1}\frac{\cos(2r\pi v)}{q^r+q^{-r}}$$ Here $$k$$ is the modulus corresponding to $$q$$, satisfying $$\frac{K'(k)}{K(k)}=\frac n2$$ According to the definition of singular value, it is actually $$k_{(n/2)^2}$$ (remember $$n/2$$ is an integer). Related theorems state that it is an algebraic number and $$K(k_{n^2/4})$$ can be expressed in terms of Gamma functions.

Plug in $$v=0$$, note that $$\text{dn}(0,k)=1$$ to get $$\sum_{r\ge1}\frac1{q^r+q^{-r}}=\frac{K(k_{n^2/4})}{2\pi}-\frac14$$ Finally put everything together proving the even case $$I_{n}=\frac{1}{\sqrt{2} \sinh (n\pi)}\left(\coth\left(\frac\pi4n\right)-\frac1\pi K(k_{n^2/4})\right)$$

As for the odd $$n$$, under the notation of Iverson brackets it holds $$1+\delta(n,r)=1+[2\nmid r]=2[2\nmid r]+[2\mid r]$$, so $$I_n=\frac{\sqrt2}{4\sinh(n\pi)}\left(1+2\sum_{r\ge1}e^{-nr\pi}\text{sech}\left(\frac{n\pi }{2}r\right)\left(2[2\nmid r]+[2\mid r]\right) \right)$$ Let $$q=e^{-n\pi}$$ be the nome, then $$\sum_{r\ge1}e^{-nr\pi}\text{sech}\left(\frac{n\pi }{2}r\right)[2\mid r]=2\sum_{l\ge1}\frac{q^{2l}}{q^l+q^{-l}}\\ =2\sum_{r\ge1}q^l-\frac1{q^l+q^{-l}}=\frac2{e^{n\pi}-1}+\frac12-\frac{K(k_{n^2})}{\pi}$$ where the last sum is calculated above. $$\sum_{r\ge1}e^{-nr\pi}\text{sech}\left(\frac{n\pi }{2}r\right)[2\nmid r]=2\sum_{l\ge1}\frac{q^{2l-1}}{q^{l-1/2}+q^{-l+1/2}} \\ =2\sum_{l\ge1}q^{l-1/2}-2\sum_{l\ge1}\frac{1}{q^{l-1/2}+q^{-l+1/2}}$$ Similarly, utilize the Fourier series $$\text{cn}(2Kv,k)=\frac{2\pi}{kK}\sum_{l\ge1}\frac{\cos((2l-1)\pi v)}{q^{l-1/2}+q^{-l+1/2}}$$ Again, $$k$$ is $$k_{n^2}$$ and $$K$$ is $$K(k_{n^2})$$. Plug in $$v=0$$, note that $$\text{cn}(0,k)=1$$ to get $$\sum_{l\ge1}\frac{1}{q^{l-1/2}+q^{-l+1/2}}=\frac{k_{n^2}K(k_{n^2})}{2\pi}$$ so $$\sum_{r\ge1}e^{-nr\pi}\text{sech}\left(\frac{n\pi }{2}r\right)[2\nmid r]= \text{csch}\left(\frac{\pi }{2}n\right)-\frac{k_{n^2}K(k_{n^2})}{\pi}$$ Put everything together and the odd case is proved $$I_n=\frac{1}{\sqrt{2} \sinh (n\pi)}\left(\frac{\cosh(\pi n/2)+2}{\sinh (\pi n/2)}-\frac{2k_{n^2}+1}{\pi }K(k_{n^2})\right)$$

In summary, the integral is all about summing up a Fourier transform. One can generate all sorts of similar integrals by finding Fourier transforms of similar functions and using elliptic function identities to find closed form results, as long as they exist.

As an example of minor complexity, the "coupling integral" of the OP's is $$\int_{0}^{\infty}\frac{\sin(\pi x^2)}{\cosh (\pi x)\big(\cosh (4\pi)-\cos(4\pi x)\big)}dx=(\sqrt2-1)I_4=\frac{1}{\sinh (4 \pi )} \left(\left(1-\frac1{\sqrt{2}}\right)\coth (\pi )-\frac{\kappa}4 \right)$$