Skip to content
ISEGORIABenjamin Haire

Daily Mathematics / Solutions

Solutions for 4 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 log-Gamma integral against a sine weight

Card: A log-Gamma integral against a sine weight

Evaluate in closed form.

\[\int_0^1 \sin(\pi x)\,\ln\Gamma(x)\,dx\]
Show the solution

Call the integral \(I\). It converges: near \(x=0\) we have \(\ln\Gamma(x)\sim-\ln x\) while \(\sin(\pi x)\sim\pi x\), so the integrand behaves like \(-\pi x\ln x\to0\).

Step 1: reflect. The weight satisfies \(\sin(\pi(1-x))=\sin(\pi x)\), so the substitution \(x\mapsto1-x\) gives \(I=\int_0^1\sin(\pi x)\ln\Gamma(1-x)\,dx\). Adding the two expressions and using Euler's reflection formula \(\Gamma(x)\Gamma(1-x)=\pi/\sin(\pi x)\),

\[2I=\int_0^1\sin(\pi x)\,\ln\frac{\pi}{\sin(\pi x)}\,dx=\ln\pi\int_0^1\sin(\pi x)\,dx-\int_0^1\sin(\pi x)\ln\sin(\pi x)\,dx .\]

The first integral is \(2/\pi\). In the second put \(t=\pi x\):

\[2I=\frac{2\ln\pi}{\pi}-\frac{1}{\pi}J,\qquad J=\int_0^{\pi}\sin t\,\ln\sin t\,dt .\]

Step 2: the log-sine piece. The integrand of \(J\) is symmetric about \(t=\pi/2\), so \(J=2\int_0^{\pi/2}\sin t\ln\sin t\,dt\). Integrate by parts with \(u=\ln\sin t\) and \(dv=\sin t\,dt\), choosing the antiderivative \(v=1-\cos t\) rather than \(-\cos t\). Then the boundary term \((1-\cos t)\ln\sin t\) vanishes at both ends: at \(t=\pi/2\) because \(\ln1=0\), and as \(t\to0\) because \(1-\cos t\sim t^2/2\) beats \(\ln t\). Hence

\[\int_0^{\pi/2}\sin t\ln\sin t\,dt=-\int_0^{\pi/2}\frac{(1-\cos t)\cos t}{\sin t}\,dt=-\int_0^{\pi/2}\frac{\sin t\cos t}{1+\cos t}\,dt,\]

using \((1-\cos t)/\sin t=\sin t/(1+\cos t)\). With \(w=\cos t\) the last integral is \(\int_0^1\frac{w}{1+w}\,dw=1-\ln2\). So \(\int_0^{\pi/2}\sin t\ln\sin t\,dt=\ln2-1\) and \(J=2\ln2-2\).

Step 3: assemble.

\[2I=\frac{2\ln\pi}{\pi}-\frac{2\ln2-2}{\pi}\quad\Longrightarrow\quad I=\frac{1+\ln\pi-\ln2}{\pi}.\]

Numerically \(I\approx0.4620531257\), which agrees with direct Gauss-Legendre quadrature of the original integral to about \(10^{-16}\).

Answer. \(\displaystyle\int_0^1\sin(\pi x)\ln\Gamma(x)\,dx=\frac{1+\ln(\pi/2)}{\pi}\approx0.46205\)

Competition problem

The second moment of a random digraph determinant

Card: The second moment of a random digraph determinant

Let \(A\) be a \(2026\times2026\) matrix with zero diagonal whose off-diagonal entries are independent, each equal to \(0\) or \(1\) with probability \(\tfrac12\). Find

\[\mathbb{E}\bigl[(\det A)^2\bigr].\]
Show the solution

We prove the general statement: for an \(n\times n\) matrix of this kind with \(n\ge2\), \(\mathbb{E}[(\det A)^2]=n\cdot n!/4^n\).

