$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} &\bbox[10px,#ffd]{% 2\int_{0}^{\infty}{\sin\pars{x} \over \sinh\pars{x}}\,\dd x} = 2\,\Im\int_{0}^{\infty}{\expo{\ic x} - 1 \over \pars{\expo{x} - \expo{-x}}/2}\,\dd x \\[5mm] = &\ 4\,\Im\int_{0}^{\infty}{\expo{-\pars{1 - \ic}x} - \expo{-x} \over 1 - \expo{-2x}}\,\dd x \,\,\,\stackrel{\large\expo{-2x}\ =\ t}{\large =}\,\,\, 4\,\Im\int_{1}^{0}{t^{1/2 - \ic/2} - t^{1/2} \over 1 - t}\, \pars{-\,{\dd t \over 2t}} \\[5mm] = &\ 2\,\Im\bracks{\int_{0}^{1}{1 - t^{-1/2} \over 1 - t}\,\dd t - \int_{0}^{1}{1 - t^{-1/2 - \ic/2} \over 1 - t}\,\dd t} \\[5mm] = &\ 2\,\Im\bracks{\Psi\pars{1 \over 2} - \Psi\pars{{1 \over 2} - {\ic \over 2}}} = -2\,\Im\Psi\pars{{1 \over 2} - {\ic \over 2}} \\[5mm] = &\ -2\,{\Psi\pars{1/2 - \ic/2} - \Psi\pars{1/2 + \ic/2} \over 2\ic} = \ic\braces{\pi\cot\pars{\pi\bracks{{1 \over 2} + {\ic \over 2}}}} \\[5mm] = &\ -\ic\pi\tan\pars{\pi\ic \over 2} = \bbx{\pi\tanh\pars{\pi \over 2}} \end{align}
0 votos
Quizá tengas suerte con el cálculo de residuos, aunque yo no lo he intentado.
0 votos
wolframalpha.com/input/
0 votos
math.stackexchange.com/questions/2529614/
0 votos
Aunque la forma integral de la OP está un poco mal al final, creo que podemos decir que la integral es $$\Im\int_0^{\infty}\frac{x^i-x^{-i}}{x^2-1}dx$$