<s>[INST] How can I calculate this (rather tricky) limit? $$\lim\limits_{n \to \infty} \cos^{n^2} \left (\frac{2x}{n} \right)$$
Any hints and/or help is greatly appreciated.
 [/INST] Consider $$a_n=\cos^{n^2} \left (\frac{2x}{n} \right)\implies \log(a_n)=n^2\log\left( \cos\left (\frac{2x}{n} \right)\right)$$ Now use the series expansion
$$\cos\left (\frac{2x}{n} \right)=1-\frac{2 x^2}{n^2}+\frac{2 x^4}{3 n^4}+O\left(\frac{1}{n^6}\right)$$
$$\log\left( \cos\left (\frac{2x}{n} \right)\right)=-\frac{2 x^2}{n^2}-\frac{4 x^4}{3 n^4}+O\left(\frac{1}{n^6}\right)$$
$$\log(a_n)=-2 x^2-\frac{4 x^4}{3 n^2}+O\left(\frac{1}{n^4}\right)$$
$$a_n=e^{\log(a_n)}=e^{-2 x^2}\left( 1-\frac{4 x^4}{3 n^2}\right)+O\left(\frac{1}{n^4}\right)$$
</s>