TITLE: Integral of $x/(e^x-1)$
QUESTION [5 upvotes]: Problem: Let $f_1(x)=\dfrac{x}{e^x-1}, f_2(x)=\dfrac{x}{e^x+1}$. Show that $f_1,f_2$ are Lebesgue-integrable and $\int_{(0,\infty)}f_1 d\lambda=\sum_{n\in\mathbb{N}}\dfrac{1}{n^2}$
  $\int_{(0,\infty)}f_2 d\lambda=\sum_{n\in\mathbb{N}}(-1)^{n+1}\dfrac{1}{n^2}$.

My ideas: We were given the hint that $\dfrac{e^{-x}}{1-e^{-x}}=\sum_{n=1}^\infty e^{-nx}$. I see that $f_1(x)=\dfrac{x}{e^x-1}=\dfrac{xe^{-x}}{1-e^{-x}}$ but I don't know how to go from here or how to prove the hint.

REPLY [5 votes]: (1) Regarding the hint, note that for $x > 0$ we have $\exp(-x) \in (0,1)$ and hence by the geometric series
$$ \sum_{n=0}^\infty \exp(-x)^n = \frac 1{1-\exp(-x)} $$
and so 
$$ \sum_{n=1}^\infty \exp(-nx)=\sum_{n=1}^\infty \exp(-x)^n = \frac 1{1-\exp(-x)} - 1 = \frac{\exp(-x)}{1-\exp(-x)}. $$
(2) Integrating termwise, as 
$$ \int_0^\infty x\exp(-nx)\,dx = \frac 1{n^2} $$
by partial integration, this gives the first integral. 
(3) For the second integral note that 
$$ \frac 1{1 + \exp(-x)} = \sum_{n=0}^\infty \bigl(-\exp(-x)\bigr)^n 
  = \sum_{n=0}^\infty (-1)^n \exp(-nx) $$
and continue as above.