# Show that $\int_{0}^{\infty} \frac{\cosh(ax)}{\cosh(\pi x)} dx=\frac{1}{2}\sec(\frac{a}{2})$ using Residue Calculus

Show that the following expression is true

$$\int_{0}^{\infty} \frac{\cosh(ax)}{\cosh(\pi x)} dx=\frac{1}{2}\sec(\frac{a}{2})$$

Edit: I forgot to mention that $|a|<\pi$

Specifically, using Residue Calculus and a rectangular contour with corners at $\pm R$ and $\pm R+i$

However, I'm unsure how to approach this given the bound from $(0,\infty)$, where I usually see the bound $(- \infty, \infty )$. How does this change the problem, and how should I begin to approach it from here?

Edit: Given the tip that the integrand is an even function, I can use the following relation:

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

Next I proceed by the standard procedure

$$\oint_C f(z) \,dz=(\int_{C_{R}}^{}+\int_{C_{T}}^{}+\int_{C_{L}}^{}+\int_{C_{B}}^{})f(z)dz=2 \pi i \sum_{j}\text{Res}(f(z);z_j)$$

where $f(z)=\frac{\cosh(az)}{\cosh(\pi z)}$ and R, T, L, and B denote the right, top, left, and bottom sides of the rectangular contour. Furthermore, I can bound each $C_i$ integral and determine what happens as R approaches $\infty$ to ultimately simplify the above expression.

In fact, the side contour integrals do disappear as R approaches $\infty$, and the bottom integral becomes our integral of interest.

$$\oint_C f(z) \,dz=(\int_{C_{T}}^{}+\int_{C_{B}}^{})f(z)dz=2 \pi i \sum_{j}^{}\text{Res}(f(z);z_j)$$

However, I am left clueless as to how to deal with the top integral.

• Just note that the integrand is an even function! Commented Apr 13, 2016 at 2:18

We assume that $|a|<\pi$. Note that we have

$$\int_0^\infty \frac{\cosh(ax)}{\cosh(\pi x)}\,dx=\frac12 \int_{-\infty}^\infty \frac{\cosh(ax)}{\cosh(\pi x)}\,dx$$

Now, we analyze the contour integral $I(a)$ given by

$$I(a)=\oint_C \frac{\cosh(az)}{\cosh(\pi z)}\,dz$$

where $C$ is the rectangular contour with corners at $\pm R$ and $\pm R+i$. Thus, we can write

\begin{align} I(a)&=\int_{-R}^R \frac{\cosh(ax)}{\cosh(\pi x)}\,dx\\\\ &+\int_{0}^1\frac{\cosh(a(R+iy))}{\cosh(\pi (R+iy))}\,i\,dy\\\\ &+\int_{R}^{-R}\frac{\cosh(a(x+i))}{\cosh(\pi (x+i))}\,dx\\\\ &+\int_{1}^0\frac{\cosh(a(-R+iy))}{\cosh(\pi (-R+iy))}\,i\,dy \tag 1 \end{align}

As $R\to \infty$, the second and fourth integrals approach zero. Using the residue theorem, $I(a)$ is

\begin{align} I(a)&=2\pi i \text{Res}\left( \frac{\cosh(az)}{\cosh(\pi z)}, z=i/2\right)\\\\ &=2\cos(a/2) \tag 2 \end{align}

Now, we have using $(1)$ and $(2)$

\begin{align} \int_{-\infty}^\infty \frac{\cosh(ax)}{\cosh(\pi x)}\,dx&=2\cos(a/2)+ \int_{-\infty}^\infty\frac{\cosh(a(x+i))}{\cosh(\pi (x+i))}\,dx\\\\ &=2\cos(a/2)- \int_{-\infty}^\infty\frac{\cosh(ax)\cos(a)+i\sinh(ax)\sin(a)}{\cosh(\pi x)}\,dx \tag 3\\\\ &=2\cos(a/2)-\cos(a) \int_{-\infty}^\infty\frac{\cosh(ax)}{\cosh(\pi x)}\,dx \tag 4\\\\ &=\frac{2\cos(a/2)}{1+\cos(a)}\\\\ &=\frac{1}{\cos(a/2)} \end{align}

