36
$\begingroup$

I was thinking about non-periodic trigonometric functions, and came up with this question:

What is the mean value of $|\sin x +\sin (\pi x)|$ ?

Here is the graph of $y=|\sin x +\sin (\pi x)|$:

enter image description here

The mean value should be $\lim\limits_{n\to\infty} \frac{1}{n}\int_0^n |\sin x +\sin (\pi x)|dx$, but I don't know how to evaluate this. I tried complex numbers, to no avail.

Desmos and Wolfram don't do a good job with numerical investigation of this limit, but we can consider the equivalent limit $\lim\limits_{n\to\infty} f(n)$ where $f(n)=\frac{1}{n}\sum\limits_{k=1}^n |\sin (\sqrt2 k)+\sin (\pi \sqrt2 k)|$. (I put $\sqrt2$ in front of $k$ so that that the terms do not have integer multiples of $\pi$.)

$f(10^{5})\approx1.0000113115\left(\dfrac{8}{\pi^2}\right)$
$f(10^{6})\approx1.0000003459\left(\dfrac{8}{\pi^2}\right)$
$f(10^{7})\approx1.0000001068\left(\dfrac{8}{\pi^2}\right)$
$f(10^{8})\approx1.0000000137\left(\dfrac{8}{\pi^2}\right)$

This suggests that the answer is $\dfrac{8}{\pi^2}$.

Note: In the question, if we replace $\pi$ with any other irrational number, it seems that we always get the same mean value.

EDIT:

Here is my attempt to generalize this question.

EDIT2:

Related claims:

  • The mean value of $|(\sin x)(\sin (\pi x))|$ is $\dfrac{4}{\pi^2}$.
  • The mean value of $\dfrac{|\sin x|}{|\sin (\pi x)|+1}$ is $\dfrac{4}{\pi^2}$.
  • The mean value of $|\sin (x+\sin (\pi x))|$ is $\dfrac{2}{\pi}$.
  • The mean value of $\sin^2 (x+\sin (\pi x))$ is $\dfrac{1}{2}$.
  • The mean value of $\dfrac{1}{|\sin x+\sin (\pi x)|+2}$ is $\dfrac{4G}{\pi^2}$, where $G$ is Catalan's constant.
$\endgroup$
7
  • $\begingroup$ It isn’t an answer and I’m not sure it will lead to an answer, but the Cauchy-Schwarz inequality might give you a usable upper bound? $\endgroup$
    – Clayton
    Commented Jul 17, 2023 at 2:20
  • 1
    $\begingroup$ @oliverjones: you would need to be careful with the second term. The integer values of $k$ will cause the $\sin(\pi k)$ to vanish (which leads to OPs explanation of the use of $\sqrt{2}$). $\endgroup$
    – Clayton
    Commented Jul 17, 2023 at 2:23
  • 2
    $\begingroup$ It does not necessarily have a mean value. $\endgroup$
    – copper.hat
    Commented Jul 17, 2023 at 4:49
  • 1
    $\begingroup$ This looks awfully like something that stemmed from ergodic theory. Just a hunch tho... $\endgroup$
    – oO_ƲRF_Oo
    Commented Jul 17, 2023 at 12:32
  • 9
    $\begingroup$ $x \mapsto |\sin(x)+\sin(\pi x)|$ is an almost periodic function. For almost periodic functions $f$ the mean value $\lim_{T \to \infty} \frac{1}{T}\int_0^T f(x)dx$ exists, see for example H. Bohr: Almost Periodic Functions, Chapter 50., p. 39. $\endgroup$
    – Gerd
    Commented Jul 17, 2023 at 13:01

3 Answers 3

30
$\begingroup$

This is far, FAR from a rigorous answer to your question, but I think the heuristic behind it is interesting. Even more interesting is that I reached the exact same answer you did numerically.

Considering the almost "decoherent" relationship between $\sin(x)$ and $\sin(\pi x)$, I tried thinking of $\sin(x) + \sin(\pi x)$ as behaving seemingly randomly over very large intervals. More precisely, defining two independant and uniformly distributed random variables $X\sim U([0,2\pi])$ and $Y\sim U([0,2])$, I instead computed the expected value: $$ \mathbb{E}[\,|\sin(X)+\sin(\pi Y)|\,], $$ and got exactly $8/\pi^2$ (full calculations below). However, I personally have no idea if the heuristic of "behaves random-like" can be made rigorous here. This is apparently related to ergodic theory, but I know next to nothing about it myself. Still, I thought this was interesting enough to share as an answer, maybe someone more knowledgeable can expand on it.

