<s>[INST] A definite integral with hyperbolic cosines I want to show that $$ \int_{0}^{\infty} \frac{\cosh (ax) \cosh (bx)}{\cosh (\pi x)} \ dx = \frac{\cos ( \frac{a}{2} ) \cos ( \frac{b}{2})} {\cos (a) + \cos (b)} \ , \  |a|+|b| < \pi.$$
I thought one approach would be to integrate the appropriate function around a rectangle with vertices at $z=R$, $z=R+i$, $z=-R+i$, and $z=-R$.
I tried $\displaystyle f(z) = \frac{e^{(a+b)z}}{\cosh (\pi z)}, f(z) = \frac{e^{az} \cosh (bz)}{\cosh (\pi z)}$, and $\displaystyle f(z) = \frac{\cosh (az) \cosh (bz)}{\cosh (\pi z)}$.  
None of these three choices for $f(z)$ worked.  
EDIT:
As AD. stated in the comments, the integral can be rewritten as 
$$ \frac{1}{2} \int_{0}^{\infty} \frac{\cosh \big((a+b)x\big) + \cosh \big((a-b) x \big)}{\cosh (\pi x)} \ dx.  $$
By integrating $ \displaystyle f(z) = \frac{e^{\alpha z}}{\cosh (\pi z)}$ around the rectangle described above, one can show that $$\int_{0}^{\infty} \frac{\cosh (\alpha x)}{\cosh (\pi x)} \ dx = \frac{1}{2} \sec \left(\frac{\alpha}{2} \right) \ , \ |\alpha| < \pi. $$
Therefore, 
$$ \begin{align} &\int_{0}^{\infty} \frac{\cosh (ax) \cosh (bx)}{\cosh (\pi x)} \ dx \\ &= \frac{1}{4} \left[\sec \left(\frac{a+b}{2} \right) + \sec \left( \frac{a-b}{2}\right) \right] \\  &= \frac{1}{4} \left(\frac{1}{\cos (\frac{a}{2}) \cos (\frac{b}{2}) - \sin (\frac{a}{2}) \sin (\frac{b}{2})} + \frac{1}{\cos (\frac{a}{2}) \cos (\frac{b}{2}) + \sin (\frac{a}{2}) \sin (\frac{b}{2})}\right) \\ &= \frac{1}{2} \frac{\cos (\frac{a}{2}) \cos(\frac{b}{2})}{\cos^{2}(\frac{a}{2})\cos^{2} (\frac{b}{2}) - \sin^{2} (\frac{a}{2}) \sin^{2} (\frac{b}{2})} \\ &=  \frac{2 \cos (\frac{a}{2}) \cos(\frac{b}{2})}{\big(1+\cos(a)\big) \big(1+\cos(b) \big) - \big(1-\cos(a)\big) \big(1-\cos(b)\big)} \\ &= \frac{\cos (\frac{a}{2}) \cos (\frac{b}{2})}{\cos(a) + \cos (b)} . \end{align}$$
 [/INST] I have a way of showing this without contour integration in the complex plane.  There is a bit of a trick involved and, frankly, Mathematica misleads.  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}$$
QED
</s>