where in going from $(3)$ to $(4)$ we exploited the fact that $\frac{\sinh(ax)}{\cosh(\pi x)}$ is an odd function, and the integral of an odd function over anti-symmetric limits is zero.

Therefore, the integral of interest is found to be

$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty \frac{\cosh(ax)}{\cosh(\pi x)}\,dx=\frac{1}{2\cos(a/2)}}$$

as was to be shown!

• Ah, that was great! You explained everything I was having problems with. Thanks a ton for your help!
– Tunk
Commented Apr 13, 2016 at 3:55
• Jay, you're welcome. My pleasure. -Mark Commented Apr 13, 2016 at 13:13
• How did you know to use a rectangular contour? Commented Apr 9, 2018 at 10:39
• @Crescendo We want to evaluate the integral of interest. We can do so by exploiting the residue theorem. Furthermore, we note that $\cosh(\pi x)=\cosh (\pi(x+i))$. And finally, there is a single and simple pole at $z=i/2$. That is the motivation here. Commented Apr 9, 2018 at 13:49

Assuming $a\in(0,\pi)$, we have: $$\begin{eqnarray*} \frac{\cosh(ax)}{\cosh(\pi x)} = \frac{e^{ax}+e^{-ax}}{e^{\pi x}+e^{-\pi x}}=(e^{ax}+e^{-ax})\sum_{n\geq 0}(-1)^n e^{-(2n+1)\pi x}\end{eqnarray*}$$ hence: $$\begin{eqnarray*} \int_{0}^{+\infty}\frac{\cosh(ax)}{\cosh(\pi x)} = \sum_{n\geq 0}(-1)^n\left(\frac{1}{(2n+1)\pi-a}+\frac{1}{(2n+1)\pi+a}\right)=g(a)\end{eqnarray*}$$ where the RHS is a meromorphic function with simple poles at every element of $\pi+2\pi\mathbb{Z}$, having residues: $$\text{Res}\left(g(a),a=(2k+1)\pi\right) = (-1)^{k+1}.$$ The same happens for the function $f(a)=\frac{1}{2}\sec\left(\frac{a}{2}\right)$. In a neighbourhood $U$ of the imaginary axis both $f$ and $g$ are bounded and converging to $0$ as $|z|\to+\infty$, hence $f\equiv g$.

\begin{align*} \sum\limits_{n = -\infty}^{+\infty} \frac{1}{{n + z}} &= \frac{\pi}{{\tan\left(\pi z\right)}} \\ \sin\left(\pi z\right) &= \pi z \prod\limits_{n = 1}^\infty \left(1 - \frac{z^2}{{n^2}}\right) \\ \ln\left(\sin\left(\pi z\right)\right) &= \ln(\pi) + \ln(z) + \sum\limits_{n = 1}^\infty \ln\left(1 - \frac{z^2}{{n^2}}\right) \\ \frac{\pi \cos\left(\pi z\right)}{\sin\left(\pi z\right)} &= \frac{1}{z} - \sum\limits_{n = 1}^\infty \frac{2z}{{n^2 - z^2}} = \frac{1}{z} + \sum\limits_{n = 1}^\infty \left(\frac{1}{{z + n}} + \frac{1}{{z - n}}\right) \\ \sum\limits_{n = -\infty}^\infty \frac{1}{{z + n}} &= \frac{\pi}{{\tan\left(\pi z\right)}} \end{align*}