Computations: $$ \mathbb{E}[\,|\sin(X)+\sin(\pi Y)|\,] = \frac{1}{4\pi} \int_0^{2\pi} \int_0^2 |\sin(x)+\sin(\pi y)| \,dy \,dx. $$

By symmetry arguments, or just straightforward changes of variables, we can rewrite it as: $$ \mathbb{E}[\,|\sin(X)+\sin(\pi Y)|\,] = \frac{1}{\pi} \int_0^{\pi/2} \int_0^2 |\sin(x)+\sin(\pi y)| \,dy \,dx. $$

This makes it simpler, since, for all $(x,y)\in[0,\pi/2]\times[0,2]$: $$ |\sin(x)+\sin(\pi y)| = \begin{cases} \sin(x)+\sin(\pi y) &\text{if } y\leq 1+x/\pi,\\ -\sin(x)-\sin(\pi y) &\text{if } 1+x/\pi<y\leq 2-x/\pi,\\ \sin(x)+\sin(\pi y) &\text{if } 2-x/\pi<y, \end{cases} $$

and so, our expected value becomes: $$ \frac{1}{\pi} \int_0^{2\pi} \int_0^{1+x/\pi} \sin(x)+\sin(\pi y) \,dy - \int_{1+x/\pi}^{2-x/\pi} \sin(x)+\sin(\pi y) \,dy + \int_{2-x/\pi}^2 \sin(x)+\sin(\pi y) \,dy \,dx. $$

Breaking it down a little, we get: $$ \int_0^{1+x/\pi} \sin(x) \,dy - \int_{1+x/\pi}^{2-x/\pi} \sin(x) \,dy + \int_{2-x/\pi}^2 \sin(x) \,dy = \frac{4x}{\pi} \sin(x), $$ and: \begin{align*} &\int_0^{1+x/\pi} \sin(\pi y) \,dy - \int_{1+x/\pi}^{2-x/\pi} \sin(\pi y) \,dy + \int_{2-x/\pi}^2 \sin(\pi y) \,dy \\ =&\ -\frac{1}{\pi}[\cos(\pi+x)-1] +\frac{1}{\pi}[\cos(2\pi-x) - \cos(\pi+x)] -\frac{1}{\pi}[1-\cos(2\pi-x)] \\ =&\ \frac{4}{\pi} \cos(x), \end{align*}

giving us (after integrating by parts for the second equality): $$ \mathbb{E}[\,|\sin(X)+\sin(\pi Y)|\,] = \frac{4}{\pi^2} \int_0^{\pi/2} x\sin(x) + \cos(x) \,dx = \frac{8}{\pi^2} \int_0^{\pi/2} \cos(x) \,dx = 8/\pi^2. $$

$\endgroup$
18
$\begingroup$

First, let's move from sum to product. $$\sin x + \sin \pi x = 2 \sin \frac{x(\pi +1)}{2} \cos \frac{x(\pi -1)}{2}$$ Therefore, $$\lim_{n \rightarrow \infty} \int\limits_{0}^n \frac{1}{n} |\sin x + \sin \pi x| dx = \lim_{n \rightarrow \infty} \frac{2}{n} \int\limits_{0}^n |\sin \frac{x(\pi +1)}{2}| \cdot |\cos \frac{x(\pi -1)}{2}| dx $$

Replacing $x$ with $t = \frac{x(\pi +1)}{2}$, we get $$ \lim_{n \rightarrow \infty} \frac{2}{n} \int\limits_{0}^n |\sin \frac{x(\pi +1)}{2}| \cdot |\cos \frac{x(\pi -1)}{2}| dx = \lim_{n \rightarrow \infty} \frac{2}{n} \int\limits_{0}^n |\sin t| \cdot |\cos \frac{t(\pi -1)}{\pi + 1}| dt $$ Let's denote $\alpha = \frac{\pi -1}{\pi + 1}$. $\alpha = 1 - \frac{2}{1+\pi} \notin \mathbb{Q}$.

