<s>[INST] Mistake computing $\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(x)}-\frac{a}{e^{2x}} \right)\frac{dx}{x}$ I am looking to evaluate the integral
$$\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(x)}-\frac{a}{e^{2x}} \right)\frac{dx}{x}=\ln\left(\frac{\pi}{\Gamma^2\left(\frac{1+a}{2b}\right)\cos\left(\frac{a\pi}{2}\right)}\right)$$
To this end I considered
$$I(w)=\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(bx)}-\frac{ad}{e^{cx}} \right)\frac{e^{-wx}}{x}\,dx \tag{1}$$
Note that as $w \to \infty$ the integrand vanishes. And as $w =0$ we recover the desired integral.
Differentiating $(1)$ w.r. to $w$ we obtain
$$
\begin{aligned}
I^\prime(w)&=-\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(bx)}-\frac{ad}{e^{cx}} \right)e^{-wx}\,dx\\
&=ad\int_0^\infty e^{-(c+w)x}\,dx- \int_0^\infty \frac{\sinh(ax)}{\sinh(bx)}e^{-wx}\,dx\\
&=\frac{ad}{c+w}-\int_0^\infty \frac{e^{ax}-e^{-ax}}{e^{bx}-e^{-bx}}e^{-wx}\,dx\\
&=\frac{ad}{c+w}-\int_0^\infty \frac{e^{-(w-a)x}-e^{-(w+a)x}}{e^{bx}-e^{-bx}}\,dx\\
&=\frac{ad}{c+w}-\int_0^\infty \frac{e^{-bx}}{e^{-bx}}\cdot\frac{e^{-(w-a)x}-e^{-(w+a)x}}{e^{bx}-e^{-bx}}\,dx\\
&=\frac{ad}{c+w}-\int_0^\infty \frac{e^{-(w-a+b)x}-e^{-(w+a+b)x}}{1-e^{-2bx}}\,dx\\
&=\frac{ad}{c+w}-\frac{1}{2b}\int_0^\infty \frac{e^{-\frac{(w-a+b)}{2b}x}-e^{-\frac{(w+a+b)}{2b}x}}{1-e^{-x}}\,dx \qquad (2bx \to x)\\
&=\frac{ad}{c+w}-\frac{1}{2b}\int_0^1 \frac{x^{\frac{(w-a+b)}{2b}-1}-x^{\frac{(w+a+b)}{2b}-1}}{1-x}\,dx \qquad (e^{-x} \to x)\\
&=\frac{ad}{c+w}-\frac{1}{2b}\left(\psi\left(\frac{w+a+b}{2b}\right)-\psi\left(\frac{w-a+b}{2b}\right)\right)\\
I(w)&=ad\int\frac{1}{c+w}\,dw-\frac{1}{2b}\left(\int\psi\left(\frac{w+a+b}{2b}\right)\,dw-\int\psi\left(\frac{w-a+b}{2b}\right)\,dw\right)\\
&=ad\ln(c+w)-\left(\ln\left(\Gamma\left(\frac{w+a+b}{2b}\right)\right)\,-\ln\left(\Gamma\left(\frac{w-a+b}{2b}\right)\right)\right)\\
&=ad\ln(c+w)+\ln\left(\frac{\Gamma\left(\frac{w-a+b}{2b}\right)}{\Gamma\left(\frac{w+a+b}{2b}\right)}\right)\\
\end{aligned}
$$
Now,our integral is equal to
$$I=-\int_0^\infty I^\prime(w)\,dw=I(0)$$
Letting $w=0$
$$\begin{aligned}
\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(bx)}-\frac{ad}{e^{cx}} \right)\frac{dx}{x}&=\ln\left(\frac{c^{ad}\Gamma\left(\frac12-\frac{a}{2b}\right)}{\Gamma\left(\frac12+\frac{a}{2b}\right)}\right)\\
&=\ln\left(\frac{c^{ad}\Gamma\left(\frac12-\frac{a}{2b}\right)\Gamma\left(\frac12+\frac{a}{2b}\right)}{\Gamma\left(\frac12+\frac{a}{2b}\right)\Gamma\left(\frac12+\frac{a}{2b}\right)}\right)\\
&=\ln\left(\frac{c^{ad}\pi}{\Gamma^2\left(\frac12+\frac{a}{2b}\right)\cos\left(\frac{a\pi}{2b}\right)}\right) \qquad \blacksquare\\
\end{aligned}$$
setting $b=1$, $c=2$ and $d=1$ I obtained
$$\int_0^\infty \left(\frac{\sinh(ax)}{\sinh(x)}-\frac{a}{e^{2x}} \right)\frac{dx}{x}=\ln\left(\frac{2^{a}\pi}{\Gamma^2\left(\frac{1+a}{2b}\right)\cos\left(\frac{a\pi}{2}\right)}\right)$$
Which has an extra term leading to an incorrect answer. Can someone please point out where I am mistaking?
 [/INST] With a simple renaming of variables, I solved the OP's question using Ramanujan's generalization of Frullani's integral.  The OP's method should work as well.
Evaluate $\int_0^{\infty } \Bigl( 2qe^{-x}-\frac{\sinh (q x)}{\sinh \left(\frac{x}{2}\right)} \Bigr) \frac{dx}x$
</s>