Integrate the function $$f(z) =\frac{z(e^{z}-e^{-z})}{e^{2z}+e^{-2z}+2\cos(2a)} = \frac{z\sinh(z)}{\cosh(2z)+ \cos (2a)}, \quad - \frac{\pi}{2} < \Re(a) < \frac{\pi}{2},$$ counterclockwise around a rectangular contour with vertices at $z= \pm R, \pm R + i \pi$.
As $R \to \infty$, the integral vanishes on the left and right sides of the contour because the magnitude of $f(z)$ decays exponentially to zero as $\Re(z) \to \pm \infty$.
Therefore, we have
$$ \begin{align} &\int_{-\infty}^{\infty} \frac{x \sinh(x)}{\cosh(2x)+\cos(2a)} \, \mathrm dx + \int_{\infty}^{-\infty}\frac{(x + i \pi) \left(-\sinh (x)\right) }{\cosh(2x) + \cos(2a)} \, \mathrm d x \\ &= 2 \pi i \left( \operatorname{Res} \left[f(z) , i \left(a + \frac{\pi}{2} \right) \right] + \operatorname{Res} \left[f(z) , i \left(\frac{\pi}{2} -a \right) \right] \right) \\ &= 2 \pi i \left( \lim_{z \to i \left(a+ \frac{\pi}{2} \right)} \frac{z \sinh(z)}{2 \sinh(2z)} + \lim_{z \to i \left(\frac{\pi}{2}-a \right)} \frac{z \sinh(z)}{2 \sinh(2z)}\right) \\ &= 2 \pi i \left(\lim_{z \to i \left(a+ \frac{\pi}{2} \right)} \frac{z}{4 \cosh(z)}+ \lim_{z \to i \left(\frac{\pi}{2}-a \right)} \frac{z}{4 \cosh (z)} \right) \\ &= 2 \pi i \left( \frac{i \left(a+ \frac{\pi}{2} \right)}{-4\sin(a)} + \frac{i \left(\frac{\pi}{2}-a \right)}{4 \sin(a)}\right) \\ &= \frac{\pi a}{\sin(a)}. \end{align}$$
Equating the real parts on both sides of the equation, we get $$2 \int_{-\infty}^{\infty} \frac{x \sinh(x)}{\cosh(2x)+\cos(2a)} \, \mathrm dx = 4 \int_{0}^{\infty} \frac{x \sinh(x)}{\cosh(2x)+\cos(2a)} \, \mathrm dx = \frac{\pi a}{ \sin (a)}. $$