Looking for a curve for calculating this integral using Residue Theorem I want to prove this equality using Residue Theorem
$$\int_{0}^{\infty}\frac{x}{e^x-e^{-x}}\mathop{dx}=\frac{\pi^2}{8}$$
My Attempt:
I used from variable changing $u=e^x$, However, I'm looking for a good curve which I couldn't find it yet....
 A: If the OP wishes to enforce the substitution $x\mapsto \log(x)$ then we can write
$$\begin{align}
\int_0^\infty \frac{x}{e^x-e^{-x}}\,dx&=\frac12 \int_{-\infty}^\infty \frac{x}{e^x-e^{-x}}\,dx\\\\
&=\frac12 \int_0^\infty \frac{\log(x)}{x^2-1}\,dx\tag1
\end{align}$$

METHODOLOGY $1$:
Now analyze the integral of $f(z)=\frac{\log^2(z)}{z^2-1}$ on the classical keyhole contour $C_R$, where the brach cut is taken along the positive real axis.
Take $R>1$.  The keyhole contour, $C_R$, is comprised of the (i) line segment from $0$ to $R$ on the upper part of the branch cut, (ii) the circular contour $|z|=R$, from $\arg(z)=0$ to $\arg(z) =2\pi$, and (iii) the line segment from $R$ to $0$ on the lower part of the branch cut.  


Note that the singularity at $z=1$ is removable on the upper part of the branch cut.  On the lower part of the branch cut, we need to deform the contour around $z=1-i0^+$.  And there is a pole at $z=-1$ which will give rise to a residue contribution.


Proceeding, we see that 
$$\begin{align}
\oint_{C_R}\frac{\log^2(z)}{z^2-1}\,dz&=\int_0^R \frac{\log^2(x)}{x^2-1}\,dx+\int_0^{2\pi}\frac{\log^2(Re^{i\phi})}{(Re^{i\phi})^2-1}\,iRe^{i\phi}\,d\phi\\\\
&-\text{PV}\int_0^R \frac{(\log(x)+i2\pi)^2}{x^2-1}\,dx-\int_\pi^{2\pi}\frac{\log(e^{i2\pi})^2}{2\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi\\\\
&=4\pi^2 \text{PV}\int_0^R \frac{1}{x^2-1}\,dx-i4\pi\int_0^R \frac{\log(x)}{x^2-1}\,dx\\\\
&+\int_0^{2\pi}\frac{\log^2(Re^{i\phi})}{(Re^{i\phi})^2-1}\,iRe^{i\phi}\,d\phi-\int_\pi^{2\pi}\frac{\log(e^{i2\pi})^2}{2\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi\tag2
\end{align}$$
As $R\to\infty$, both the first integral (a Cauchy Principal Value integral) and the third integral on the right-hand side of $(2)$ approach $0$.  The second integral approaches the integral on the right-hand side of $(1)$.  As $\epsilon\to 0$, the fourth integral on the right-hand side of $(2)$, which comes from integration around the deformation at $z=1-i0^+$, approaches $i2\pi^3$.

Using the residue theorem we have 
$$\begin{align}
\oint_{C_R}\frac{\log^2(z)}{z^2-1}\,dz&=2\pi i \text{Res}\left(\frac{\log^2(z)}{z^2-1}, z=e^{i\pi}\right)\\\\
&=i\pi^3\tag3
\end{align}$$

Putting together $(2)$ and $(3)$
$$\begin{align}
-i4\pi \int_0^\infty \frac{\log(x)}{x^2-1}\,dx+i2\pi^3=i\pi^3
\end{align}$$
whereupon solving for $\int_0^\infty \frac{\log(x)}{x^2-1}\,dx$ we find that 
$$\int_0^\infty \frac{\log(x)}{x^2-1}\,dx=\frac{\pi^2}{4}\tag4$$

Finally, using $(4)$ in $(1)$ yields the coveted result
$$\int_0^\infty \frac{x}{e^x-e^{-x}}\,dx=\frac{\pi^2}8$$

METHODOLOGY $2$:
Take $R>\varepsilon>0$. We now analyze the integral of $f(z)=\frac{\log(z)}{z^2-1}$ on the contour $C_{\varepsilon,R}$ in the first quadrant comprised of the (i) line segment from $\varepsilon$ to $R$, (ii) circular arc from $R$ to $iR$, the line segment from $iR$ to $i \varepsilon$, and (iv) the circular arc from $i\varepsilon$ to $\varepsilon$.
We define $\log(z)$ on the principal branch.  Note that $f$ has a removeable discontinuity at $z=1$ and once removed renders $f$ analytic inside and on $C_{\varepsilon,R}$.  Hence, we see that 
$$\begin{align}
0&=\oint_{C_{\varepsilon,R}}f(z)\,dz\\\\
&=\int_\varepsilon^R \frac{\log(x)}{x^2-1}\,dx+\int_0^{\pi/2}\frac{\log(Re^{i\phi})}{(Re^{i\phi})^2-1}\,iRe^{i\phi}\,d\phi\\\\
&+\int_R^\varepsilon \frac{\log(iy)}{(iy)^2-1}\,i\,dy+\int_{\pi/2}^0 \frac{\log(\varepsilon e^{i\phi})}{(\varepsilon e^{i\phi})^2-1}\,i\varepsilon e^{i\phi}\,d\phi\\\\
&=\int_0^R \frac{\log(x)}{x^2-1}\,dx+\int_0^{\pi/2}\frac{\log(Re^{i\phi})}{(Re^{i\phi})^2-1}\,iRe^{i\phi}\,d\phi\\\\
&+\int_0^R \frac{i\log(y)-\pi/2}{y^2+1}\,i\,dy-\int_0^{\pi/2} \frac{\log(\varepsilon e^{i\phi})}{(\varepsilon e^{i\phi})^2-1}\,i\varepsilon e^{i\phi}\,d\phi\tag5
\end{align}$$
As $R\to \infty$ and $\varepsilon\to0$, the first integral on the right-hand side of $(5)$ is the integral of interest, the second and fourth integrals approache $0$, and the third integral approaches $-\int_0^\infty \frac{\pi/2}{y^2+1}\,dy=-\frac{\pi^2}{4}$.  
Putting it altogether, we find that
$$\int_0^\infty \frac{x}{e^x-e^{-x}}\,dx=\frac{\pi^2}8$$
as was to be shown!
A: Why to use residues when you can write
$$\int_0^{+\infty} \frac{x}{e^x(1 - e^{-2x})}\ \text{d}x = \int_0^{+\infty} xe^{-x} \sum_{k = 0}^{+\infty} e^{-2kx}\ \text{d}x = \sum_{k = 0}^{+\infty}\int_0^{+\infty}x e^{-x(1+2k)}\ \text{d}x = \sum_{k = 0}^{+\infty} \frac{1}{(2 k+1)^2} = \frac{\pi^2}{8}$$
