If $f,g$ are continuous and $g$ is $1$-periodic, $\int_0^1 f(x)g(nx)dx \xrightarrow[n\to\infty]{} \int_0^1 f \int_0^1 g$

We have

$$\begin{align} \int_0^1f(x)g(nx)dx &= \frac 1n\int_0^n f\left(\frac{x}{n}\right)g(x)dx = \frac{1}{n}\sum_{k=0}^{n-1}\int_k^{k+1}f\left(\frac{x}{n}\right)g(x)dx \\ &= \frac 1n\sum_{k=0}^{n-1}\int_0^1 f\left(\frac{x+k}{n}\right)g(x)dx. \end{align}$$

Now use that for $n$ large enough by uniform continuity of $f$ and boundedness of $g$ we can get $f(\frac{x+k}{n})g(x)$ in an $\epsilon$-range of $f(\frac kn)g(x)$. Summed up and divided by $n$ we remain in an $\epsilon$-range if we replace $f(\frac{x+k}{n})$ in the integral by $f(\frac kn)$.

But then we have

$$ \frac 1n\sum_{k=0}^{n-1}\int_0^1f\left(\frac{k}{n}\right)g(x)dx = \frac 1n\sum_{k=0}^{n-1}f\left(\frac{k}{n}\right)\int_0^1g(x)dx. $$

Take it from there.


To complement LeBtz's excellent answer above, let's try a more heuristic way of figuring out what to do. This may not be the shortest, but should (i) give an intuition of what is going on; and (ii) show that is it not "magic" with the proof coming out of the blue, but that there is some process to arrive at the result.


Since the assumption on $g$ is $1$-periodicity, we want to make appear things like $g(u+k)$ for $k\in\mathbb{N}$, so that we can simplify. So let us break $[0,1]$ in many segments of length $\frac{1}{n}$, so that $g(nx)$ becomes something we want: $$\begin{align} \int_0^1 f(x)g(nx)dx &= \sum_{k=0}^{n-1} \int_{\frac{k}{n}}^{\frac{k+1}{n}} f(x)g(nx)dx = \sum_{k=0}^{n-1} \int_{0}^{\frac{1}{n}} f\left(u+\frac{k}{n}\right)g\left(n\left(u+\frac{k}{n}\right)\right)du \\ &=\sum_{k=0}^{n-1} \int_{0}^{\frac{1}{n}} f\left(u+\frac{k}{n}\right)g\left(nu+k\right)du =\sum_{k=0}^{n-1} \int_{0}^{\frac{1}{n}} f\left(u+\frac{k}{n}\right)g(nu)du \end{align} $$ That's good, we got somewhere. Not quite there, but still... we can get a little more done now by swtiching integral and sum, and observing that after simplification the term $g(nu)$ does not depend on the summation index $k$ anymore: $$\begin{align} \int_0^1 f(x)g(nx)dx &= \sum_{k=0}^{n-1} \int_{0}^{\frac{1}{n}} f\left(u+\frac{k}{n}\right)g(nu)du = \int_{0}^{\frac{1}{n}} du \sum_{k=0}^{n-1} f\left(u+\frac{k}{n}\right)g(nu)\\ &= \int_{0}^{\frac{1}{n}} du\, g(nu) \sum_{k=0}^{n-1} f\left(u+\frac{k}{n}\right) \end{align} $$ Not too bad. Let's continue — eventually, we want integrals from $0$ to $1$, so let us switch back via a change of variables: $$\begin{align} \int_0^1 f(x)g(nx)dx &= \int_{0}^{\frac{1}{n}} du\, g(nu) \sum_{k=0}^{n-1} f\left(u+\frac{k}{n}\right) = \int_{0}^{1} dx\, g(x) \frac{1}{n}\sum_{k=0}^{n-1} f\left(\frac{x}{n}+\frac{k}{n}\right) \end{align} $$

