# An astounding identity: $\int_0^{\pi/2}\ln\lvert\sin(mx)\rvert\cdot \ln\lvert\sin(nx)\rvert\, dx$

In this question, user Franklin Pezzuti Dyer gives the following surprising integral evaluation:

$$\int_0^{\pi/2}\ln \lvert\sin(mx)\rvert \cdot \ln \lvert\sin(nx)\rvert \, dx = \frac{\pi^3}{24} \frac{\gcd^2(m,n)}{mn}+\frac{\pi\ln^2(2)}{2}$$

I've verified this numerically for small values for $$m,n$$. Is there a proof? Also, can we generalize it to more factors in the integrand?

• I don't have a proof, but I would find it even more aesthetical with $\frac{\gcd(m,n)}{\operatorname{lcm}(m,n)}$ instead of $\frac{\gcd^2(m,n)}{mn}$. Jun 20, 2018 at 21:08
• This will probably require a lot more thinking, but have you tried replacing the absolute value signs with $\sqrt{(\cdot)^2}$? Jun 20, 2018 at 21:09
• @ArnaudMortier You can edit if you like, but I think I prefer the original. Jun 20, 2018 at 21:20
• @FrankW That could be a good first step, sure. Jun 20, 2018 at 21:20

Start with the following well-known identity: $$\int_0^{\pi}\cos(mx)\cos(nx)dx=\frac{\pi}{2}\delta_{mn}\tag{1}$$ ...where $$m,n$$ are positive integers. Recall also the well-known Fourier Series $$\sum_{n=1}^\infty \frac{\cos(kx)}{k}=-\frac{\ln(2-2\cos(x))}{2}\tag{2}$$ Now, replace $$m$$ in $$(1)$$ with $$mk$$, where both $$m,k$$ are integers, and divide both sides by $$k$$ to get $$\int_0^{\pi}\frac{\cos(kmx)}{k}\cos(nx)dx=\frac{\pi\delta_{(mk)n}}{2k}$$ Then sum both sides from $$k=1$$ to $$\infty$$ to get $$-\frac{1}{2}\int_0^{\pi}\ln(2-2\cos(mx))\cos(nx)dx=\frac{\pi m}{2n}[m|n]$$ where the brackets on the $$RHS$$ are Iverson Brackets. A bit more manipulation yields the equality $$\int_0^{\pi}\ln\bigg(\frac{1-\cos(mx)}{2}\bigg)\cos(nx)dx=-\frac{\pi m}{n}[m|n]$$ Now, this time, replace $$n$$ with $$nk$$ and divide both sides by $$k$$. This yields $$\int_0^{\pi}\ln\bigg(\frac{1-\cos(mx)}{2}\bigg)\frac{\cos(knx)}{k}dx=-\frac{\pi m}{k^2n}[m|kn]$$ Then sum from $$k=1$$ to $$\infty$$ to get $$-\frac{1}{2}\int_0^{\pi}\ln\bigg(\frac{1-\cos(mx)}{2}\bigg)\ln(2-2\cos(nx))dx=-\sum_{k=1}^{\infty} \frac{\pi m}{k^2n}[m|kn]$$ Now notice the following about the series on the RHS. Due to the Iverson Bracket, the kth term is zero unless $$m|kn$$, or unless $$k$$ is divisible by $$m/\gcd(m,n)$$. Thus, we let $$k=jm/\gcd(m,n)$$ for the integers $$j=1$$ to $$\infty$$ and reindex the sum: \begin{align} -\frac{1}{2}\int_0^{\pi}\ln\bigg(\frac{1-\cos(mx)}{2}\bigg)\ln(2-2\cos(nx))dx &=-\sum_{j=1}^{\infty} \frac{\pi m}{(jm/\gcd(m,n))^2n}\\ &=-\frac{\pi\gcd^2(m,n)}{mn}\sum_{j=1}^{\infty} \frac{1}{j^2}\\ &=-\frac{\pi^3\gcd^2(m,n)}{6mn}\\ \end{align} or $$\int_0^{\pi}\ln\bigg(\frac{1-\cos(mx)}{2}\bigg)\ln(2-2\cos(nx))dx=\frac{\pi^3\gcd^2(m,n)}{3mn}\tag{3}$$ Then, by using the result $$\int_0^{\pi}\ln(1-\cos(ax))=-\pi\ln(2)\tag{4}$$ for all positive integers $$a$$, and the trigonometric identity $$\sin^2(x/2)=\frac{1-\cos(x)}{2}\tag{5}$$ and finally, a substitution $$x\to 2x$$, the result easily follows from $$(3)$$ : $$\bbox[lightgray,5px]{\int_0^{\pi/2}\ln \lvert\sin(mx)\rvert \cdot \ln \lvert\sin(nx)\rvert \, dx = \frac{\pi^3}{24} \frac{\gcd^2(m,n)}{mn}+\frac{\pi\ln^2(2)}{2}}$$
• This looks good - a beautiful proof of a beautiful fact. Although, I believe you are missing a few factors of $\pi/2$. I'll accept your answer after a couple days to see if others can provide alternate proofs. Jun 21, 2018 at 3:19
• What does the $\delta$ function mean at the end of equation $(1)$?$$\int\limits_0^{\pi}dx\,\cos mx\cos nx=\frac {\pi}2\color{blue}{\delta_{mn}}$$ Jun 21, 2018 at 21:27
• @FrankW.,This is the Kronecker delta, equal to $1$ if $m=n$ and $0$ otherwise. Jun 21, 2018 at 21:37
• This isn't quite relevant to the question, but using the same technique in the linked question, I get$$\int\limits_0^{1}dt\,\frac {t^a(1-t)^b}{z-t^s(1-t)^k}=\sum\limits_{n\geq0}\frac {\Gamma(sn+a+1)\Gamma(kn+b+1)}{z^{n+1}\Gamma(a+b+n(s+k)+2)}$$which comes from the beta function and taking the sum from $n=0$ to $\infty$. It looks kinda promising to me... Jun 22, 2018 at 15:45