Now, let's move to Fourier series of $|\sin t|$ and $|\cos \alpha t|$. (Hope I'm not mistaken in the latter, perhaps there should be $4 \alpha^2 l^2$ instead of $4l^2$ in the denominator. That doesn't change the proof though) $$|\sin t| = \frac{2}{\pi} \cdot \left(1 - 2 \sum\limits_{k=1}^{\infty} \frac{\cos 2 k t}{4k^2 - 1}\right)$$ $$|\cos \alpha t| = \frac{2}{\pi} \cdot \left(1 + 2 \sum\limits_{l=1}^{\infty} \frac{(-1)^l \cos 2 l \alpha t}{4l^2 - 1}\right)$$ So, we get that $$\lim_{n \rightarrow \infty} \frac{2}{n} \int\limits_{0}^n |\sin t| \cdot |\cos \frac{t(\pi -1)}{\pi + 1}| dt = \lim_{n \rightarrow \infty} \frac{2}{n} \int\limits_{0}^n |\sin t| \cdot |\cos \alpha t| dt = $$ $$\lim_{n \rightarrow \infty} \frac{8}{n \pi^2} \int\limits_{0}^n \left(1 - 2 \sum\limits_{k=1}^{\infty} \frac{\cos 2 k t}{4k^2 - 1}\right) \left(1 + 2 \sum\limits_{l=1}^{\infty} \frac{(-1)^l \cos 2 l \alpha t}{4l^2 - 1}\right) dt = \frac{8}{\pi^2} + $$ $$\lim_{n \rightarrow \infty} \frac{8}{n \pi^2} \int\limits_{0}^n \left( - 2 \sum\limits_{k=1}^{\infty} \frac{\cos 2 k t}{4k^2 - 1} + 2 \sum\limits_{l=1}^{\infty} \frac{(-1)^l \cos 2 l \alpha t}{4l^2 - 1}\ - 4 \sum\limits_{k=1}^{\infty} \frac{\cos 2 k t}{4k^2 - 1} \sum\limits_{l=1}^{\infty} \frac{(-1)^l \cos 2 l \alpha t}{4l^2 - 1}\right) dt \ \ (1)$$

Let's look closer at the three terms above. I believe it's not difficult to show that the limit of the first two terms equals $0$.

So, let's look at the third one. As was pointed out in the comments below the question, $|\sin x + \sin \pi x|$ is an almost periodic function. So the limit $\lim_{n \rightarrow \infty} \int\limits_{0}^n \frac{1}{n} |\sin x + \sin \pi x| dx$ exists.

Because of that, the limit below exists: $$\lim_{n \rightarrow \infty} \frac{1}{n} \cdot \frac{32}{\pi^2} \int\limits_{0}^n \left( \sum\limits_{k=1}^{\infty} \frac{\cos 2 k t}{4k^2 - 1} \sum\limits_{l=1}^{\infty} \frac{(-1)^l \cos 2 l \alpha t}{4l^2 - 1}\right) dt =$$ $$ \lim_{n \rightarrow \infty} \frac{1}{n} \cdot \frac{32}{\pi^2} \sum\limits_{k=1}^{\infty} \sum\limits_{l=1}^{\infty} \int\limits_{0}^n \left( \frac{\cos 2 k t}{4k^2 - 1} \frac{(-1)^l \cos 2 l \alpha t}{4l^2 - 1}\right) dt $$

$$= \lim_{n \rightarrow \infty} \frac{1}{n} \cdot \frac{32}{\pi^2} \sum\limits_{k=1}^{\infty} \sum\limits_{l=1}^{\infty} \frac{(-1)^l }{(4l^2 - 1)(4k^2 - 1)} \int\limits_{0}^n \left( \frac{\cos (2 k t + 2 l \alpha t) + \cos (2 k t - 2 l \alpha t) }{2}\right) dt = $$

$$\lim_{n \rightarrow \infty} \frac{1}{n} \cdot \frac{32}{\pi^2} \sum\limits_{k=1}^{\infty} \sum\limits_{l=1}^{\infty} \frac{(-1)^l }{(4l^2 - 1)(4k^2 - 1)} \left( \frac{\sin (2 k n + 2 l \alpha n)}{4(k + l \alpha)} + \frac{\sin (2 k n - 2 l \alpha n) }{4(k - l \alpha)}\right) $$ Because the limit exists (and also, by Fubini's Theorem, because the sum after interchanging exists), we can interchange integral and sum (the next equation is a part, where I'm most likely to be mistaken, please double-check it)

