TITLE: Evaluate $\lim\limits_{x\to\infty}\frac1x\int_0^x\max\{\sin t,\sin(t\sqrt2)\}dt$
QUESTION [22 upvotes]: I want to evaluate
$$L=\lim_{x\to\infty}\frac1x\int_0^x\max\{\sin t,\sin(t\sqrt2)\}dt$$
My attempt
$$L=\lim_{x\to\infty}\frac1{2x}\int_0^x\Big(\sin t+\sin(t\sqrt2)+\big|\sin t-\sin(t\sqrt2)\big|\Big)dt\\
=\lim_{x\to\infty}\frac1{2x}\int_0^x\big|\sin t-\sin(t\sqrt2)\big|dt\\
=\lim_{x\to\infty}\frac1x\int_0^x\bigg|\cos\frac{\sqrt2+1}2t\cdot\sin\frac{\sqrt2-1}2t\bigg|dt$$
Denote $s_n$ the $n$th zero point of $\cos\frac{\sqrt2+1}2t\cdot\sin\frac{\sqrt2-1}2t\ (t\ge0)$. Since $1$, $\sqrt2$ and $\pi$ are linear independent in $\mathbb Q$, the order of the zero points should be $1$. According to the squeeze theorem, we have
$$L=\lim_{n\to\infty}\frac1{s_{n+1}}\sum_{k=0}^n(-1)^k\int_{s_k}^{s_{k+1}}\big(\sin t-\sin(t\sqrt2)\big)dt\\
=\lim_{n\to\infty}\frac1{s_{n+1}}\sum_{k=0}^n(-1)^k\bigg(\cos s_k-\cos s_{k+1}+\frac{\cos\sqrt2s_k-\cos\sqrt2s_{k+1}}{\sqrt2}\bigg)dt$$
I can't go further. I think the zero points of that function is the key point.

REPLY [4 votes]: For simplicity I'll notate $\alpha = \frac{\sqrt{2}+1}{2}$ and $\beta = \frac{\sqrt{2}-1}{2}$. Now note that the integral basically only depends on the asymptotic behaviour of the integrand, meaning that for all $y$:
$$
\begin{align}
L =\lim_{x\to\infty} \frac1x \int_0^x \bigg| \cos \alpha t \cdot \sin \beta t\bigg| \,\mathrm{d}t
&= \lim_{x\to\infty} \frac1x \int_y^x \bigg| \cos \alpha t \cdot \sin \beta t\bigg| \,\mathrm{d}t\\
&= \lim_{x\to\infty} \frac1{x+y} \int_0^{x} \bigg| \cos \alpha (t+y) \cdot \sin \beta (t+y)\bigg| \,\mathrm{d}t\\
&= \lim_{x\to\infty} \frac1{x} \int_0^x \bigg| \cos \alpha (t+y) \cdot \sin \beta (t+y)\bigg| \,\mathrm{d}t
\end{align}
$$
Letting $y = \frac{2\pi n}{\alpha}$ for $n \in \mathbb{N}$ this implies:
$$
L = \lim_{x\to\infty} \frac1{x} \int_0^x \bigg| \cos \alpha t \bigg| \cdot\bigg| \sin \beta \Bigl(t+\frac{2\pi n}{\alpha}\Bigr)\bigg| \,\mathrm{d}t
$$
now since $\alpha$ and $\beta$ are irrational we get (using the ergodic theorem):
$$
\lim_{N\to\infty} \frac1N \sum_{n=0}^N \bigg| \sin \beta \Bigl(t+\frac{2\pi n}{\alpha}\Bigr)\bigg|  = \frac1{2\pi}\int_0^{2\pi} \bigg| \sin(s) \bigg|  \,\mathrm{d}s = \frac{2}{\pi}
$$
for almost all $t$. With this we can now solve the original integral as follows:
$$
\begin{align}
L =\lim_{x\to\infty} \frac1x \int_0^x \bigg| \cos \alpha t \cdot \sin \beta t\bigg| \,\mathrm{d}t
&= \lim_{N\to\infty} \frac1N \sum_{n=0}^N \lim_{x\to\infty} \frac1{x} \int_0^x \bigg| \cos \alpha t \bigg| \cdot\bigg| \sin \beta \Bigl(t+\frac{2\pi n}{\alpha}\Bigr)\bigg| \,\mathrm{d}t\\
&= \lim_{N\to\infty} \lim_{x\to\infty} \frac1{x} \frac1N \sum_{n=0}^N\int_0^x \bigg| \cos \alpha t \bigg| \cdot\bigg| \sin \beta \Bigl(t+\frac{2\pi n}{\alpha}\Bigr)\bigg| \,\mathrm{d}t\\
&= \lim_{N\to\infty} \lim_{x\to\infty} \frac1{x} \int_0^x \bigg| \cos \alpha t \bigg| \cdot \frac1N \sum_{n=0}^N \bigg| \sin \beta \Bigl(t+\frac{2\pi n}{\alpha}\Bigr)\bigg| \,\mathrm{d}t\\
&= \lim_{x\to\infty} \frac1{x} \int_0^x \bigg| \cos \alpha t \bigg| \cdot \frac2{\pi} \,\mathrm{d}t\\
&= \frac{4}{\pi^2}
\end{align}
$$
this second to last step still requires some justification however. This can be done by noting that ergodic theorem guarantees that $\frac1N \sum_{n=0}^N \bigg| \sin \beta \Bigl(t+\frac{2\pi n}{\alpha}\Bigr)\bigg|$ converges in the $L^2$ sense on $[0, 2\pi / \beta]$ to the constant function $\frac{2}{\pi}$. This is enough since, if we have $g$ bounded and $f_n$ periodic with period $2\pi / \beta$ and $f_n \to f$ in the $L^2$ sense over that period then:
$$
\begin{align}
\lim_{N\to\infty} \left| \lim_{x\to\infty}  \frac1{x} \int_0^x g \cdot f_n \,\mathrm{d}t - \lim_{x\to\infty} \frac1{x} \int_0^x g \cdot f \,\mathrm{d}t \right|
&\le \lim_{N\to\infty} \lim_{x\to\infty} \frac1{x} \int_0^x | g \cdot f_n  - g \cdot f |^2 \,\mathrm{d}t\\
&\le \lim_{N\to\infty} \lim_{x\to\infty} \frac1{x} \int_0^x C | f_n  - f |^2 \,\mathrm{d}t\\
&\le \lim_{N\to\infty} \lim_{x\to\infty} \frac{C}{x} \left\lceil\frac{x}{2\pi / \beta}\right\rceil \| f_n - f \|_2^2\\
&\le \lim_{N\to\infty} \frac{C}{2\pi / \beta} \| f_n - f \|_2^2 \to 0
\end{align}
$$
It's possible there's a less fiddly proof to show convergence, but combining asymptotic density and ergodic theory does make things a bit tricky.