Limit involving cosine function 
How to find
$$\lim_{n \rightarrow \infty}\; \frac{1}{n}\;\sum_{k=1}^{\Big\lfloor\frac{n}{2}\Big\rfloor} \cos\Big(\frac{k\pi}{n}\Big)$$?

I know the method when the upper limit is simply $n$, namely it converges to $\int_0^1 f(x)\;dx$ where $f$ is monotonically increasing on an interval ( in this case our term is of the form $\frac{1}{n} \sum f(k/n)$ )
But here the upper limit is $\Big\lfloor\frac{n}{2}\Big\rfloor$.
How to approach this?

Define $C_n=\sum_{i=1}^{\lfloor n/2\rfloor}\cos(k\pi/n)$ and note that the sequence $(C_n)$ is non-decreasing, hence it is enough to check for even values of $n$, indeed:
$$
\frac{2n}{2n+1}\cdot \frac{C_{2n}}{2n} \le \frac{C_{2n+1}}{2n+1} \le \frac{2n+2}{2n+1}\cdot \frac{C_{2n+2}}{2n+2}.
$$
Therefore
$$
\lim_{n\to \infty}\frac{C_{2n}}{2n}=\frac{1}{2}\lim_{n\to \infty}\frac{1}{n}\sum_{i=1}^n \cos\left(\frac{k\pi}{2n}\right).
$$
Now you know how to conclude.
