Daily Mathematics / Solutions
Solutions for 7 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 trigonometric integral with a logarithmic denominator

Evaluate in closed form.
\[\int_0^{\pi/2}\frac{x\sin 2x-\cos 2x\,\ln(2\cos x)}{x^2+\ln^2(2\cos x)}\,dx\]Show the solution
Call the integral \(I\) and write \(L(x)=\ln(2\cos x)\). The integrand is continuous on \([0,\pi/2)\): the denominator \(x^2+L^2\) is positive for \(x>0\), and at \(x=0\) it equals \(\ln^2 2\). As \(x\to\pi/2^-\) we have \(L\to-\infty\), so the integrand behaves like \(-\cos 2x/L\to0\). Hence it is bounded and \(I\) exists. There is no usable antiderivative, and real substitutions such as \(t=\tan x\) or \(u=2\cos x\) only move the logarithm around. The way in is to notice that the denominator is a squared modulus, \(x^2+L^2=|L+ix|^2\), and that \(L+ix\) is itself a single complex logarithm.
Step 1: the integrand is the real part of one complex function. For \(|x|<\pi/2\),
\[1+e^{2ix}=e^{ix}\bigl(e^{-ix}+e^{ix}\bigr)=2\cos x\;e^{ix},\]with \(2\cos x>0\) and \(|x|<\pi\), so the principal logarithm is \(\operatorname{Log}(1+e^{2ix})=L(x)+ix\). Therefore
\[\frac{e^{-2ix}}{\operatorname{Log}(1+e^{2ix})}=\frac{(\cos 2x-i\sin 2x)(L-ix)}{L^2+x^2},\qquad \operatorname{Re}\frac{e^{-2ix}}{\operatorname{Log}(1+e^{2ix})}=\frac{L\cos 2x-x\sin 2x}{x^2+L^2}.\]This is minus our integrand. It is an even function of \(x\) (since \(L\) is even), so
\[I=-\frac12\,\operatorname{Re}\int_{-\pi/2}^{\pi/2}\frac{e^{-2ix}\,dx}{\operatorname{Log}(1+e^{2ix})}.\]Step 2: a contour integral. Put \(g(z)=\dfrac{1}{z^2\operatorname{Log}(1+z)}\). For \(|z|<1\) we have \(\operatorname{Re}(1+z)>0\), so \(\operatorname{Log}(1+z)\) is analytic there, and it vanishes only at \(z=0\). Thus \(g\) is analytic in the punctured unit disc. Near \(0\), \(\operatorname{Log}(1+z)=z-\frac{z^2}{2}+\frac{z^3}{3}-\cdots\). Solving \(\bigl(1-\frac z2+\frac{z^2}{3}-\cdots\bigr)\bigl(1+az+bz^2+\cdots\bigr)=1\) gives \(a=\frac12\) and \(b=\frac a2-\frac13=-\frac1{12}\), so
\[\frac{z}{\operatorname{Log}(1+z)}=1+\frac z2-\frac{z^2}{12}+O(z^3),\qquad g(z)=\frac{1}{z^3}\Bigl(1+\frac z2-\frac{z^2}{12}+\cdots\Bigr).\]The residue of \(g\) at \(0\) is the Gregory coefficient \(-\frac1{12}\). By the residue theorem, for every \(0<r<1\),
\[\oint_{|z|=r}g(z)\,dz=2\pi i\cdot\Bigl(-\frac1{12}\Bigr)=-\frac{\pi i}{6}.\]Step 3: let the circle grow to radius 1. With \(z=re^{i\theta}\), \(-\pi<\theta<\pi\), the integral equals \(\frac ir\int_{-\pi}^{\pi}\frac{e^{-i\theta}\,d\theta}{\operatorname{Log}(1+re^{i\theta})}\). On the set \(\frac12\le|z|\le1\), \(z\ne-1\), the function \(|\operatorname{Log}(1+z)|\) is continuous and never zero, and it tends to \(+\infty\) as \(z\to-1\) (its real part is \(\ln|1+z|\)). So it is bounded below by some \(\delta>0\) there. The integrands are therefore bounded by \(2/\delta\) for \(r\ge\frac12\), and they converge pointwise for \(\theta\ne\pm\pi\). By dominated convergence,
\[i\int_{-\pi}^{\pi}\frac{e^{-i\theta}\,d\theta}{\operatorname{Log}(1+e^{i\theta})}=-\frac{\pi i}{6},\qquad\text{so}\qquad\int_{-\pi}^{\pi}\frac{e^{-i\theta}\,d\theta}{\operatorname{Log}(1+e^{i\theta})}=-\frac{\pi}{6}.\]Step 4: back to the real line. Substitute \(\theta=2x\). Then \(d\theta=2\,dx\), and \(x\) runs over \((-\pi/2,\pi/2)\), which is exactly where Step 1 applies:
\[\int_{-\pi/2}^{\pi/2}\frac{e^{-2ix}\,dx}{\operatorname{Log}(1+e^{2ix})}=-\frac{\pi}{12}.\](The imaginary part vanishes, as it must, because the imaginary part of the integrand is odd.) By Step 1,
\[I=-\frac12\cdot\Bigl(-\frac{\pi}{12}\Bigr)=\frac{\pi}{24}.\]The same argument with \(1/(z\operatorname{Log}(1+z))\), whose residue is \(\frac12\), gives the companion value \(\int_0^{\pi/2}\frac{\ln(2\cos x)}{x^2+\ln^2(2\cos x)}\,dx=\frac{\pi}{4}\).
Numerical check. Composite 120-node Gauss-Legendre quadrature on \([0,\pi/2-\frac12]\), plus the end piece mapped by \(x=\pi/2-e^{-s}\) and \(s=\ln2+v/(1-v)\), with 40 and with 200 panels, gives \(0.13089969389957\ldots\). This agrees with \(\pi/24\) to within \(6\times10^{-17}\). The companion value \(\pi/4\) was confirmed to \(10^{-16}\).
Competition problem
Inverting a matrix of Beta integrals

