How to compute $\int_0^{\infty} \ln (1 + e^{-x})\, dx$ and $\int_0^{\infty} \ln (1 - e^{-x})\, dx$? Bierenes de Haan's book (page 377) shows that $\int_0^{\infty} \ln (1 + e^{-x})\, dx = \frac{\pi^2}{12}$, and  $\int_0^{\infty} \ln (1 - e^{-x})\, dx = -\frac{\pi^2}{6}$. Anybody know how to compute them? Thanks.

Using the Maclaurin series for $\ln(1 + x)$, we have 
\begin{align}\int_0^\infty\ln(1 + e^{-x})\, dx &= \int_0^\infty \sum_{n = 1}^\infty (-1)^{n-1}\frac{e^{-nx}}{n}\, dx \\
&= \sum_{n = 1}^\infty \frac{(-1)^{n-1}}{n}\int_0^\infty e^{-nx}\, dx\\
& = \sum_{n = 1}^\infty \frac{(-1)^{n-1}}{n}\cdot\frac{1}{n}\\
& = \sum_{n = 1}^\infty \frac{(-1)^{n-1}}{n^2}\\
& = \sum_{n = 1}^\infty \frac{1}{(2n-1)^2} - \sum_{n = 1}^\infty \frac{1}{(2n)^2}\\
&= \sum_{n = 1}^\infty \frac{1}{n^2} - 2\sum_{n = 1}^\infty \frac{1}{(2n)^2}\\
&= \frac{1}{2}\sum_{n = 1}^\infty \frac{1}{n^2}\\
&= \frac{1}{2}\cdot\frac{\pi^2}{6}\\
&= \frac{\pi^2}{12}.
\end{align}
A similar method works for the second integral.
\begin{align}
\int_0^\infty \ln(1 - e^{-x})\, dx &= \int_0^\infty -\sum_{n = 1}^\infty \frac{e^{-nx}}{n}\, dx\\
&= - \sum_{n = 1}^\infty \frac{1}{n}\int_0^\infty e^{-nx}\, dx\\
&= -\sum_{n = 1}^\infty \frac{1}{n}\cdot\frac{1}{n}\\
&= -\sum_{n = 1}^\infty \frac{1}{n^2}\\
&= -\frac{\pi^2}{6}.
\end{align}
The interchange of series and integral are justified for the first integral since  $$\sum_{n = 1}^\infty \int_0^\infty \left|\frac{(-1)^{n-1}e^{-nx}}{n}\right|\, dx = \sum_{n = 1}^\infty \int_0^\infty \frac{e^{-nx}}{n}\ dx = \sum_{n = 1}^\infty \frac{1}{n^2} < \infty,$$ and for the second integral since similarly $$\sum_{n = 1}^\infty \int_0^\infty \left|\frac{e^{-nx}}{n}\right|\, dx = \sum_{n = 1}^\infty \frac{1}{n^2} < \infty.$$
