How to integrate $\frac{x}{e^x - 1}$ w.r.t. x? A friend of mine and I wanted to solve the following indefinite integral but got stuck:
$$
\int \frac{x}{e^x - 1} dx.
$$
My approach:
Let 
$$
I = \int \frac{x}{e^x - 1} dx.\\
\implies I = x\int \frac{dx}{e^x - 1} - \int \left ( \int \frac{dx}{e^x - 1} \right ) dx.
$$
Now, let $I_2 = \int \frac{dx}{e^x - 1}$. Also, let $z = e^x \implies dx = {dz \over z}$. Then,
$$
I_2 = \int \frac{dz}{z(z-1)} \\
\implies I_2 = \int {dz \over {z - 1}} - \int {dz \over z} \\
\implies I_2 = \ln (e^x - 1) - x.
$$
Substituting the value of $I_2$ in $I$, we get,
$$
I = x[\ln (e^x - 1) - x] + {x^2 \over 2} - \int \ln (e^x - 1) dx.
$$
I got stuck right here. Is it possible to proceed further?
 A: The antiderivative is not an elementary function: it can be written as
$$ -\frac{{x}^{2}}{2}+x\ln  \left( 1-{{\rm e}^{x}} \right) +{\it dilog}
 \left( 1-{{\rm e}^{x}} \right)
$$
A: \begin{equation}
I = \int \frac{x}{\mathrm{e}^{x}-1} dx = -I_{1} = -\int \frac{x}{1-\mathrm{e}^{x}} dx
\end{equation}
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
\begin{equation}
\int \frac{x}{\mathrm{e}^{x}-1} dx = x \ln(1-\mathrm{e}^{x}) - \frac{x^{2}}{2} + \mathrm{Li}_{2}(\mathrm{e}^{x}) 
\end{equation}


*

*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}

*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
\begin{equation}
\mathrm{Li}_{2}(z) = -\int\limits_{0}^{z} \frac{\ln(1-x)}{x} dx
\end{equation}
is the dilogarithm function.
