How to calculate this improper integral $\int_{0}^{+\infty}\frac{x}{\mathrm{e}^x-1}\mathrm{d}x$? How to calculate this improper integral $\int_{0}^{+\infty}\frac{x}{\mathrm{e}^x-1}\mathrm{d}x$
 A: Hint. One may justify a termwise integration using
$$
\frac{x}{e^x-1}=e^{-x} \cdot\frac{x}{1-e^{-x}}=\sum_{n=0}^\infty xe^{-(n+1)x}
$$ and using an integration by parts to get
$$
\int_0^\infty xe^{-(n+1)x}\:dx=\frac1{(n+1)^2}, \quad n\ge0.
$$
A: Collect $e^x$ at the denominator to obtain:
$$\frac{x}{e^x-1} \to \frac{x}{e^x(1 - e^{-x})} = \frac{x e^{-x}}{1 - e^{-x}}$$
Since the range of the integral is $(0, +\infty)$ we are allowed to use the geometric series for 
$$\frac{1}{1 - e^{-x}} = \sum_{k = 0}^{+\infty} (e^{-x})^k$$
Hence substituting in the integral:
$$\sum_{k = 0}^{+\infty}\int_0^{+\infty} x e^{-x} e^{-kx}\ \text{d}x$$
$$\sum_{k = 0}^{+\infty}\int_0^{+\infty} x e^{-x(1+k)}\ \text{d}x$$
The very last integral is trivial, and it is easily solvable (you can do it by parts for example):
$$\int_0^{+\infty} x e^{-x(1+k)}\ \text{d}x = \frac{1}{(1+k)^2}$$
Hence you get
$$\sum_{k = 0}^{+\infty}\frac{1}{(1+k)^2}$$
Which we can write it also by shifting the sum index from $k = 0$ to $k = 1$, modifying the function:
$$\sum_{k = 1}^{+\infty}\frac{1}{k^2}$$
Which is nothing but the Riemann Zeta Function of $2$:
$$\sum_{k = 1}^{+\infty}\frac{1}{k^2} = \zeta(2) = \frac{\pi^2}{6}$$
Which is the result of your integration.
Hence
$$\boxed{\int_0^{+\infty} \frac{x}{e^x-1}\ \text{d}x = \frac{\pi^2}{6}}$$
Riemann Zeta Function
This special function is defined as
$$\zeta(s) = \sum_{k = 1}^{+\infty} \frac{1}{k^s}$$