$$\lim_{n \rightarrow \infty} \frac{1}{n} \cdot \frac{32}{\pi^2} \sum\limits_{k=1}^{\infty} \sum\limits_{l=1}^{\infty} \frac{(-1)^l }{(4l^2 - 1)(4k^2 - 1)} \left( \frac{\sin (2 k n + 2 l \alpha n)}{4(k + l \alpha)} + \frac{\sin (2 k n - 2 l \alpha n) }{4(k - l \alpha)}\right) = $$ $$ \frac{32}{\pi^2} \sum\limits_{k=1}^{\infty} \sum\limits_{l=1}^{\infty} \frac{(-1)^l }{(4l^2 - 1)(4k^2 - 1)} \lim_{n \rightarrow \infty} \frac{1}{n} \left( \frac{\sin (2 k n + 2 l \alpha n)}{4(k + l \alpha)} + \frac{\sin (2 k n - 2 l \alpha n) }{4(k - l \alpha)}\right) = 0 $$

The last three terms in equation (1) are zeros, so the needed mean value equals $\frac{8}{\pi^2}$.

P.S. Note that the irrationality of $\alpha$ was used twice:

  • Because of it the function is almost periodic and the limit exists
  • Also if $\alpha \in \mathbb{Q}$, then for the third term, the denominator $k \pm \alpha l$ would equal $0$ for some $k, l \in \mathbb{N}$
$\endgroup$
14
$\begingroup$

This is not a direct answer

$\require{AMScd}$ Funny enough, I cannot tackle the integral head on, but I do have a solution to the sum equivalent to that integral. Let's consider following question:

Suppose $\,\,p/q\notin \mathbb{Q}, p,q\ne\pi,0$, then $$ \lim_{n\rightarrow \infty} \frac{1}{n}\sum_{k=0}^{n-1}{|\sin \left( pk \right) +\sin \left( qk \right) |}=\frac{8}{\pi ^2} $$

I wrote
\begin{align*} &X=\left[ 0,2\pi \right] \times \left[ 0,2\pi \right] \\ &f\left( x,y \right) =\left| \sin \left( x \right) +\sin \left( y \right) \right| \\ &T:X\rightarrow X, \left( x,y \right) \mapsto \left( 2\pi \left\{ \frac{x+p}{2\pi} \right\} ,2\pi \left\{ \frac{y+q}{2\pi} \right\} \right) \end{align*} Right off the bat, I should establish a fact:
$\forall \varepsilon >0, \exists \delta =\frac{\varepsilon}{\sqrt{2}}\,\,\mathrm{s}.\mathrm{t}. \forall \left( x,y \right) \in \mathrm{B}\left( \left( 0,0 \right) ,\delta \right) $
\begin{align*} &\mathop {\mathrm{limsup}} \limits_{n\rightarrow \infty}\left| \frac{1}{n}\left( \sum_{k=0}^{n-1}{\left| \sin \left( pk \right) +\sin \left( qk \right) \right|}-\sum_{k=0}^{n-1}{\left| \sin \left( x+pk \right) +\sin \left( y+qk \right) \right|} \right) \right| \\ \leqslant &\mathop {\mathrm{limsup}} \limits_{n\rightarrow \infty}\frac{1}{n}\sum_{k=0}^{n-1}{\left| \sin \left( pk \right) -\sin \left( x+pk \right) +\sin \left( qk \right) -\sin \left( y+qk \right) \right|} \\ =&\mathop {\mathrm{limsup}} \limits_{n\rightarrow \infty}\frac{1}{n}\sum_{k=0}^{n-1}{\left| x\cos \left( \xi _x+pk \right) +y\cos \left( \xi _y+qk \right) \right|} \\ \leqslant &\mathop {\mathrm{limsup}} \limits_{n\rightarrow \infty}\frac{1}{n}\sum_{k=0}^{n-1}{\left( \left| x \right|+\left| y \right| \right)}\leqslant \sqrt{2}\sqrt{x^2+y^2}<\sqrt{2}\delta =\varepsilon \end{align*} This implies if $(x,y)$ go sufficient close to $(0,0)$ then
\begin{align*} 0\leqslant& \mathop {\mathrm{liminf}} \limits_{n\rightarrow \infty}\left| \frac{1}{n}\left( \sum_{k=0}^{n-1}{\left| \sin \left( pk \right) +\sin \left( qk \right) \right|}-\sum_{k=0}^{n-1}{\left| \sin \left( x+pk \right) +\sin \left( y+qk \right) \right|} \right) \right|\\\leqslant& \mathop {\mathrm{limsup}} \limits_{n\rightarrow \infty}\left| \frac{1}{n}\left( \sum_{k=0}^{n-1}{\left| \sin \left( pk \right) +\sin \left( qk \right) \right|}-\sum_{k=0}^{n-1}{\left| \sin \left( x+pk \right) +\sin \left( y+qk \right) \right|} \right) \right|=0 \\\Rightarrow& \lim_{n\rightarrow \infty} \left| \frac{1}{n}\left( \sum_{k=0}^{n-1}{\left| \sin \left( pk \right) +\sin \left( qk \right) \right|}-\sum_{k=0}^{n-1}{\left| \sin \left( x+pk \right) +\sin \left( y+qk \right) \right|} \right) \right|=0 \\\Rightarrow& \lim_{n\rightarrow \infty} \frac{1}{n}\sum_{k=0}^{n-1}{\left| \sin \left( x+pk \right) +\sin \left( y+qk \right) \right|}=\lim_{n\rightarrow \infty} \frac{1}{n}\sum_{k=0}^{n-1}{\left| \sin \left( pk \right) +\sin \left( qk \right) \right|} \end{align*}

