Daily Mathematics / Solutions
Solutions for 10 October 2026
Two cards went out that day: a hard definite integral and an original Putnam-style problem. Try each one first; the solutions are folded away below.
Integral
A squared logarithm of 1 + x over x

Evaluate in closed form.
\[\int_{0}^{1}\frac{\ln^{2}(1+x)}{x}\,dx\]Show the solution
We show that the integral equals \(\dfrac{\zeta(3)}{4}\). Call it \(A\). It converges: near \(0\) the integrand behaves like \(x\), and it is continuous on \((0,1]\).
Why the direct route stalls. Expanding \(\ln^{2}(1+x)\) in powers of \(x\) produces the alternating Euler sum \(2\sum_{n\ge2}(-1)^{n}H_{n-1}/n^{2}\), whose evaluation is the whole problem. The substitution \(t=1/(1+x)\) instead leads to \(\operatorname{Li}_3(\tfrac12)\), \(\ln^{3}2\) and \(\pi^{2}\ln 2\), all of which must cancel at the end. Neither route shows why the answer is so clean. The trick is to stop looking at \(\ln(1+x)\) alone and to pair it with \(\ln(1-x)\).
Step 1: three companion integrals. Put \(a=\ln(1+x)\), \(b=\ln(1-x)\) and
\[A=\int_0^1\frac{a^{2}}{x}\,dx,\qquad B=\int_0^1\frac{b^{2}}{x}\,dx,\qquad C=\int_0^1\frac{ab}{x}\,dx .\]All three converge: near \(0\) both \(a\) and \(b\) are \(O(x)\), and near \(1\) the factor \(b\) has only a logarithmic singularity, so \(b^{2}\) and \(ab\) are integrable.
Step 2: the value of \(B\). With \(x=1-u\),
\[B=\int_0^1\frac{\ln^{2}u}{1-u}\,du=\sum_{n\ge0}\int_0^1u^{n}\ln^{2}u\,du=\sum_{n\ge0}\frac{2}{(n+1)^{3}}=2\zeta(3),\]where the termwise integration is justified by monotone convergence (every term is nonnegative) and \(\int_0^1u^{n}\ln^{2}u\,du=2/(n+1)^{3}\) follows from two integrations by parts.
Step 3: the sum \(a+b\). Since \(a+b=\ln(1-x^{2})\), the substitution \(u=x^{2}\), \(dx/x=du/(2u)\), gives
\[A+2C+B=\int_0^1\frac{\ln^{2}(1-x^{2})}{x}\,dx=\frac12\int_0^1\frac{\ln^{2}(1-u)}{u}\,du=\frac{B}{2}=\zeta(3).\]Step 4: the difference \(a-b\). Here \(a-b=\ln\frac{1+x}{1-x}\). Put \(t=\frac{1-x}{1+x}\), so \(x=\frac{1-t}{1+t}\), \(dx=-\frac{2\,dt}{(1+t)^{2}}\) and \(\frac{dx}{x}=-\frac{2\,dt}{1-t^{2}}\), while \(x:0\to1\) becomes \(t:1\to0\). Hence
\[A-2C+B=2\int_0^1\frac{\ln^{2}t}{1-t^{2}}\,dt=2\sum_{k\ge0}\frac{2}{(2k+1)^{3}}=4\cdot\frac78\,\zeta(3)=\frac72\,\zeta(3),\]using \(\sum_{k\ge0}(2k+1)^{-3}=(1-2^{-3})\zeta(3)\) and again monotone convergence.
Step 5: solve the linear system. Adding the results of Steps 3 and 4 gives \(2A+2B=\frac92\zeta(3)\), so \(A=\frac94\zeta(3)-B=\frac94\zeta(3)-2\zeta(3)=\frac{\zeta(3)}{4}\). As a by-product, subtracting gives \(C=\int_0^1\frac{\ln(1+x)\ln(1-x)}{x}\,dx=-\frac58\zeta(3)\).
Check. Composite 100-node Gauss-Legendre quadrature on \([0,1]\) with 40 and with 200 panels reproduces \(\zeta(3)/4=0.30051422578989856\ldots\) to within \(2\times10^{-16}\); the companion values \(B=2\zeta(3)\) and \(C=-\frac58\zeta(3)\) were checked the same way, after the substitutions \(u=s^{4}\) and \(x=1-s^{4}\) that tame the logarithmic endpoint singularity, to within \(3\times10^{-15}\).
Competition problem
Compositions into powers of two, modulo 4

