# How to compute $\int_0^{\infty} \ln (1 + e^{-x})\, dx$ and $\int_0^{\infty} \ln (1 - e^{-x})\, dx$? [duplicate]

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.

• – Ben Feb 10 '15 at 6:26
• (same method works for $+$ and $-$) – user147263 Feb 20 '15 at 3:35

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.$$

• Beat me to it! Though you should justify the use of the power series for $\ln(1+x)$ and how it applies here. – Cameron Williams Feb 10 '15 at 6:13
• Something is wrong. Looking into it $\frac{3}{4}\frac{\pi^2}{6}=\frac{\pi^2}{8}$ – marwalix Feb 10 '15 at 6:24

Hint. You may integrate by parts, expand the integrand and integrate termwise. \begin{align} \int_0^{\infty} \ln (1 - e^{-x})\, dx&=\left.x\ln (1 - e^{-x})\right|_0^{\infty} -\int_0^{\infty} \frac{x}{1 - e^{-x}} e^{-x}dx\\\\ &=0 -\int_0^{\infty} \frac{x}{1 - e^{-x}}dx\\\\ &=-\int_0^{\infty} x \sum_{n=0}^{\infty}e^{-(n+1)x}dx\\\\ &=-\sum_{n=0}^{\infty}\int_0^{\infty} x \:e^{-(n+1)x}dx\\\\ &=-\sum_{n=0}^{\infty}\frac{1}{(n+1)^2}\\\\ &=-\frac{\pi^2}{6} \end{align} and similarly you get \begin{align} \int_0^{\infty} \ln (1 + e^{-x})\, dx= \sum_{n=0}^{\infty}\frac{(-1)^n}{(n+1)^2}=\frac{\pi^2}{12}. \end{align}

• Thanks. Can you tell me why $\left.x\ln (1 - e^{-x})\right|_0^{\infty} = 0$? – swoopin_swallow Feb 10 '15 at 6:28
• @divingswallow For $x$ near $\infty$, we have $\ln(1-e^{-x})\sim e^{-x}$ and $xe^{-x} \to 0$ and for $x$ near $0^+$ we have $\ln(1-e^{-x})\sim \ln x$ and we use $x\ln x\to 0$. Thanks. – Olivier Oloa Feb 10 '15 at 6:38
• actually when $x$ is close to $\infty$, $\ln(1-e^{-x})\sim -e^{-x}$, right? – swoopin_swallow Feb 11 '15 at 6:24
• @divingswallow Right, I had seen the typo, but the conclusion remains the same. Thanks. – Olivier Oloa Feb 11 '15 at 11:31

Transform $e^{-x}=z$ $$I=\int_{0}^{\infty}\ln (1+e^{-x})dx=\int_{0}^1 \ln(1+z)\frac{dz}{z}\\=\int_{0}^1 \sum_{n\ge 0}(-1)^{n}\frac{z^{n}}{n+1}dz=\sum_{n\ge 0}\frac{(-1)^n}{n+1}\int_{0}^1 z^n dz=\sum_{n\ge 1}\frac{(-1)^{n-1}}{n^2}=\zeta(2)-\frac{\zeta(2)}{4}=\frac{\pi^2}{12}$$The other integral can be evaluated along the same lines.