If we can prove $T$ is ergodic, then by Birkhoff Ergodic Theorem, it always possible to find such $(x,y)$ such that the following holds
\begin{align*} &\lim_{n\rightarrow \infty} \frac{1}{n}\sum_{k=0}^{n-1}{\left| \sin \left( pk \right) +\sin \left( qk \right) \right|} =\lim_{n\rightarrow \infty} \frac{1}{n}\sum_{k=0}^{n-1}{\left| \sin \left( x+pk \right) +\sin \left( y+qk \right) \right|} \\ &=\lim_{n\rightarrow \infty} \frac{1}{n}\sum_{k=0}^{n-1}{f\left( T^k\left( x,y \right) \right)} \stackrel{\mathrm{Birkhoff}}{\begin{CD}@=\end{CD}} \frac{1}{\mu \left( X \right)}\int_X{f\left( x,y \right) \mathrm{d}\mu} \\ &=\frac{1}{4\pi ^2}\int_0^{2\pi}{\int_0^{2\pi}{\left| \sin \left( x \right) +\sin \left( y \right) \right|\mathrm{d}x\mathrm{d}y}} =\frac{8}{\pi ^2} \end{align*}

Now, I shall prove $T$ is ergodic on $X$.
1.$T$ preserves Lebesgue measure, because of $T$ is basically a shift on $\mathbb{R}^2$.
2.Since $\left[ 0,2\pi \right] \cong \mathbb{R} /2\pi \mathbb{Z} \cong \mathbb{S} ^1$. if $f\in L^2\left( X,\mu \right) , f\circ T\left( x,y \right) =f\left( x,y \right) \,\,\mathrm{a.e.} \,\,x\in X$.
We can write $f$ in it's Fourier series:
$$ f\left( x,y \right) =\sum_{m,n\in \mathbb{Z}}{c_{m,n}e^{i\left( mx+ny \right)}} $$ Then
\begin{align*} &f\circ T\left( x,y \right) =f\left( x,y \right) \\ \Rightarrow& \sum_{m,n\in \mathbb{Z}}{c_{m,n}e^{i\left( mp+nq \right)}e^{i\left( mx+ny \right)}}=\sum_{m,n\in \mathbb{Z}}{c_{m,n}e^{i\left( mx+ny \right)}} \\ \Rightarrow& c_{m,n}\left( 1-e^{i\left( mp+nq \right)} \right) =0 \\ \Rightarrow& c_{m,n}=0, \forall\left( m,n \right) \ne \left( 0,0 \right) \\ \Rightarrow& f\left( x,y \right) =c_{0,0} \end{align*} This implies $f$ is a constant almost everywhere on $X$, which proves that $T$ is ergodic on $X$.

