Oscillatory integral with absolute value Suppose $f:[0,1]\to[0,+\infty)$ is a continuous function. Are there general conditions under which the following limit exists?
$$\lim_{n\rightarrow \infty} \int_0^1 |\cos(nf(x))|dx$$
Obviously if $f$ is a constant that is not an integer multiple of $\pi$ the limit does not exist. Does the limit exist if $f'(x)\neq 0$ for all $x \in [0,1]$? If so, what if we drop differentiability and only require $f$  not be locally constant?
When $f$ is not differentiable, can one still show
$$\liminf_{n \rightarrow \infty} \int_0^1 |\cos(nf(x))|dx >0$$
under suitable conditions on $f$?
 A: Proposition. Let $f:[0,1]\to\Bbb R$ be a continuously differentiable function such that $f’(x)\ne 0$ for each $x\in [0,1]$. Then $\lim_{n\rightarrow \infty} \int_0^1 |\cos(nf(x))|dx=\tfrac {2}\pi.$
Proof. Since $f’$ is a continuous function on a compact set $[0,1]$, it is uniformly continuous and $\ell=\inf \{|f’(x)|:x\in [0,1]\}>0$. Fix any $\varepsilon>0$. Since $f’(x)$ is uniformly continuous, there exists a natural number $N$ such that
$|f’(y)-f’(x)|\le \varepsilon$ for any $x,y\in [0,1]$ such that  $|y-x|\le\tfrac \pi{N\ell}$.
Let $n\ge N$ be any natural number. Put $X_n=\left\{x\in [0,1]:nf(x)\in \tfrac \pi2+\pi\Bbb Z \right\}$. Since $\ell>0$, $f$ is strictly monotonic, so the set $X_n$ is finite.  Let $x_1<x_2<\dots<x_m$ be an enumeration of $X_n$. Put $x_0=0$ and $x_{m+1}=1$. Then $x_{i+1}-x_i\le\tfrac \pi{n\ell}$ for each $i=0,\dots m$. Put $I_i=\int_{x_i}^{x_{i+1}} |\cos(nf(x))|dx$.
Then $I=\int_0^1 |\cos(nf(x))|dx=\sum_{i=0}^m I_i$. Clearly, $|I_0|, |I_m|\le \tfrac \pi{n\ell}$. Let $i$ be any integer from $1$ to $m-1$. By Lagrange’s theorem there exists $z\in (x_i, x_{i+1})$ such that $\tfrac {f(x_{i+1})-f(x_i)} {x_{i+1}-x_i}=f’(c)$. For each $y\in [x_i, x_{i+1}]$ put $g(y)=f(y)-f(x_i)-(y-x_i)f’(c).$ It is easy to check that $g(x_i)=0$ and for each $y$
$$|g’(y)|=|f’(y)-f’(c)|\le\varepsilon.$$
By Lagrange’s theorem, there exists $z\in (x_i, y)$ such that
$$|g(y)|=|g(y)-g(x_i)|=|g’(z)|(y-x_i) \le \varepsilon\frac \pi{n\ell}.$$ Again by  Lagrange’s theorem, there exists $d$ between $f(y)$ and $(f(x_i)+(y-x_i)f’(c))$ such that
$$|\cos (nf(y))-\cos n(f(x_i)+(y-x_i)f’(c))|=n|\sin nd|| f(y)- f(x_i)-(y-x_i)f’(c)|\le n |g(y)|\le \varepsilon\frac \pi{\ell}.$$
We have $|I_i- I_i’|\le I_i’’$, where $I’_i=\int_{x_i}^{x_{i+1}} |\cos n(f(x_i)+(y-x_i)f’(c))| dy $ and
$$I_i’’=\int_{x_i}^{x_{i+1}} |\cos (nf(y))-\cos n(f(x_i)+(y-x_i)f’(c))| dy\le \int_{x_i}^{x_{i+1}} \varepsilon\frac \pi{\ell} dy\le 
(x_{i+1}-x_i) \varepsilon\frac \pi{\ell}.$$
Let us calculate $I’_i$. We see that $h(y)=f(x_i)+(y-x_i)f’(c)$ is a linear function such that $h(x_i)=f(x_i)$ and
$$h(x_{i+1})= f(x_i)+(x_{i+1}-x_i)\tfrac {f(x_{i+1})-f(x_i)} {x_{i+1}-x_i}=f(x_{i+1})=f(x_i)\pm \frac {\pi}n,$$
by the construction of the sequence $(x_j)$. Since the primitive of $\cos n h(y)$ is $\frac 1{n f’(c)}\sin n h(y)$, we have
$$I’_i=\int_{x_i}^{x_{i+1}} |\cos n h(y)| dy=\left|\int_{x_i}^{x_{i+1}} \cos n h(y) dy \right|= 
\left|\frac 1{n f’(c)}\sin n h(y){\Huge|}_{x_i}^{x_{i+1}}\right|=\left|\frac 2{n f’(c)}\right|=\frac {2(x_{i+1}-x_i)} {\pi}.$$
We have
$$\left|\sum_{i=1}^{m-1} I_i-\sum_{i=1}^{m-1} I’_i\right|\le 
\sum_{i=1}^{m-1} \left| I_i- I’_i\right|\le \sum_{i=1}^{m-1} I’’_i\le \sum_{i=1}^{m-1}
(x_{i+1}-x_i) \varepsilon\frac \pi{\ell}=(x_{m}-x_1) \varepsilon\frac \pi{\ell}\le \varepsilon\frac \pi{\ell} .$$
But $$\sum_{i=1}^{m-1} I’_i=\sum_{i=1}^{m-1} \frac {2(x_{i+1}-x_i)} {\pi}=\frac {2(x_{m}-x_1)}{\pi}$$
Since $\varepsilon$ can be chosen arbitrarily small, and  $\left|  \frac {2(x_{m}-x_1)}{\pi}-\frac 2{\pi}\right|\le  \frac 2{\pi}\cdot \frac\pi{n\ell}=\frac 2{n\ell},$ the proposition follows. $\square$
A: We can generalize and perhaps gain some insight. I'll start with a generalization of the Riemann Lebesgue lemma (GRLL):
GRLL: Suppose $g$ is continuous and periodic on $\mathbb R,$ with period $p>0.$ Let $f$ be continuous on $[a,b].$ Then
$$\lim_{n\to \infty} \int_a^b g(nx)f(x)\,dx = \frac{\int_0^p g(x)\,dx }{p}\cdot\int_a^b f(x)\,dx.$$
This is not too hard to prove; I'll omit the proof for now.
Corollary: Assume in addition that $f\in C^1[a,b]$ and $f'$ is nonzero in $[a,b].$ Then
$$\tag 1 \lim_{n\to \infty}\int_a^b g(nf(x))\,dx = \frac{(b-a)}{p}\int_0^p g.$$
Proof: On the left side of $(1),$ let $x=f^{-1}(y).$ We get
$$\tag 2 \int_a^b g(nf(x))\,dx = \int_{f^{-1}(a)}^{f^{-1}(b)} g(ny)\frac{1}{f'(f^{-1}(y))}\,dy.$$
Apply GRLL to the right side of $(2)$ to get
$$\tag 3\frac{\int_0^p g(x)\,dx }{p}\int_{f^{-1}(a)}^{f^{-1}(b)}\frac{1}{f'(f^{-1}(y))}\,dy.$$
Now let $y=f^{-1}(z)$ to see $(3)$ equals the right side of $(1).$ The proof of the Corollary is complete.
Let's compare this result with Alex Ravsky's, where we have $g(y)=|\cos y|$ and $a=0,b=1.$ Here $g$ has period $\pi.$ The Corollary gives
$$\frac{1-0}{\pi}\int_0^\pi |\cos x|\,dx =  \frac{1}{\pi}\cdot 2 = \frac{2}{\pi}$$
for the answer, which agrees with Ravsky.
I believe we can extend these results further: Again suppose $f\in C^1$ but this time we assume only $m(\{x\in [a,b]: f'(x)=0\})=0.$ Then we get the same answer:
$$ \lim_{n\to \infty}\int_a^b g(nf(x))\,dx = \frac{(b-a)}{p}\int_0^p g.$$
I'll leave this unproven at the moment as time is slipping by.
