## Integral with hyperbolic functions

The problem here is to evaluate the following integral:

$$\displaystyle \int_{0}^{\infty} dx \frac{\cosh (ax) \cosh (bx)}{\cosh (\pi x)}$$

such that $|a|+|b| < \pi$. This one can be done a number of ways, including complex analysis. Atypical for me, I chose a different way, one which led to a surprising result. It should be noted that the condition $|a|+|b| < \pi$ is needed for the integral to converge. Basically, rewrite the $\cosh$'s as exponentials: \begin{align} \int_{0}^{\infty} dx \: \frac{\cosh (ax) \cosh (bx)}{\cosh (\pi x)} &= 2 \int_{0}^{\infty} dx \: \frac{\cosh (ax) \cosh (bx)}{1+e^{-2 \pi x}} e^{-\pi x} \\ &= \frac{1}{2} \sum_{k=0}^{\infty} (-1)^k \int_{0}^{\infty} dx \: (e^{a x}+e^{-a x}) (e^{b x}+e^{-b x}) e^{-(2 k+1) \pi x} \\ \end{align} Evaluating the integrals, we get $$= \frac{1}{2} \sum_{k=0}^{\infty} (-1)^k \left [ \frac{1}{(2 k+1)\pi -(a+b)} + \frac{1}{(2 k+1)\pi +(a+b)}\right ]$$ $$+ \frac{1}{2} \sum_{k=0}^{\infty} (-1)^k \left [ \frac{1}{(2 k+1)\pi -(a-b)} + \frac{1}{(2 k+1)\pi +(a-b)} \right ]$$ Here I note that $a+b$ and $a-b$ should not be some multiple of $\pi$, so that the above sums behave properly. To get the sums into a somewhat familiar form, I rearrange them a bit to get $$= \frac{1}{4 \pi} \sum_{k=0}^{\infty} (-1)^k \left [ \frac{1}{k +\left (\frac{1}{2} - \frac{a+b}{2 \pi} \right )} + \frac{1}{k +\left (\frac{1}{2} + \frac{a+b}{2 \pi}\right )}\right ]$$ $$+ \frac{1}{4 \pi} \sum_{k=0}^{\infty} (-1)^k \left [ \frac{1}{k +\left (\frac{1}{2} - \frac{a-b}{2 \pi} \right )} + \frac{1}{k +\left (\frac{1}{2} + \frac{a-b}{2 \pi}\right )}\right ]$$ Now, here is the interesting part (at least to me). Let $$f(z) = \sum_{k=0}^{\infty} \frac{(-1)^k}{k+z}$$ This looks like it should be a trig function of some sort. It is not; rather, it is something called a Hurwitz-Lerch transcendent, which does not look like it will be much help. That said, it *almost* looks like a trig function, so I instead considered the following:

\begin{align} f(z) + f(1-z) &= \sum_{k=0}^{\infty} \frac{(-1)^k}{k+z} + \sum_{k=0}^{\infty} \frac{(-1)^k}{k+1-z}\\ &= \sum_{k=0}^{\infty} \frac{(-1)^k}{z+k} + \sum_{k=0}^{\infty} \frac{(-1)^{k+1}}{z-(k+1)}\\ &= \sum_{k=-\infty}^{\infty} \frac{(-1)^k}{z+k} \\ &= \frac{\pi}{\sin{\pi z}}\\ \end{align}

This is very helpful, because we have precisely this functional form above, e.g.,

$$\frac{1}{2} – \frac{a+b}{2 \pi} = 1 – \left ( \frac{1}{2} + \frac{a+b}{2 \pi} \right )$$
$$\frac{1}{2} – \frac{a-b}{2 \pi} = 1 – \left ( \frac{1}{2} + \frac{a-b}{2 \pi} \right )$$

So we get for the integral:

\begin{align} \int_{0}^{\infty} dx \: \frac{\cosh (ax) \cosh (bx)}{\cosh (\pi x)} &= \frac{1}{4} \left [ \frac{1}{\sin{\left ( \frac{\pi}{2} – \frac{a+b}{2} \right )}} + \frac{1}{\sin{\left ( \frac{\pi}{2} – \frac{a-b}{2} \right )}} \right ] \\ &= \frac{1}{4} \left [ \frac{1}{\cos{\left ( \frac{a+b}{2} \right )}} + \frac{1}{\cos{\left ( \frac{a-b}{2} \right )}} \right ] \\ &= \frac{\cos{\frac{a}{2}} \cos{\frac{b}{2}}}{\cos{a} + \cos{b}} \end{align}