Show $\int_0^\infty \frac{\cos a x-\cos b x}{\sinh \beta x}\frac{dx}{x}=\log\big( \frac{\cosh \frac{b\pi}{2 \beta}}{\cosh \frac{a\pi}{2\beta}}\big)$

First I'm going to evaluate $ \displaystyle\int_{0}^{\infty}\frac{\sin tx}{\sinh \beta x} \, dx \ , \ (t \in \mathbb{R}, \, \text{Re}(\beta) >0) $.

$$ \begin{align}\int_{0}^{\infty} \frac{\sin tx}{\sinh \beta x} \, dx &= 2 \int_{0}^{\infty} \frac{\sin tx}{e^{\beta x}-e^{-\beta x}} \, dx = 2 \int_{0}^{\infty} \sin tx \ \frac{e^{- \beta x}}{1-e^{-2 \beta x}} \, dx \\ &= 2 \int_{0}^{\infty} \sin tx \sum_{n=0}^{\infty} e^{-(2n+1)\beta x} \, dx = 2 \sum_{n=0}^{\infty} \int_{0}^{\infty} \sin tx \ e^{-(2n+1) \beta x} \, dx \\ &= 2 \sum_{n=0}^{\infty} \frac{t}{(2n+1)^{2}\beta^{2} + t^{2}} = \frac{\pi}{2 \beta} \tanh \left( \frac{\pi t}{2\beta}\right) , \end{align} $$

where I used the partial fraction expansion $$\tanh z = \sum_{n=0}^{\infty} \frac{2z}{\left(\frac{(2n+1) \pi}{2}\right)^{2}+z^{2}} $$

Then for $a, b \in \mathbb{R}$,

$$ \begin{align} \int_{0}^{\infty} \frac{\cos ax - \cos bx}{\sinh \beta x} \frac{dx}{x} &= \int_{0}^{\infty} \int_{a}^{b} \frac{\sin xt}{\sinh \beta x} \, dt \, dx= \int_{a}^{b} \int_{0}^{\infty} \frac{\sin tx}{\sinh \beta x} \, dx \, dt \\ &= \frac{\pi}{2 \beta}\int_{a}^{b} \tanh \left(\frac{\pi t}{2 \beta} \right) \, dt = \int_{\frac{\pi a}{2 \beta}}^{\frac{\pi b}{2 \beta}} \tanh u \, du \\ &= \log\left(\cosh \frac{\pi b}{2 \beta}\right) - \log \left( \cosh \frac{\pi a}{2 \beta}\right) \\ &= \log \left( \frac{\cosh \frac{\pi b}{2 \beta}}{\cosh \frac{\pi a}{2 \beta}}\right)\end{align} $$


Consider the integral \begin{align} \int_{a}^{b} \sin(\mu x) \ d\mu = \left[ \frac{\cos(x \mu)}{x} \right]_{a}^{b} = \frac{\cos(ax) - \cos(bx)}{x}. \end{align} The integral to calculate is \begin{align} I = \int_{0}^{\infty} \frac{\cos(ax) - \cos(bx)}{x \ \sinh(\beta x)} \ dx \end{align} and can be seen to be \begin{align} I &= \int_{0}^{\infty} \frac{\cos(ax) - \cos(bx)}{x \ \sinh(\beta x)} \ dx \\ &= \int_{a}^{b} \left( \int_{0}^{\infty} \frac{\sin(\mu x)}{\sinh(\beta x)} \ dx \right) \ d\mu. \end{align} The inner integral can be quickly calculated by using the known integral \begin{align} \int_{0}^{\infty} \frac{\sinh(\alpha x)}{\sinh(\beta x)} \ dx = \frac{\pi}{2 \beta} \ \tan\left( \frac{\alpha \pi}{2 \beta} \right). \end{align} By letting $\alpha = i \mu$ this becomes \begin{align} \int_{0}^{\infty} \frac{\sin(\mu x)}{\sinh(\beta x)} \ dx = \frac{\pi}{2 \beta} \ \tanh\left( \frac{\mu \pi}{2 \beta} \right) \end{align} and leads to \begin{align} I &= \frac{\pi}{2 \beta} \ \int_{a}^{b} \tanh\left( \frac{\pi \mu}{2 \beta} \right) \ d\mu \\ &= \int_{(a\pi/2\beta)}^{(b\pi/2\beta)} \tanh(x) \ dx \\ &= \left[ \ln(\cosh(x)) \right]_{(a\pi/2\beta)}^{(b\pi/2\beta)} \end{align} which can be restated as \begin{align} \int_{0}^{\infty} \frac{\cos(ax) - \cos(bx)}{x \ \sinh(\beta x)} \ dx = \ln\left( \frac{\cosh \left( \frac{b \pi}{2\beta} \right)}{\cosh\left(\frac{a\pi}{2\beta}\right)}\right). \end{align}