A closed form for $\int_0^\pi \lvert \sin(m t) \cos(n t) \rvert \, \mathrm{d} t$

calculusdefinite integralsintegrationlimitstrigonometric-integrals

Motivated by this nice question I have been trying to compute the function $f: \mathbb{R}^+ \to \left[0,\frac{1}{2}\right]$ defined by

$$f(\alpha) = \lim_{x \to \infty} \frac{1}{x} \int \limits_0^x \lvert\sin(\alpha s) \cos(s)\rvert \, \mathrm{d} s \, .$$

Note that $f(\alpha) \leq \frac{1}{2}$ follows from the Cauchy-Schwarz inequality.

In the answers to the original question the equidistribution theorem is used to show that $f(3 – 2 \sqrt{2}) = \frac{4}{\pi^2}$ holds. This argument can be extended to every irrational number, so we have $f(\alpha) = \frac{4}{\pi^2} \approx 0.405285$ for any $\alpha \in \mathbb{R}^+ \setminus \mathbb{Q}^+$ .

For rational arguments we can take $m , n \in \mathbb{N}$ with $\gcd(m,n) =1$ . The change of variables $s = n t$ yields
$$ f \left(\frac{m}{n}\right) = \lim_{x \to \infty} \frac{1}{x} \int \limits_0^x \lvert\sin(m t) \cos(n t)\rvert \, \mathrm{d} t \, .$$
The integrand is periodic with period $\pi$, so
$$ f \left(\frac{m}{n}\right) = \lim_{x \to \infty} \frac{1}{x} \left[\bigg\lfloor \frac{x}{\pi} \bigg\rfloor \int \limits_0^\pi \lvert\sin(m t) \cos(n t)\rvert \, \mathrm{d} t + \mathcal{O} (1)\right] = \frac{1}{\pi} \int \limits_0^\pi \lvert\sin(m t) \cos(n t)\rvert \, \mathrm{d} t\, .$$

Now the idea is to split the interval of integration into subintervals on which the sign of the product is constant and then use
$$ \sin(m t) \cos(n t) = \frac{\sin[(m+n)t] + \sin[(m-n)t]}{2}$$
to find the integrals. The result is basically given by a finite sum of cosines evaluated at the zeroes of the integrand.

The first few results are
\begin{align}
f(1) &= \frac{1}{\pi} \approx 0.318301 \, , \\
f(2) &= \frac{4}{3 \pi} \approx 0.424413 \, , \\
f\left(\frac{1}{2}\right) &= \frac{2(2\sqrt{2}-1)}{3\pi} \approx 0.388004 \, .
\end{align}

Interestingly, most of the other values (especially those with large $m$ and $n$) seem to be very close to $\frac{4}{\pi^2}$ .

This method can be used (at least in principle) to compute $f$ at every rational argument, but it becomes increasingly complicated for larger values of $m$ and $n$ . Maybe I am overlooking a simple trick, maybe there is a better method. My question is:

How can we find a general expression for $f\left(\frac{m}{n}\right)$ with arbitrary coprime $m,n \in \mathbb{N}$ ?


Edit 1 July 2020

Thanks to Zacky's bounty and River Li's and asgeige's nice answers we have some closed-form results for special cases and a promising (but still somewhat complicated) conjecture for the general case. Using similar methods, I have also found
$$ f(m) = \frac{2}{\pi (m^2-1)} \left[m \csc \left(\frac{\pi}{2m}\right) \cos \left(\frac{\pi}{2m} 1_{2\mathbb{N}}(m)\right) – 1_{2 \mathbb{N}-1}(m)\right]$$
for $m \in \mathbb{N} \setminus \{1\}$ ($1_A$ is the indicator function of the set $A$), which implies $\lim_{m \to \infty} f(m) = \frac{4}{\pi^2}$. While a simple expression for general values of $m,n$ seems unlikely, it may be possible to show that $\lim_{n \to \infty} f \left(\frac{m}{n}\right) = \frac{4}{\pi^2}$ and $\lim_{m \to \infty} f \left(\frac{m}{n}\right) = \frac{4}{\pi^2}$ do indeed hold for fixed $m \in \mathbb{N}$ and $n \in \mathbb{N}$, respectively.


Edit 11 January 2021

Thanks to River Li's second answer we now have a proof of the conjectured limits. We can even use partial fractions and the pole expansions of $\csc$ and $\cot$ to simplify the remaining series and obtain the following general result (valid for $m, n \in \mathbb{N}$ coprime and not both equal to $1$):
$$ f\left(\frac{m}{n}\right) = \frac{g_m\left(\frac{\pi}{2m}\right) – g_m \left(\frac{\pi}{2n}\right)}{m^2-n^2} \, , \, g_m = \begin{cases} x \mapsto \frac{\csc(x)}{x} &, \, m \in 2 \mathbb{N} – 1 \\ x \mapsto \frac{\cot(x)}{x} &, \, m \in 2 \mathbb{N}\end{cases} \, . $$

Best Answer

Case $m = 1$

By using Maple, we have \begin{align} f(\tfrac{1}{n}) &= \frac{1}{\pi}\int_0^\pi |\sin t \cos (nt)| \mathrm{d} t\\ &= \frac{2(n - \sin \tfrac{\pi}{2n})}{(n^2-1)\pi \sin \tfrac{\pi}{2n}}. \end{align} We have $$\lim_{n\to \infty} f(\tfrac{1}{n}) = \frac{4}{\pi^2}.$$

Case $m=2$, and $n$ odd

By using Maple, we have \begin{align} f(\tfrac{2}{n}) &= \frac{1}{\pi}\int_0^\pi |\sin 2t \cos (nt)| \mathrm{d} t\\ &= \frac{2(n \cos \frac{\pi}{2n}-2\sin \frac{\pi}{2n} )}{(n^2-4)\pi \sin \frac{\pi}{2n}}. \end{align} We have $$\lim_{n\to \infty} f(\tfrac{2}{n}) = \frac{4}{\pi^2}.$$

General Case $m \ne n$

Based on the results for $m=1, 2, 3, 4, \cdots$ by Maple, after simplification and observation, I $\color{blue}{\textrm{GUESS}}$ that, for $m, n \ge 1$ and $m\ne n$, \begin{align} &\int_0^\pi |\sin (mt) \cos (nt)| \mathrm{d} t \\ =\ & \frac{2n}{n^2-m^2} \left(\sum_{s=0}^{\lfloor \frac{n}{2} + \frac{3}{4}\rfloor - 1} \left|\sin \frac{m\pi (1 + 4s)}{2n}\right| + \sum_{s=0}^{\lfloor \frac{n}{2} + \frac{1}{4} \rfloor - 1} \left|\sin \frac{m\pi (3 + 4s)}{2n}\right|\right)\\ &\quad - \frac{2m}{n^2-m^2}\sum_{s=0}^{m-1} \left|\cos \frac{s\pi n}{m}\right| \end{align} where $\lfloor x \rfloor$ is the floor function.

Remarks: 1. I have done numerical experiments $1\le m, n \le 10$ and more.

  1. Rigorous and step-by-step proofs are expected.

  2. Further simplification may be possible.

Related Question