Evaluate the Integral $$\int \frac{x}{\mathrm{e}^{x}-1} dx$$

This question was posed at Mathematics Stack Exchange, here is my solution.

I = \int \frac{x}{\mathrm{e}^{x}-1} dx = -I_{1} = -\int \frac{x}{1-\mathrm{e}^{x}} dx

Integrate by parts
\begin{align}
I_{1} &= \int \frac{x}{1-\mathrm{e}^{x}} dx \\
\tag{1}
&= x^{2} – x \ln(1-\mathrm{e}^{x}) – \int x dx + \int \ln(1-\mathrm{e}^{x}) dx \\
\tag{2}
&= x^{2} – x \ln(1-\mathrm{e}^{x}) – \frac{x^{2}}{2} – \mathrm{Li}_{2}(\mathrm{e}^{x})
\end{align}
and thus

\int \frac{x}{\mathrm{e}^{x}-1} dx = x \ln(1-\mathrm{e}^{x}) – \frac{x^{2}}{2} + \mathrm{Li}_{2}(\mathrm{e}^{x})

1. Let $$u=\mathrm{e}^{x}$$
\begin{align}
\int \frac{1}{1-\mathrm{e}^{x}} dx &= \int \frac{1}{u(1-u)} du \\
&= \int \left( \frac{1}{u} + \frac{1}{1-u} \right) du \\
&= \ln \frac{u}{1-u} \\
&= x – \ln(1-\mathrm{e}^{x})
\end{align}

2. Let $$u=\mathrm{e}^{x}$$
\begin{align}
\int \ln(1-\mathrm{e}^{x}) dx &= \int \frac{\ln(1-u)}{u} du \\
&= -\mathrm{Li}_{2}(u) \\
&= -\mathrm{Li}_{2}(\mathrm{e}^{x})
\end{align}
where

\mathrm{Li}_{2}(z) = -\int\limits_{0}^{z} \frac{\ln(1-x)}{x} dx

is the dilogarithm function.