\begin{align*} \int\limits_0^\infty \frac{\cosh(ax)}{\cosh(\pi x)} \, dx &= \int\limits_0^\infty \frac{e^{ax} + e^{-ax}}{e^{\pi x} + e^{-\pi x}} \, dx \\ &= \int\limits_0^\infty \frac{(e^{ax} + e^{-ax})e^{-\pi x}}{1 + e^{-2\pi x}} \, dx \\ &= \int\limits_0^\infty (e^{ax} + e^{-ax})e^{-\pi x}\sum\limits_{n = 0}^\infty {(-1)^ne^{-2n\pi x}} \, dx \\ &= \sum\limits_{n = 0}^\infty {(-1)^n \int\limits_0^\infty (e^{-(2\pi n + \pi - a)x} + e^{-(2\pi n + \pi + a)x}) \, dx} \\ &= \sum\limits_{n = 0}^\infty {(-1)^n \left(\frac{1}{{2\pi n + \pi - a}} + \frac{1}{{2\pi n + \pi + a}}\right)} \\ &= \frac{1}{{2\pi}}\sum\limits_{n = 0}^\infty \left(\frac{(-1)^n}{{n + \frac{\pi - a}{2\pi}}} + \frac{(-1)^n}{{n + \frac{\pi + a}{2\pi}}}\right) \\ &= \frac{1}{{2\pi}}\sum\limits_{n = 0}^\infty \left(\frac{(-1)^n}{{n + w}} + \frac{(-1)^n}{{n + 1 - w}}\right) \\ &= \frac{1}{{2\pi}}\left(\sum\limits_{n = 0}^\infty \frac{(-1)^n}{{n + w}} + \sum\limits_{n = 0}^\infty \frac{(-1)^n}{{n + 1 - w}}\right) \\ &= \frac{1}{{2\pi}}\left(\frac{1}{w} + \sum\limits_{n = 1}^\infty \frac{(-1)^n}{{w + n}} + \sum\limits_{n = 1}^\infty \frac{(-1)^n}{{w - n}}\right) \\ &= \frac{1}{{2\pi}}\left(\frac{1}{w} + \sum\limits_{n = 1}^\infty \frac{(-1)^n}{{w + n}} + \sum\limits_{n = 1}^\infty \frac{(-1)^n}{{w - n}}\right) \\ &= \frac{1}{{2\pi}}\Rightarrow \boxed{\int\limits_0^\infty \frac{\cosh(ax)}{\cosh(\pi x)} \, dx = \frac{1}{{2\pi}}\sum\limits_{n = -\infty}^{n = +\infty} \frac{(-1)^n}{n + \frac{\pi - a}{2\pi}}} \end{align*}

\begin{align*} \sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{n + w}} &= \frac{\pi}{{\tan\left(\pi w\right)}} \\ \sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{2n + w}} &= \frac{1}{2}\sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{n + w/2}} = \frac{\pi}{{2\tan\left(\pi \frac{w}{2}\right)}} \\ \sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{(2n + 1) + w}} &= \sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{n + w}} - \sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{2n + w}} \\ &= \frac{\pi}{{\tan\left(\pi w\right)}} - \frac{\pi}{{2\tan\left(\pi \frac{w}{2}\right)}} \end{align*}

\begin{align*} \text{Therefore } \sum\limits_{n = -\infty}^{n = +\infty} \frac{{(-1)^n}}{{n + w}} &= \sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{2n + w}} - \sum\limits_{n = -\infty}^{n = +\infty} \frac{1}{{(2n + 1) + w}} \\ &= \frac{\pi}{{2\tan\left(\pi \frac{w}{2}\right)}} - \left(\frac{\pi}{{\tan\left(\pi w\right)}} - \frac{\pi}{{2\tan\left(\pi \frac{w}{2}\right)}}\right) \\ &= \frac{\pi}{{\tan\left(\pi \frac{w}{2}\right)}} - \frac{\pi}{{\tan\left(\pi w\right)}} \\ &= \pi \left(\frac{{\cos\left(\pi \frac{w}{2}\right)}}{{\sin\left(\pi \frac{w}{2}\right)}} - \frac{{\cos\left(\pi w\right)}}{{\sin\left(\pi w\right)}}\right) \\ &= \pi \frac{{2\cos^2\left(\pi \frac{w}{2}\right) - \cos\left(\pi w\right)}}{{\sin\left(\pi w\right)}} \\ &= \frac{\pi}{{\sin\left(\pi w\right)}} \end{align*}

\begin{align*} \text{So } \int\limits_0^\infty \frac{\cosh(ax)}{\cosh(\pi x)} \, dx &= \frac{1}{{2\pi}}\sum\limits_{-\infty}^{+\infty} \frac{{(-1)^n}}{{n + \frac{\pi - a}{2\pi}}} \\ &= \frac{1}{{2\pi}}\frac{\pi}{{\sin\left(\pi \frac{\pi - a}{2\pi}\right)}} = \frac{1}{{2\cos\left(\frac{a}{2}\right)}} \end{align*}