Recently I was reading Bruce Berndt and George Andrews' book "Ramanujan's lost notebook". Ramanujan showed how to calculate integrals of the form $ \int_0^\infty \frac{\cos(\pi wx^2)}{\cosh(\pi x)}dx $ when $w\in\mathbb Q$. Inspired by Ramanujan's work I decided to try to compute numerically various similar looking integrals and by coincidence it turned out that $ \int_0^\infty \frac{\cos(2\pi x^2)}{\cosh^2(\pi x)}dx=0.250000000000000000... $ It looks like this integral is $\frac 14$, but I have no clue how to prove it.

Question: How to prove that $$ \int_0^\infty \frac{\cos(2\pi x^2)}{\cosh^2(\pi x)}dx=\frac 14 ?$$

  • $\begingroup$ out of interest, how did Ramanujan calculats this original integrals? $\endgroup$
    – tired
    Oct 27, 2016 at 21:53
  • $\begingroup$ @tired Ramanujan's paper where he calculates his integrals google.ru/… $\endgroup$
    – Tyrell
    Oct 27, 2016 at 22:04
  • $\begingroup$ thats a cool paper thx! $\endgroup$
    – tired
    Oct 27, 2016 at 22:09
  • $\begingroup$ thx for the bounty! :) $\endgroup$
    – tired
    Dec 3, 2016 at 0:39

1 Answer 1


I'm busy today so some arguments have to be more rigorous

Denote the integral in question by $I$ (which by symmetry can be extended to the whole real line)

$$ I=\int_{0}^{\infty}\frac{\cos(2\pi x^2)}{\cosh^2(\pi x)} $$

Now consider the complex valued function

$$ f(z)=\frac{e^{i 2 \pi z^2}}{\sinh(4 \pi z)\cosh(\pi z)^2} $$

then $$f(x\pm i)=\frac{ e^{i 2 \pi x^2\mp 4 \pi x}}{\sinh(4 \pi z)\cosh(\pi z)^2}$$

Furthermore integrating $f(z)$ around a rectangle $(-i -\infty,i -\infty,i +\infty,-i +\infty)$ in counterclockwise direction yields

$$ \oint_C f(z)=\int_{\mathbb{R}}f(x+i)-\int_{\mathbb{R}}f(x-i)=2\pi i \sum\text{Res}(f(z),z\in C ) $$

but $\int_{\mathbb{R}}f(x+i)-f(x-i)=2 \int_{\mathbb{R}}\frac{e^{i 2 \pi x^2}}{\cosh(\pi x)^2}$.

The real part of this integral is just four times the integral we are looking for, $I$.

$$ 4 I=2\Re \int_{\mathbb{R}}\frac{e^{i 2 \pi x^2}}{\cosh(\pi x)^2}=\Re\left[2 i\pi \sum_{\sigma=\pm}\text{Res}(f(z),z=\sigma\frac{i}{2})\right] $$

since it turns out that only the residues at $z=\pm \frac{i}{2}$ a) have finite imaginary part and b) don't cancel so they are the only contributions to the real part of the above expression, given by $\text{Res}(f(z)=z=\pm \frac{i}{2})=-\frac{2+i \pi}{4\pi^2}$.

Putting everything together we obtain

$$ I=\frac{1}{4}\Re\left[-2 \pi i \left(\frac{2+i\pi}{4 \pi^2}+\frac{2+i\pi}{4 \pi^2}\right)\right]=\frac{1}{4} $$


Note that with some more (straightforward) work, also the integral with $\sin(2\pi x^2)$ in the numerator can be extracted from the above calculation by taking imaginary parts.

$$ \int_{0}^{\infty}\frac{\sin(2\pi x^2)}{\cosh^2(\pi x)}=\frac{1}{4}-\frac{1}{2\pi} $$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.