Let \(n\) be a positive integer and let \(A\) be the \(n\times n\) matrix with entries
\[a_{ij}=\frac{i!\,j!}{(i+j+1)!}\qquad(0\le i,j\le n-1).\]Prove that \(A\) is invertible and find the sum of all \(n^2\) entries of \(A^{-1}\).
Show the solution
We show that the sum is \((-1)^{n-1}n\). For instance, when \(n=2\), \(A=\begin{pmatrix}1&1/2\\1/2&1/6\end{pmatrix}\) and \(A^{-1}=\begin{pmatrix}-2&6\\6&-12\end{pmatrix}\), whose entries sum to \(-2\).
Why the direct route stalls. \(A\) looks like a cousin of the Hilbert matrix, but it is not a Cauchy matrix, so there is no ready-made closed form for its inverse. Row reduction produces entries with no visible pattern. The trick is to stop looking at \(A\) as an array of numbers and to read it as a pairing between two bases of a space of polynomials.
Step 1: every entry is a Beta integral. By Euler's Beta integral, \(\int_0^1x^i(1-x)^j\,dx=B(i+1,j+1)=\frac{i!\,j!}{(i+j+1)!}\). Let \(V\) be the space of real polynomials of degree at most \(n-1\), with inner product \(\langle f,g\rangle=\int_0^1fg\,dx\). Then
\[a_{ij}=\bigl\langle x^i,(1-x)^j\bigr\rangle .\]Both \(\{x^i\}_{i<n}\) and \(\{(1-x)^j\}_{j<n}\) are bases of \(V\).
Step 2: invertibility. Suppose \(Ay=0\) and put \(q=\sum_jy_j(1-x)^j\in V\). Then \(\langle x^i,q\rangle=0\) for every \(i<n\). Since the \(x^i\) span \(V\), this gives \(\langle q,q\rangle=0\), so \(q=0\). Then \(y=0\), because the \((1-x)^j\) are linearly independent. Hence \(A\) is invertible.
Step 3: the sum of the entries is one point value. Let \(\mathbf 1\) be the all-ones vector, let \(y=A^{-1}\mathbf 1\), and put \(q(x)=\sum_jy_j(1-x)^j\). The sum of all entries of \(A^{-1}\) is \(\mathbf 1^{\mathsf T}A^{-1}\mathbf 1=\sum_jy_j=q(0)\). The equations \(Ay=\mathbf 1\) say that \(\langle x^i,q\rangle=1\) for every \(i<n\), and \(1\) is the value of \(x^i\) at \(x=1\). By linearity,
\[\int_0^1r(x)\,q(x)\,dx=r(1)\qquad\text{for every }r\in V.\]So \(q\) is the reproducing kernel of \(V\) at the point \(1\). By the argument of Step 2, there is at most one element of \(V\) with this property.
Step 4: the shifted Legendre polynomials. For \(k\ge0\), put \(u_k(x)=x^k(x-1)^k\) and \(\widetilde P_k=\frac1{k!}\,u_k^{(k)}\). This is a polynomial of degree exactly \(k\), so \(\widetilde P_0,\dots,\widetilde P_{n-1}\) form a basis of \(V\). We need four facts.
(a) Orthogonality. \(u_k\) and its first \(k-1\) derivatives vanish at \(0\) and at \(1\). So for \(m<k\), integrating by parts \(k\) times moves all the derivatives onto \(\widetilde P_m\), which is killed by them. This gives \(\langle\widetilde P_m,\widetilde P_k\rangle=0\).
(b) Norm. The same integration by parts gives \(\langle\widetilde P_k,\widetilde P_k\rangle=\frac{(-1)^k}{k!^2}\int_0^1u_k\,u_k^{(2k)}=\frac{(2k)!}{k!^2}\int_0^1x^k(1-x)^k\,dx=\frac{(2k)!}{k!^2}\cdot\frac{k!^2}{(2k+1)!}=\frac1{2k+1}\).
(c) Value at 1. By Leibniz's rule, the only term of \(u_k^{(k)}\) that survives at \(x=1\) is the one in which all \(k\) derivatives fall on \((x-1)^k\). That term is \(k!\,x^k\), so \(\widetilde P_k(1)=1\).
(d) Value at 0. Since \(u_k(1-x)=u_k(x)\), we get \(\widetilde P_k(1-x)=(-1)^k\widetilde P_k(x)\), and hence \(\widetilde P_k(0)=(-1)^k\).
Step 5: the kernel and the answer. Put \(q^*=\sum_{k=0}^{n-1}(2k+1)\widetilde P_k\in V\). For each \(m<n\), (a), (b) and (c) give \(\langle\widetilde P_m,q^*\rangle=(2m+1)\cdot\frac1{2m+1}=1=\widetilde P_m(1)\). By linearity \(\langle r,q^*\rangle=r(1)\) for all \(r\in V\), so \(q^*=q\) by uniqueness. Using (d),
\[\sum_{i,j}\bigl(A^{-1}\bigr)_{ij}=q(0)=\sum_{k=0}^{n-1}(-1)^k(2k+1)=(-1)^{n-1}n.\]The last equality holds by induction, since \((-1)^{n-1}n-(-1)^{n-2}(n-1)=(-1)^{n-1}(2n-1)\). Equivalently, the terms pair up as \((1-3)+(5-7)+\cdots\).
The same method applied to the Hilbert matrix \(\langle x^i,x^j\rangle\) evaluates the kernel at \(1\) instead of \(0\) and gives the classical value \(n^2\). Here the second basis is \((1-x)^j\), so the kernel is read off at the opposite end of the interval, and the alternating signs of \(\widetilde P_k(0)\) collapse the sum to \(\pm n\).
Check. Exact rational inversion of \(A\) for \(n=1,\dots,16\) gives entry sums \(1,-2,3,-4,\dots,-16\), as claimed.