Let \(f(n)\) be the number of ways to write the positive integer \(n\) as an ordered sum of powers of \(2\), order mattering. Thus \(f(3)=3\), since
\[3=1+2=2+1=1+1+1.\]Determine all \(n\) with \(f(n)\equiv 3 \pmod{4}\).
Show the solution
We show that \(f(n)\equiv3\pmod4\) exactly when \(n=2^{k}-1\) with \(k\ge2\), that is, for \(n=3,7,15,31,\dots\).
Why the direct route stalls. Splitting a composition by its first part gives \(f(n)=\sum_{2^{j}\le n}f(n-2^{j})\), and the first values are \(1,2,3,6,10,18,31,56\). The data suggest the answer quickly, but an induction on this recurrence modulo \(4\) has to track the residues of all earlier values along a sparse, irregular set of lags, and the even values follow no visible pattern modulo \(4\). We work with the generating function instead, where squaring a sum over powers of \(2\) behaves very well.
Step 1: the generating function. Put \(f(0)=1\) (the empty sum), \(F(x)=\sum_{n\ge0}f(n)x^{n}\) and \(S(x)=\sum_{j\ge0}x^{2^{j}}\). The recurrence above says \(F=1+SF\), that is \((1-S)F=1\) in \(\mathbb Z[[x]]\).
Step 2: an exact identity. Squaring \(S\) separates the diagonal terms from the cross terms:
\[S^{2}=\sum_{j\ge0}x^{2^{j+1}}+2T=S-x+2T,\qquad T=\sum_{0\le i<j}x^{2^{i}+2^{j}} .\]Hence \((1-S)^{2}=1-2S+S^{2}=(1-S)-x+2T\). Multiplying by \(F=(1-S)^{-1}\) gives \(1-S=1-xF+2TF\), that is
\[xF=S+2TF .\]Step 3: parity. Reducing modulo \(2\) gives \(xF\equiv S\), so \(f(m)\) is odd if and only if \(m+1\) is a power of \(2\). This holds for every \(m\ge0\), including \(m=0\).
Step 4: modulo 4. Let \(t_r=1\) if \(r\) has exactly two \(1\)s in binary and \(t_r=0\) otherwise, and let \(s_n=1\) if \(n\) is a power of \(2\) and \(0\) otherwise. Comparing coefficients of \(x^{m+1}\) in Step 2,
\[f(m)=s_{m+1}+2\sum_{r\le m+1}t_r\,f(m+1-r).\]Since \(2y\bmod4\) depends only on the parity of \(y\), Step 3 gives \(f(m)\equiv s_{m+1}+2N(m)\pmod4\), where \(N(m)\) counts the \(r\) with \(t_r=1\) for which \(m+2-r\) is a power of \(2\). If \(m+1\) is not a power of \(2\), then \(f(m)\equiv2N(m)\in\{0,2\}\pmod4\), so \(f(m)\not\equiv3\).
Now let \(m+1=2^{k}\) with \(k\ge1\). The candidates are \(r=2^{k}+1-2^{j}\) with \(0\le j\le k\). For \(j=0\), \(r=2^{k}\) has one \(1\) in binary. For \(j=k\), \(r=1\) has one \(1\). For \(1\le j\le k-1\), \(2^{k}-2^{j}\) consists of \(k-j\) ones followed by \(j\ge1\) zeros, so adding \(1\) gives \(k-j+1\) ones, which equals \(2\) only for \(j=k-1\). Therefore \(N(2^{k}-1)=1\) when \(k\ge2\) and \(N(1)=0\). Consequently \(f(2^{k}-1)\equiv1+2=3\pmod4\) for \(k\ge2\), while \(f(1)=1\). This proves the claim.
Check. The exact values of \(f(n)\) from the recurrence for all \(n\le4100\) satisfy \(f(n)\equiv3\pmod4\) precisely at \(n=3,7,15,\dots,4095\), and they are odd precisely at \(n=2^{k}-1\).