Putnam 2005, Problem A-5

Evaluate $\int_0^1 \frac{\ln(x+1)}{x^2 + 1} dx$.

Solution:
First solution: We make the substitution \(x = \tan\theta\), rewriting the desired integral as
\[
\int_0^{\pi/4} \log(\tan\theta + 1) d\theta.
\]
Write
\[
\log(\tan\theta + 1) = \log(\sin\theta + \cos\theta) - \log(\cos\theta)
\]
and then note that \(\sin\theta + \cos\theta = \sqrt{2}\cos(\pi/4 - \theta)\). We may thus rewrite the integrand as
\[
\frac{1}{2}\log(2) + \log(\cos(\pi/4 - \theta)) - \log(\cos\theta).
\]
But over the interval \([0,\pi/4]\), the integrals of \(\log(\cos\theta)\) and \(\log(\cos(\pi/4 - \theta))\) are equal, so their contributions cancel out. The desired integral is then just the integral of \(\frac{1}{2}\log(2)\) over the interval \([0,\pi/4]\), which is \(\pi \log(2)/8\).

Second solution: (by Roger Nelsen) Let \(I\) denote the desired integral. We make the substitution \(x = (1 - u)/(1 + u)\) to obtain
\[
I = \int_0^1 \frac{(1 + u)^2 \log(2/(1 + u))}{2(1 + u^2)} \frac{2du}{(1 + u)^2} = \int_0^1 \frac{\log(2) - \log(1 + u)}{1 + u^2} du = \log(2) \int_0^1 \frac{du}{1 + u^2} - I,
\]
yielding
\[
I = \frac{1}{2}\log(2) \int_0^1 \frac{du}{1 + u^2} = \frac{\pi \log(2)}{8}.
\]

Third solution: (attributed to Steven Sivek) Define the function
\[
f(t) = \int_0^1 \frac{\log(xt + 1)}{x^2 + 1} dx
\]
so that \(f(0) = 0\) and the desired integral is \(f(1)\). Then by differentiation under the integral,
\[
f'(t) = \int_0^1 \frac{x}{(xt + 1)(x^2 + 1)} dx.
\]
By partial fractions, we obtain
\[
f'(t) = \frac{2t \arctan(x) - 2\log(tx + 1) + \log(x^2 + 1)}{2(t^2 + 1)} \bigg|_{x=0}^{x=1} = \frac{\pi t + 2\log(2) - 4\log(t + 1)}{4(t^2 + 1)},
\]
whence
\[
f(t) = \frac{\log(2)\arctan(t)}{2} + \frac{\pi \log(t^2 + 1)}{8} - \int_0^t \frac{\log(t + 1)}{t^2 + 1} dt
\]
and hence
\[
f(1) = \frac{\pi \log(2)}{4} - \int_0^1 \frac{\log(t + 1)}{t^2 + 1} dt.
\]
But the integral on the right is again the desired integral \(f(1)\), so we may move it to the left to obtain
\[
2f(1) = \frac{\pi \log(2)}{4}
\]
and hence \(f(1) = \pi \log(2)/8\) as desired.

Fourth solution: (by David Rusin) We have
\[
\int_0^1 \frac{\log(x + 1)}{x^2 + 1} dx = \int_0^1 \left( \sum_{n=1}^\infty \frac{(-1)^{n-1}x^n}{n(x^2 + 1)} \right) dx.
\]
We next justify moving the sum through the integral sign. Note that
\[
\sum_{n=1}^\infty \int_0^1 \frac{(-1)^{n-1}x^n dx}{n(x^2 + 1)}
\]
is an alternating series whose terms strictly decrease to zero, so it converges. Moreover, its partial sums alternately bound the previous integral above and below, so the sum of the series coincides with the integral. Put
\[
J_n = \int_0^1 \frac{x^n dx}{x^2 + 1},
\]
then \(J_0 = \arctan(1) = \pi/4\) and \(J_1 = \frac{1}{2}\log(2)\). Moreover,
\[
J_n + J_{n+2} = \int_0^1 x^n dx = \frac{1}{n + 1}.
\]
Write
\[
A_m = \sum_{i=1}^m \frac{(-1)^{i-1}}{2i - 1}, \quad B_m = \sum_{i=1}^m \frac{(-1)^{i-1}}{2i};
\]
then
\[
J_{2n} = (-1)^n (J_0 - A_n), \quad J_{2n+1} = (-1)^n (J_1 - B_n).
\]
Now the \(2N\)-th partial sum of our series equals
\[
\sum_{n=1}^N \left[ \frac{J_{2n-1}}{2n - 1} - \frac{J_{2n}}{2n} \right] = \sum_{n=1}^N \frac{(-1)^{n-1}}{2n - 1} \left[ (J_1 - B_{n-1}) - \frac{(-1)^n}{2n} (J_0 - A_n) \right] = A_N (J_1 - B_{N-1}) + B_N (J_0 - A_N) + A_N B_N.
\]
As \(N \to \infty\), \(A_N \to J_0\) and \(B_N \to J_1\), so the sum tends to \(J_0 J_1 = \pi \log(2)/8\).

Fifth solution: (suggested by Alin Bostan) Note that
\[
\log(1 + x) = \int_0^1 \frac{x dy}{1 + xy},
\]
so the desired integral \(I\) may be written as
\[
I = \int_0^1 \int_0^1 \frac{x dy dx}{(1 + xy)(1 + x^2)}.
\]
We may interchange \(x\) and \(y\) in this expression, then use Fubini's theorem to interchange the order of summation, to obtain
\[
I = \int_0^1 \int_0^1 \frac{y dy dx}{(1 + xy)(1 + y^2)}.
\]
We then add these expressions to obtain
\[
2I = \int_0^1 \int_0^1 \left( \frac{x}{1 + x^2} + \frac{y}{1 + y^2} \right) \frac{dy dx}{1 + xy} = \int_0^1 \int_0^1 \frac{x + y + xy^2 + x^2 y}{(1 + x^2)(1 + y^2)} \frac{dy dx}{1 + xy} = \int_0^1 \int_0^1 \frac{(x + y) dy dx}{(1 + x^2)(1 + y^2)}.
\]
By another symmetry argument, we have
\[
2I = 2 \int_0^1 \int_0^1 \frac{x dy dx}{(1 + x^2)(1 + y^2)},
\]
so
\[
I = \left( \int_0^1 \frac{x dx}{1 + x^2} \right) \left( \int_0^1 \frac{1}{1 + y^2} \right) = \log(2) \cdot \frac{\pi}{8}.
\]

Remarks: The first two solutions are related by the fact that if \(x = \tan\theta\), then \(1 - x/(1 + x) = \tan(\pi/4 - \theta)\). The strategy of the third solution (introducing a parameter then differentiating it) was a favorite of physics Nobelist (and Putnam Fellow) Richard Feynman. The fifth solution resembles Gauss's evaluation of \(\int_0^\infty \exp(-x^2) dx\). Noam Elkies notes that this integral is number 2.491#8 in Gradshteyn and Ryzhik, Table of integrals, series, and products. The Mathematica computer algebra system (version 5.2) successfully computes this integral, but we do not know how.