TITLE: Finding the integral of $\frac{x}{e^x + 1}$
QUESTION [6 upvotes]: I've having some difficulty with finding this integral:
$$ \int_0 ^{\infty} \frac{x}{e^x + 1}$$
Now usually I would use the monotone convergence theorem to write (using geometric series):
$$f_n (x) = \sum_0 ^n (-1)^k x e^{-(k+1)x},$$
but this isn't a sequence of positive terms, so how do we justify moving the integral inside?
Thanks.

REPLY [5 votes]: Let us generalize the problem, we will evaluate
$$
\int_0 ^{\infty} \frac{x^{s-1}}{e^x + 1}\ dx.
$$
Rewrite the integral above as
\begin{align}
\int_0 ^{\infty} x^{s-1}\cdot\frac{e^{-x}}{1+e^{-x}}\ dx&=\int_0 ^{\infty} x^{s-1}\cdot\sum_{n=1}^\infty(-1)^{n-1}e^{-nx} \ dx\\
&=\sum_{n=1}^\infty(-1)^{n-1}\int_{x=0}^{\infty} x^{s-1} e^{-nx} \ dx\quad;\quad\text{let }u=nx\\
&=\color{blue}{\sum_{n=1}^\infty(-1)^{n-1}\frac1{n^s}}\color{red}{\int_{u=0}^{\infty} u^{s-1} e^{-u} \ du}\\
&=\color{blue}{\eta(s)}\color{red}{\Gamma(s)},
\end{align}
where $\color{blue}{\eta(s)}$ is the Dirichlet eta function and $\color{red}{\Gamma(s)}$ is the gamma function.
In our case, we have $s=2$. Hence
$$
\int_0 ^{\infty} \frac{x}{e^x + 1}\ dx=\eta(2)\Gamma(2)=\large\color{blue}{\frac{\pi^2}{12}}.
$$