# An integral identity from Ramanujan's notebooks

Browsing through Ramanujan's notebooks, I found the following identity, without proof of course (Notebook 1, p. 130):

In other words (took me a while to realize that the lower integration bound is zero, not one):

Let $a \in (0,\pi)$. Then

$$\int_0^\infty \frac{e^{ax}-e^{-ax}}{e^{\pi x}-e^{-\pi x}} \frac{dx}{1+n^2 x^2} \quad = \quad \sum_{k=1}^\infty (-1)^{k+1} \frac{\sin(ka)}{1+kn}$$

which is pretty amazing if it is true.

Sure enough, the identity checks out numerically for several values of $a$ and $n$. My question, then, is how to prove that the identity is actually correct.

• IMO it is false or where is my mistake? For $a=\pi$ the RHS is zero but the LHS is $\frac{\pi}{2|n|}$ Sep 2, 2015 at 12:16
• The right hand side is a Fourier-series of the left hand side on $[-\pi,\pi]$. Since $f(\pi) = -f(-\pi)$ the Fourier series will not give the correct result on the end-points $a=\pm \pi$. It should be $a\in(0,\pi)$ or $a\in(-\pi,\pi)$ if you will. Sep 2, 2015 at 12:25
• use symmetry and give the residue theorem a shot. Shouldn't be too difficult :) Sep 2, 2015 at 12:31
• @Winther: Thanks, corrected.
– user139000
Sep 2, 2015 at 12:32
• $n$ isn't necessarily an integer right? Sep 2, 2015 at 12:33

It's a nice identity, but this one is fairly simple compared to some of the other magical results in the notebook. The function $f(a) = \int_0^\infty \frac{e^{ax}-e^{-ax}}{e^{\pi x}-e^{-\pi x}} \frac{{\rm d}x}{1+n^2 x^2}$ is odd so the Fourier series of $f$ on $[-\pi,\pi]$ is

$$f(a) = \sum_{k=1}^\infty c_k\sin(ka)\implies c_k = \frac{1}{\pi}\int_{-\pi}^\pi f(a)\sin(ka)\,{\rm d}a$$

Evaluating the integral over $a$ using $$\int_{-\pi}^\pi\sin(ka)(e^{ax}-e^{-ax}){\rm d}a = \frac{2k(-1)^{k+1}}{k^2+x^2}(e^{\pi x} - e^{-\pi x})$$ gives us

$$c_k = \frac{2k (-1)^{k+1}}{\pi}\int_0^\infty\frac{{\rm d}x}{(k^2+x^2)(1+n^2x^2)} \\= \frac{2k (-1)^{k+1}}{\pi}\frac{1}{n^2k^2-1}\int_0^\infty\left[-\frac{1}{k^2+x^2} + \frac{n^2}{1+n^2x^2}\right]{\rm d}x = \frac{(-1)^{k+1}}{1+kn}$$

where I used $\int_0^\infty\frac{dx}{1+x^2}=\frac{\pi}{2}$ to evaluate the final integrals.

Here is another solution using the residue theorem. If we try to integrate the function $\frac{\sinh(az)}{\sinh(\pi z)}\frac{1}{1+n^2z^2}$ directly then we obtain the result

$$\int_0^\infty \frac{\sinh(ax)}{\sinh(\pi x)}\frac{{\rm d}x}{1+n^2x^2} = \frac{\pi}{2n}\frac{\sin(a/n)}{\sin(\pi/n)} -\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k^2n^2-1}\sin(ka)$$

which requires knowledge of the identity $\frac{\pi}{2n}\frac{\sin(a/n)}{\sin(\pi/n)} = \sum_{k=1}^\infty \frac{kn(-1)^{k+1}}{k^2n^2-1}\sin(ka)$ to get the desired identity.

We can get around this by instead considering the slightly modified function $$f(z) = \frac{\sinh(a z)}{\sinh(\pi z)}\frac{1+inz}{1 + n^2z^2}$$ Under $z\to-z$ the two term in $f$ are even and odd respectively giving us

$$\int_{-\infty}^\infty f(x)\,{\rm d}x = 2\int_{0}^\infty \frac{\sinh(a x)}{\sinh(\pi x)}\frac{{\rm d}x}{1 + n^2x^2}$$

and both of the integrals above converge as long as $|a|<\pi$.

We now integrate $f$ from $z=-R$ to $z=R$ along the real axis and then along a semi-circle $C_R$ in the upper half-plane. We take $R=N+\frac{1}{2}$ for some $N\in\mathbb{N}$ to avoid integrating over one of the poles of $f$. For this choice of $R$ we have $|f(z)| \leq \frac{1}{nR-1}$ along $C_R$ so $\lim\limits_{R\to\infty}\int_{C_R}f(z)\,{\rm d}z = 0$.

The poles of $f$ in the upper half plane are located at $z=ik$ for $k\in\mathbb{N}$ with

$$\text{Res}\left[\frac{\sinh(a z)}{\sinh(\pi z)}\frac{1+inz}{1 + n^2z^2}; ik\right] = \frac{1}{\pi i}\frac{(-1)^{k+1}}{1+kn}\sin(ka)$$

and by the residue theorem it follows that

$$\int_{0}^\infty \frac{\sinh(a x)}{\sinh(\pi x)}\frac{{\rm d}x}{1 + n^2x^2} = \sum_{k=1}^\infty \frac{(-1)^{k+1}}{1+kn}\sin(ka)$$

• very nice (+1). i like the way how u avoided the divergent sum which whould pop up if one integrates the original function! Btw. do you have a reference for the stated identity which is needed for direct integration? Sep 2, 2015 at 18:30
• @tired Thanks. I just deduced it from the desired result and then checked numerically that it holds for all $a$ in question. However it can be derived by simply trying to compute the fourier series of $\sin(x/n)$, i.e. computing $\int_{-\pi}^\pi\sin(x/n)\sin(kx)\,{\rm d}x = \frac{2 (-1)^{k+1} k n^2 \sin \left(\frac{\pi }{n}\right)}{k^2 n^2-1}$ so it's not too much extra work. Sep 2, 2015 at 18:48
• Is there a way of proving $\dfrac{\pi}{2n}\dfrac{\sin(a/n)}{\sin(\pi/n)} ~=~ \displaystyle\sum_{k=1}^\infty\frac{kn(-1)^{k+1}}{k^2n^2-1}\sin(ka)$ using Euler's infinite product formulas for the sine and cosine functions? Sep 2, 2015 at 21:18