Justification for expanding exp(-x)/(1-exp(-x)) A geometric series $\sum{r^n}$ converges if $|r|<1$. In case $r = e^{-x}$, and needed $\int^b_0{\frac{x e^{-x}}{1-e^{-x}}}dx$ where $b>0$, how can I justify that is legal to make the series expansion for $e^{-x}/(1-e^{-x})$?. I'm asking because the interval of integration includes $x=0$ where the series divergent, $e^0=1=r$, moreover the function inside the integral isn't continuous at $x=0$, the limit as x tends to $0$ exist but the function itself isn't defined at x=0, and that is condition to calculate an integral, I know how to expand it and evaluate the integral, but not why it works if $0$ is in the lower limit.
 A: The expression $\frac{xe^{-x}}{1-e^{-x}}$ has a removable discontinuity at $x=0$.  So, for $x \ne 0$ we can write
$$\frac{xe^{-x}}{1-e^{-x}}=x\sum_{n=1}^{\infty}e^{-nx}$$
Thus, 
$$\begin{align}
\int_0^1 \frac{xe^{-x}}{1-e^{-x}}dx &=\lim_{\epsilon \to 0^+}\int_{\epsilon}^1\frac{xe^{-x}}{1-e^{-x}}dx\\\\
&=\lim_{\epsilon \to 0^+}\sum_{n=1}^{\infty}\int_{\epsilon}^1 xe^{-nx}dx\\\\
&=\lim_{\epsilon \to 0^+}\sum_{n=1}^{\infty}\frac{e^{-n\epsilon}(n\epsilon +1)-e^{-n}(n+1)}{n^2}
\end{align}$$
where uniform convergence of the series on $[\epsilon, 1]$ justified interchanging the integral with the series.  
Now, the series converges uniformly in $\epsilon$ and thus we can interchange the limit with the series to arrive at 
$$\int_0^1 \frac{xe^{-x}}{1-e^{-x}}dx=\sum_{n=1}^{\infty}\frac{1-(n+1)e^{-n}}{n^2}$$
A: I think that the problem is related to what is happening to the integrand close to $x=0$ where it looks like $\frac 00$.
Using l'Hopital, we have for the limits $$\lim_{x \to 0^+}\frac{e^{-x} x}{1-e^{-x}}=\lim_{x \to 0^+}\frac{e^{-x}-e^{-x} x}{e^{-x}}=\lim_{x \to 0^+}(1-x)$$ So the integrand exists at the lower bound.
