Evaluate $\lim\limits_{x\to\infty}\frac1x\int_0^x\max\{\sin t,\sin(t\sqrt2)\}dt$ 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.
 A: I strongly conjecture that the limit is ${4\over\pi^2}=0.405285$. Integrating numerically over the interval $[0,1000]$ Mathematica obtained $0.406966$, but warned that the error might be larger than Mathematica's standard.
Consider the torus $T:=\bigl({\mathbb R}/(2\pi{\mathbb Z})\bigr)^2$and on $T$ the function 
$$f(x,y):=\max\{\sin x,\sin y\}\ .$$
Draw a figure of the fundamental domain $[-\pi,\pi]^2$ in order to identify the parts of $T$ where $\sin x$, resp. $\sin y$, is larger. Then compute the required double integrals and obtain
$$\int_T f(x,y)\>{\rm d}(x,y)=16\ .$$
This means that the "space average" $E$ of $f$ is given by
$$E(f)={16\over {\rm area}(T)}={4\over\pi^2}\ .$$
Now the orbit $$t\mapsto \bigl(x(t),y(t)\bigr):=(t,\>\sqrt{2}\,t)$$
projects to a line with irrational slope on $T$. In such a situation  an "ergodic principle" is at work. According to this principle the "time average" of $f$ coincides with the "space average" $E(f)$. Theoretical basis for this to happen is the fact that the multiples $k/\sqrt{2}$ $(k\in{\mathbb N})$ are uniformly distributed mod $1$.
A: 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.
A: As pointed out by OP, we can use $\max\{a,b\} = \frac{a+b}{2} + \frac{|a-b|}{2}$ to discover that
$$ L = \lim_{x\to\infty} \frac{1}{x} \int_{0}^{x} \left|\cos\left(\frac{\sqrt{2}+1}{2}t\right)\sin\left(\frac{\sqrt{2}-1}{2}t\right)\right| \, dt. $$
Applying the substitution $\frac{\sqrt{2}+1}{2}t = \pi u$ and writing $\alpha=(\sqrt{2}-1)^2$ followed by the substitution $y = \frac{\sqrt{2}+1}{2\pi}x$, we see that
\begin{align*}
L
&= \lim_{y\to\infty} \frac{1}{y} \int_{0}^{y} \left| \cos(\pi u)\sin(\pi \alpha u) \right| \, du \\
&= \lim_{N\to\infty} \frac{1}{N} \int_{0}^{N} \left| \cos(\pi u)\sin(\pi \alpha u) \right| \, du \\
&= \lim_{N\to\infty} \int_{0}^{1} \left| \cos(\pi u) \right| \left( \frac{1}{N} \sum_{n=0}^{N-1} \left| \sin(\pi \alpha k + \pi \alpha u) \right| \right) \, du
\end{align*}
Since $\alpha$ is irrational, the equidistribution theorem applied to $v \mapsto \left| \sin(\pi v + \pi \alpha u) \right|$ for each fixed $u$ tells that
$$ \forall u\in\mathbb{R} \ : \ \lim_{N\to\infty} \frac{1}{N} \sum_{n=0}^{N-1} \left| \sin(\pi \alpha k + \pi \alpha u) \right| = \int_{0}^{1} \left| \sin(\pi v) \right| \, dv. $$
Therefore by the dominated convergence theorem,
$$ L = \left( \int_{0}^{1} \left| \cos(\pi u) \right| \, du \right)\left( \int_{0}^{1} \left| \sin(\pi v) \right| \, dv \right) = \frac{4}{\pi^2}. $$
