Prove of average of a periodic function If there exists a function $q:[0,\infty)\to\mathbb{R}$ and $q$ is periodic in $p$. So we can write:
$$q(x+p)=q(x)$$
How to prove that:
$$\lim_{m\to\infty}\frac{1}{m}\int_0^mq(x)dx=\frac{1}{p}\int_0^pq(x)dx$$
 A: You can write
$$
\int_0^mq(x)dx = \left\lfloor\frac{m}{p}\right\rfloor\int_0^pq(x)dx + R_m
$$
where $|R_m|<Mp$, where $M$ is the maximum value of $|q(x)|$ over a period (why?). Note that $m=\left\lfloor\frac{m}{p}\right\rfloor p + r_m$ for some real $0\leq r_m < p$ (why?). This means that $\frac{1}{m}\left\lfloor\frac{m}{p}\right\rfloor = \frac{1}{p} - \frac{r_m}{pm}$. We can then write the integral in question as
$$
\frac{1}{m}\int_0^mq(x)dx = \left(\frac{1}{p}-\frac{r_m}{pm}\right)\int_0^pq(x)dx + \frac{R_m}{m}
$$
You should be able to finish it from here.
A: Here is another approach:
Let $\bar{q} = \int_0^p q(x)dx$.
Let $\phi(t) = \int_0^t (q(x)-\bar{q})dx$ and note that $\phi$ is continuous, $p$-periodic and $\phi(0) = 0$, hence $\phi$ is bounded by some $M$.
Then $|{1 \over m} \int_0^m (q(x)-\bar{q})dx| \le {M \over m}$ and hence we get
the desired result.
A: The integral in a large range (whatever it is) covers a large number of whole periods plus a fraction of a period.
$$\frac{I_m}m=\frac{nI_T+I'}{nT+T'}\to\frac{I_T}T.$$