Why the obvious route stalls. Expanding \(\det A\) twice gives a sum over pairs of derangements \((\sigma,\tau)\) of \(\operatorname{sgn}\sigma\operatorname{sgn}\tau\,4^{-n}2^{\#\{i:\sigma(i)=\tau(i)\}}\), and the nonzero mean of the entries keeps almost every pair alive. It is better to average one row at a time.

Step 1: a polarisation identity. Let \(r_1,\dots,r_n\) be the rows of \(A\), written as column vectors; they are independent. For variables \(t_1,\dots,t_n\) put \(D=\operatorname{diag}(t_1,\dots,t_n)\). Then \(\sum_i t_i\,r_ir_i^{\mathsf T}=A^{\mathsf T}DA\), so

\[\det\Bigl(\sum_i t_i\,r_ir_i^{\mathsf T}\Bigr)=(\det A)^2\,t_1t_2\cdots t_n .\]

For matrices \(X_1,\dots,X_n\) let \(F(X_1,\dots,X_n)\) be the coefficient of \(t_1\cdots t_n\) in \(\det(\sum_i t_iX_i)\). Expanding the determinant, each term of that coefficient takes exactly one entry from each \(X_i\), so \(F\) is linear in each argument separately. Since \((\det A)^2=F(r_1r_1^{\mathsf T},\dots,r_nr_n^{\mathsf T})\) and the rows are independent,

\[\mathbb{E}\bigl[(\det A)^2\bigr]=F(M_1,\dots,M_n),\qquad M_i=\mathbb{E}\bigl[r_ir_i^{\mathsf T}\bigr].\]

Step 2: the second-moment matrices. The \((j,k)\) entry of \(M_i\) is \(\mathbb{E}[a_{ij}a_{ik}]\): it is \(0\) if \(j=i\) or \(k=i\), it is \(\tfrac12\) if \(j=k\ne i\), and \(\tfrac14\) if \(j\ne k\) and both differ from \(i\). Write \(T=\sum_i t_i\), \(q=\sum_i t_i^2\), \(\mathbf 1\) for the all-ones vector and \(t=(t_i)\). Then \(N=\sum_i t_iM_i\) has diagonal entries \(\tfrac12(T-t_j)\) and off-diagonal entries \(\tfrac14(T-t_j-t_k)\), that is,

\[4N=T\,I+u\mathbf 1^{\mathsf T}-\mathbf 1t^{\mathsf T},\qquad u=T\mathbf 1-t .\]

Step 3: a rank-two determinant. With the \(n\times2\) matrices \(X=[u\ \ \mathbf 1]\) and \(Y=[\mathbf 1\ \ {-t}]\) we have \(4N=TI+XY^{\mathsf T}\), and the matrix determinant lemma gives \(\det(4N)=T^n\det(I_2+Y^{\mathsf T}X/T)\). The needed inner products are \(\mathbf 1^{\mathsf T}u=(n-1)T\), \(\mathbf 1^{\mathsf T}\mathbf 1=n\), \(t^{\mathsf T}u=T^2-q\) and \(t^{\mathsf T}\mathbf 1=T\), so

\[I_2+\frac{Y^{\mathsf T}X}{T}=\begin{pmatrix}n&n/T\\-(T^2-q)/T&0\end{pmatrix},\qquad \det(4N)=nT^{\,n-2}(T^2-q)=2n\,e_1^{\,n-2}e_2,\]

where \(e_1=T\) and \(e_2=\sum_{i<j}t_it_j=\tfrac12(T^2-q)\). Both sides are polynomials, so this is a polynomial identity.

Step 4: read off the coefficient. In \(e_1^{\,n-2}e_2\) the monomial \(t_1\cdots t_n\) arises by choosing a pair from \(e_2\) in \(\binom n2\) ways and the remaining \(n-2\) variables in order from \(e_1^{\,n-2}\) in \((n-2)!\) ways, so its coefficient is \(n!/2\). Therefore the coefficient of \(t_1\cdots t_n\) in \(\det(4N)\) is \(n\cdot n!\), and in \(\det N\) it is \(n\cdot n!/4^n\).

A second view. Averaging over \(\tau\) for fixed \(\sigma\) turns the derangement sum into \(4^{-n}\sum_\sigma\operatorname{sgn}\sigma\det(J-I+P_\sigma)\), where \(P_\sigma\) is the permutation matrix. By the matrix determinant lemma and the spectrum of a cyclic permutation, \(\det(J-I+P_\sigma)\) vanishes unless \(\sigma\) is a single \(n\)-cycle, when it equals \(\operatorname{sgn}\sigma\cdot n^2\). There are \((n-1)!\) such cycles, which again gives \(n^2(n-1)!/4^n=n\cdot n!/4^n\).

The formula agrees with exact enumeration for \(n=2,\dots,8\) (values \(4,18,96,600,4320,35280,322560\) after multiplying by \(4^n\)) and with a Monte Carlo estimate for \(n=6\). For \(n=1\) the expectation is \(0\), because the only permutation is the identity, which is not a derangement.

Answer. \(\displaystyle\mathbb{E}\bigl[(\det A)^2\bigr]=\frac{2026\cdot2026!}{4^{2026}}\), and in general \(n\cdot n!/4^n\) for \(n\ge2\).

All solutions · 日本語