Addendum

I think it's plausible that this method can be extended to a sum with more sine terms in it.
If $N\in \mathbb{N} , \left\{ p_k \right\} _{k=1}^{N}, \forall i,j\in \left\{ 1,\cdots ,N \right\} , p_i/p_j\notin \mathbb{Q}, p_i\ne\pi,0$, Then $$ \lim_{n\rightarrow \infty} \frac{1}{n}\sum_{m=0}^{n-1}{\left| \sum_{k=1}^N{\sin \left( p_km \right)} \right|}=\left( \frac{1}{2\pi} \right) ^N\int_0^{2\pi}{\int_0^{2\pi}{\cdots \int_0^{2\pi}{\left| \sum_{k=1}^N{\sin \left( x_k \right)} \right|\mathrm{d}x_N\cdots \mathrm{d}x_2\mathrm{d}x_1}}} \\ =\int_0^1{\int_0^1{\cdots \int_0^1{\left| \sum_{k=1}^N{\sin \left( 2\pi x_k \right)} \right|\mathrm{d}x_N\cdots \mathrm{d}x_2\mathrm{d}x_1}}}= \int_{\left[ 0,1 \right] ^n}{\left| \sum_{k=1}^n{\sin \left( 2\pi x_k \right)} \right|}\mathrm{d}\mu $$

$\endgroup$
6
  • $\begingroup$ I don't immediately see why you can change order of limits in 3rd equality. On top of that, Birkhoff theorem says that equality holds for almost every point, so $\lim_{n \to\infty} \frac 1 n \sum_{k = 0}^{n-1}f(T^k(x, y))$ could not exist for many $(x, y)$ near $(0, 0)$. While the latter could be easily fixed by domain restriction, your reasoning doesn't show why at $(0, 0)$ should Birkhoff hold. Certainly slightly altered statement, that for almost all $(x, y)$ equality $\lim_{n\to\infty} \frac 1 n \sum_{k = 0}^{n-1} |\sin(x + pk) + \sin(y + qk)| = \frac 8{\pi^2}$ holds is true. $\endgroup$
    – Esgeriath
    Commented Jul 18, 2023 at 10:48
  • $\begingroup$ @Esgeriath I modified the argument a little, I tried to address the promblem you pointed out. Don't know if that fixes it tho... $\endgroup$
    – oO_ƲRF_Oo
    Commented Jul 18, 2023 at 12:26
  • $\begingroup$ It does work now, but for me you use term "sufficiently close" too loosely, writing equality when additional limit should be present. Second chain of inequalities proves that $\lim_{(x, y)\to (0, 0)}\lim_{n\to\infty}\frac 1 n\sum_{k=0}^{n-1} f\circ T^k(x, y)= \lim_{n\to\infty}\frac 1 n \sum_{k=0}^{n-1} f\circ T^k(0, 0) $, if either side exists. Later you use Birkhoff for special $(x, y)$ to show $\lim_{(x, y)\to (0, 0)} \lim_{n\to\infty} \frac 1 n \sum_{k=0}^{n-1} f\circ T^k(x, y) = \lim_{(x, y)\to(0, 0)} \text{const} = \text{const}$, where the limit is taken on those special $(x, y)$. $\endgroup$
    – Esgeriath
    Commented Jul 18, 2023 at 13:10
  • $\begingroup$ This can be easily generalized to show that Birkhoff works everywhere (not only almost everywhere) in this case! That's sort of expected, but still nice $\endgroup$
    – Esgeriath
    Commented Jul 18, 2023 at 13:11
  • 1
    $\begingroup$ @Esgeriath Wow! that was nice! Actually I'm interested in the OP's generalized case of this. I just need to show that $$ \int_{\left[ 0,1 \right] ^n}{\left| \sum_{k=1}^n{\sin \left( 2\pi x_k \right)} \right|}\mathrm{d}\mu \sim \sqrt{\frac{n}{\pi}}\,\,\left( n\rightarrow \infty \right) $$ $\endgroup$
    – oO_ƲRF_Oo
    Commented Jul 18, 2023 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .