Solution (source code)

= Solution

The <function> is <continuous> and nonnegative, bounded above by $x$ on $(0,1)$ and by $xe^{-x}$ on $(1,\infty)$, so it is integrable. For $x>0$ the <geometric series> gives
$$
\frac{x}{e^x+1}=\sum_{n=1}^\infty(-1)^{n-1}xe^{-nx}.
$$
The series is absolutely summable in integral because
$$
\sum_{n=1}^\infty\int_0^\infty xe^{-nx}\,dx
=\sum_{n=1}^\infty\frac1{n^2}<\infty.
$$
Each integral follows by substituting $t=nx$ and integrating $te^{-t}$ by parts. <Tonelli's theorem> applied to the absolute terms, followed by <Fubini's theorem>, therefore justifies termwise integration and gives
$$
\boxed{\int_0^\infty\frac{x}{e^x+1}\,dx=\sum_{n=1}^\infty\frac{(-1)^{n-1}}{n^2}}.
$$