Show that the following limit of a Fourier looking integral exists Show that for any $f \in \mathcal{C}^{m}(\mathbb{R}; \mathbb{R})$:
$$\lim_{n\rightarrow \infty , n\in \mathbb{N}} n^m \int_0^1 f(\frac1n \cos(2\pi n x))\cos(2\pi n m x) dx $$
exists and express it in terms of $m$ and of the derivatives of $f$ in $0$.  
I started with $\cos(t) = \frac{e^{it}+e^{-it}}{2}$ to find a formula for $\cos (t)^n$ but don't know how to proceed after that.
 A: If $m=0$, the answer is trivially $f(0)$ by dominated convergence. With one integration by parts we have that
$$n^m \int_0^1 f\left(\frac{1}{n}\cos(2\pi n x)\right)\cos(2\pi m n x)\:dx$$
$$ =  \frac{n^{m-1}}{m}\int_0^1f'\left(\frac{1}{n}\cos(2\pi n x)\right)\sin(2\pi m n x)\sin(2\pi n x)\:dx$$
$$= \frac{n^{m-1}}{2m}\int_0^1f'\left(\frac{1}{n}\cos(2\pi n x)\right)\left(\cos(2\pi(m-1)nx) - \cos(2\pi(m+1)nx)\right)\:dx$$
Notice that the terms race each other to $0$, either $n^m$ becomes a negative power or the coefficient $m$ inside the cosine gets to $0$. The only term that survives the process repeatedly is the far left term since when $n^m$ becomes rational all the other terms will go to $0$.
After noticing the pattern we get a final answer of 
$$\lim_{n\to\infty}n^m \int_0^1 f\left(\frac{1}{n}\cos(2\pi n x)\right)\cos(2\pi m n x)\:dx = \frac{f^{(m)}(0)}{2^m\cdot m!}$$
If $f$ were analytic, we would additionally get that
$$\sum_{m=0}^\infty \lim_{n\to\infty}(nt)^m \int_0^1 f\left(\frac{1}{n}\cos(2\pi n x)\right)\cos(2\pi m n x)\:dx = f\left(\frac{t}{2}\right)$$
