How to evaluate $\int_0^{\infty} \bigg(\frac{e^{-x}}{\sinh(x)} - \frac{e^{-3x}}{x}\bigg) \; dx$ Evaluate the integral below
$$\int_0^{\infty} \bigg(\frac{e^{-x}}{\sinh(x)} - \frac{e^{-3x}}{x}\bigg) \; dx$$
Using Wolfram I get the integral is $\gamma + \log\bigg(\frac{3}{2}\bigg)$, where $\gamma$ is The Euler-Mascheroni constant.
I split the integral into two parts. For the first one, I tried to use $\sinh(x) = \frac{e^{x}-e^{-x}}{2}=\frac{e^{-x}}{2}(\frac{e^{2x}-1}{2})$ and the first integral became
$$\int_0^{\infty} \frac{2}{e^{2x}-1} \; dx=\int_0^{\infty} \frac{2e^{-2x}}{1-e^{-2x}} \; dx$$
Then, I use substitution $u=1-e^{-2x}$.
$$\int_0^{\infty} \frac{2e^{-2x}}{1-e^{-2x}} \; dx=-4\int_0^{1} \frac{du}{u} = -4\ln u\;\bigg|_0^1 = \infty$$
The second integral also diverges. Where I made a mistake? How is the way to get a result like Wolfram output?
 A: The problem with your approach is that you have some sophisticated cancelations that needs to be taken care of more carefully.
What I am saying is that you want to use the integral representation of the Digamma function for $s>0$ $$\psi(s) =\int_{0}^{\infty}{\frac{e^{-x}}{x}-\frac{e^{-sx}}{1-e^{-x}}dx}$$ Then you want to rewrite your integral $I$ in this following sense $$\begin{align*}I&=\int_{0}^{\infty}{\left(2\frac{e^{-2x}}{1-e^{-2x}}-3\frac{e^{-3x}}{3x}\right)dx}\\&=\int_{0}^{\infty}{\left[\left(2\frac{e^{-2x}}{1-e^{-2x}}-3\frac{e^{-3x}}{1-e^{-3x}}\right)-3\left(\frac{e^{-3x}}{3x}-\frac{e^{-3x}}{1-e^{-3x}}\right)\right]dx}\\&=\int_{0}^{\infty}{\left(2\frac{e^{-2x}}{1-e^{-2x}}-3\frac{e^{-3x}}{1-e^{-3x}}\right)dx}-\psi(1)\end{align*}$$
The first integral can be shown to evaluate at $\log\left(\frac{3}{2}\right)$ by the substitution $e^{-x}=u$. Combining the results we have that $$I=\log\left(\frac{3}{2}\right)-\psi(1)=\log\left(\frac{3}{2}\right)+\gamma$$
A: Let $u=e^{-x}$, then
\begin{align}
\int^\infty_0\left(\frac{2e^{-x}}{e^{x}-e^{-x}}-\frac{e^{-3x}}{x}\right){\rm d}x
=&\int^1_0\left(\frac{2u}{1-u^2}+\frac{u^2}{\ln{u}}\right){\rm d}u
\end{align}
Denote 
$$\mathcal{I}(a)=\int^1_0\left(\frac{2u}{1-u^2}+\frac{u^2}{\ln{u}}\right)u^a\ {\rm d}u$$
Differentiating under the integral sign, we get
\begin{align}
\mathcal{I}'(a)
=&\int^1_0\left(\frac{2u^{a+1}\ln{u}}{1-u^2}+u^{a+2}\right){\rm d}u\\
=&\frac{1}{a+3}+2\sum^\infty_{n=0}\int^1_0u^{2n+a+1}\ln{u}\ {\rm d}u\\
=&\frac{1}{a+3}-2\sum^\infty_{n=0}\frac{1}{(2n+a+2)^2}\\
=&\frac{1}{a+3}-\frac{1}{2}\psi_1\left(\frac{a+2}{2}\right)
\end{align}
Integrating back,
\begin{align}
\mathcal{I}(a)=\ln(a+3)-\psi_0\left(\frac{a+2}{2}\right)+C
\end{align}
where
\begin{align}
C=\lim_{a\to\infty}\left[\psi_0\left(\frac{a+2}{2}\right)-\ln(a+3)\right]
\end{align}
and by Stirling's formula, we know that $\psi_0(z)\sim \ln{z}$ for large $z$. So
\begin{align}
C=\lim_{a\to\infty}\left[\ln\left(\frac{a+2}{a+3}\right)-\ln{2}\right]=-\ln{2}
\end{align}
and therefore,
$$\int^\infty_0\left(\frac{2e^{-x}}{e^{x}-e^{-x}}-\frac{e^{-3x}}{x}\right){\rm d}x=\mathcal{I}(0)=\gamma+\ln\left(\frac{3}{2}\right)$$
