## An integral that illustrates the beauty of contour integration methods

I attack many of the integrals in this blog using contour integration methods, some of which are obvious and some of which take a little more imagination. Here is one that illustrates the beauty an power of such methods as much as any other integral here.

The problem is to derive the integral representation

$$\sin a=\int_{-\infty}^{\infty}dx \, \cos(ax^2)\frac{\sinh(2ax)}{\sinh(\pi x)}$$

for $|a|\le \pi/2$.

Doing a problem like this using contour integration methods involves recognizing the pattern in the integrand; this helps select the contour as much as the integrand. Once this is done, the process of writing out the integrals involved and applying the residue theorem is simple.

Consider the contour integral

$$\oint_C dz \frac{e^{i a z^2}}{\sinh{\pi z}}$$

where $C$ is a rectangular contour with corners at $-R-i,R-i,R+i,-R+i$, but with semicircular detours of radius $\epsilon$ around the poles at $z=\pm i$.

The contour integral may then be written out as a sum over eight integrals:

$$\int_{-R}^{-\epsilon} dx \frac{e^{i a (x-i)^2}}{\sinh{\pi(x-i)}} + i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{e^{i a (-i+\epsilon e^{i \phi})^2}}{\sinh{\pi (-i + \epsilon e^{i \phi})}}\\ + \int_{\epsilon}^R dx \frac{e^{i a (x-i)^2}}{\sinh{\pi(x-i)}} + i \int_{-1}^1 dy \frac{e^{i a (R+i y)^2}}{\sinh{\pi (R+i y)}} \\ + \int_{R}^{\epsilon} dx \frac{e^{i a (x+i)^2}}{\sinh{\pi(x+i)}} + i \epsilon \int_0^{-\pi} d\phi \, e^{i \phi} \frac{e^{i a (i+\epsilon e^{i \phi})^2}}{\sinh{\pi (i + \epsilon e^{i \phi})}}\\ + \int_{-\epsilon}^{-R} dx \frac{e^{i a (x+i)^2}}{\sinh{\pi(x+i)}} + i \int_{1}^{-1} dy \frac{e^{i a (-R+i y)^2}}{\sinh{\pi (-R+i y)}}$$

In the limit as $R \to \infty$ the fourth and eighth integrals vanish so long as $|a| \lt \pi/2$. (I would treat the case $|a|=\pi/2$ separately.) As $\epsilon \to 0$, the second and sixth integrals become equal; using a sine addition theorem or the sort, we see that the each of these integrals approaches

$$i \epsilon e^{-i a} \frac{1}{-\pi \epsilon } (-\pi) = i e^{-i a}$$

Meanwhile, the sum of the first, third, fifth, and seventh integrals approaches a Cauchy principal value. Using the fact that $\sinh{\pi(x\pm i)} = -\sinh{\pi x}$, we have for this sum

$$-PV \int_{-\infty}^{\infty} dx \frac{e^{i a (x-i)^2}-e^{i a (x+i)^2}}{\sinh{\pi x}} = -2 e^{-i a} \int_{-\infty}^{\infty} dx \, e^{i a x^2} \frac{\sinh{2 a x}}{\sinh{\pi x}}$$

(Note that we no longer need the $PV$ because the singularities have been removed.) Now, the contour integral is also equal to $i 2 \pi$ times the residue of the pole at $z=0$, which is simply $i 2 \pi (1/\pi) = i 2$. Thus, we now have

$$-2 e^{-i a} \int_{-\infty}^{\infty} dx \, e^{i a x^2} \frac{\sinh{2 a x}}{\sinh{\pi x}} + 2 i e^{-i a} = 2 i$$

Rearranging, we find that

$$\int_{-\infty}^{\infty} dx \, e^{i a x^2} \frac{\sinh{2 a x}}{\sinh{\pi x}} = i \left (1-e^{i a}\right)$$

or, taking the real part,

$$\int_{-\infty}^{\infty} dx \, \cos{a x^2} \frac{\sinh{2 a x}}{\sinh{\pi x}} = \sin{a}$$

when $|a| \lt \pi/2$. When $|a|=\pi/2$, one may take a different approach, e.g., using a wedge of angle $\pi/4$ in the complex plane, to verify that the equality holds.

$$\int_{-\infty}^{\infty} dx \, \sin{a x^2} \frac{\sinh{2 a x}}{\sinh{\pi x}} = 1-\cos{a}$$

• Hi Ron,

Thanks for posting this nice solution! 🙂 Several years ago, I came across a paper written by Ramanujan about some similar integrals. I would like to share it with you.

http://www.imsc.res.in/~rao/ramanujan/CamUnivCpapers/Cpaper12/page6.htm

Ramanujan also uses complex numbers to prove his results but without contour integration. He shows that
$\int_0^\infty \frac{\sin(2\pi t x)}{\sinh(\pi x)}\cos(\pi x^2)dx=\frac{\cosh(\pi t)-\cos(\pi t^2)}{2\sinh(\pi t)}$
(see equation 33) and many other results. By Differentiating the above result you can also evaluate
$\int_0^\infty \frac{x\cos(\pi x^2)}{\sinh(\pi x)}dx,\int_0^\infty \frac{x^3\cos(\pi x^2)}{\sinh(\pi x)}dx$
Best of Luck,
Shobhit

• I am sorry, the link in my previous comment is incorrect. The correct link is

http://www.imsc.res.in/~rao/ramanujan/CamUnivCpapers/Cpaper12/page1.htm

• rlgordonma@yahoo.com wrote:

Shobhit,

Many thanks, and thanks for the reference. Did Ramanujan use contour integration methods much?

Best wishes, (and I love your site)

Ron

• Hi Ron,

I don’t think Ramanujan even knew what contour integration was. He probably had his own techniques for solving integrals. If you are interested in knowing more about Ramanujan’s discoveries, you can read his notebooks.

Best of Luck,
Shobhit