That looks promising. Why? Well, if the last term had been $\frac{1}{n}\sum_{k=0}^{n-1} f\left(\frac{k}{n}\right)$ instead, we would have had a Riemann sum for $f$, whose limit as $n\to \infty$ is exactly $\int_0^1 f$... this is nice. But there is that extra $\frac{x}{n}$ which is preventing that from directly applying: this is where the (uniform, since on a bounded closed interval) continuity of $f$ should come into play, as $\frac{x}{n}\xrightarrow[n\to\infty]{}0$.

  • By the above, $$\begin{align} \int_{0}^{1} dx\, g(x) \frac{1}{n}\sum_{k=0}^{n-1} f\left(\frac{k}{n}\right) = \frac{1}{n}\sum_{k=0}^{n-1} f\left(\frac{k}{n}\right)\int_{0}^{1} g(x)dx \xrightarrow[n\to\infty]{} \int_{0}^{1} f(x)dx \int_{0}^{1} g(x)dx \end{align} \tag{1} $$
  • Let us control the difference, call it $\Delta_n$: $$\begin{align} \Delta_n &= \left\lvert \int_{0}^{1} dx\, g(x) \frac{1}{n}\sum_{k=0}^{n-1} f\left(\frac{k}{n}\right) - \int_{0}^{1} dx\, g(x) \frac{1}{n}\sum_{k=0}^{n-1} f\left(\frac{x}{n}+\frac{k}{n}\right) \right\rvert \\&= \left\lvert \int_{0}^{1} dx\, g(x) \frac{1}{n}\sum_{k=0}^{n-1} \left( f\left(\frac{k}{n}\right) - f\left(\frac{x}{n}+\frac{k}{n}\right) \right) \right\rvert \\ &\leq \int_{0}^{1} dx\, \lvert g(x)\rvert \frac{1}{n}\sum_{k=0}^{n-1} \left\lvert f\left(\frac{k}{n}\right) - f\left(\frac{x}{n}+\frac{k}{n}\right) \right\rvert \end{align} $$

    For convenience, write $\lVert g\rVert_\infty\stackrel{\rm def}{=} \max_{x\in[0,1]} \lvert g(x)\rvert$ (this exists, as $g$ is continuous). Fix any $\varepsilon > 0$, and — $f$ is uniformly continuous too — let $N_\varepsilon$ such that, for all $n\geq N_\varepsilon$, $\lvert f(x)-f(y) \rvert \leq \frac{\varepsilon}{\lVert g\rVert_\infty+1}$ whenever $x,y\in[0,1]$ satisfy $\lvert x-y\rvert \leq \frac{1}{n}$. (The $+1$ is just to avoid dividing by zero if $g$ is identically zero.)

    Then we are good: for any $n\geq N_\varepsilon$, since $\frac{x}{n} \leq \frac{1}{n}$, we get

    $$\begin{align} \Delta_n &\leq \int_{0}^{1} dx\, \lvert g(x)\rvert \frac{1}{n}\sum_{k=0}^{n-1} \left\lvert f\left(\frac{k}{n}\right) - f\left(\frac{x}{n}+\frac{k}{n}\right) \right\rvert\\ &\leq \int_{0}^{1} dx\, \lVert g\rVert_\infty \frac{1}{n}\sum_{k=0}^{n-1} \frac{\varepsilon}{\lVert g\rVert_\infty+1} = \varepsilon \frac{\lVert g\rVert_\infty}{\lVert g\rVert_\infty+1}\\ &< \varepsilon \end{align}$$ and since $\varepsilon>0$ was arbitrary, we just showed that $$\Delta_n \xrightarrow[n\to\infty]{} 0. \tag{2} $$

Combining (1) and (2) gives the limit:

$$ \int_0^1 f(x)g(nx)dx = \int_{0}^{1} dx\, g(x) \frac{1}{n}\sum_{k=0}^{n-1} f\left(\frac{k}{n}\right) +\Delta_n \xrightarrow[n\to\infty]{} \int_{0}^{1} f(x)dx \int_{0}^{1} g(x)dx+0 $$