Is $\lim\limits_{n \to \infty}\frac{1}{n}\left( \cos{\frac{\pi}{n}} + \cos{\frac{2\pi}{n}} + \ldots + \cos{\frac{n\pi}{n}} \right)$ a Riemann sum? This is probably simple, but I'm solving a practice problem:
$\lim_{n \to \infty}\frac{1}{n}\left( \cos{\frac{\pi}{n}} + \cos{\frac{2\pi}{n}} + \ldots +\cos{\frac{n\pi}{n}} \right)$
I recognize this as the Riemann sum from 0 to $\pi$ on $\cos{x}$, i.e. I think its the integral
$\int_0^\pi{ \cos{x}dx }$
which is 0, but the book I'm using says it should be
$ \frac{1}{\pi}\int_0^\pi{ \cos{x}dx }$
Still 0 anyway, but where did the $\frac{1}{\pi}$ in front come from?
 A: Assume that $x_{k-1}\leq c_{k}\leq x_{k}$, $x_{0}=0,x_{n}=\pi $, and that the interval of integration is divided into $n$ sub-intervals of equal width. Under these circumstances $x_{k}-x_{k-1}=\dfrac{\pi }{n}$ and
$$\begin{eqnarray*}\lim_{n\rightarrow \infty }\frac{1}{n}\sum_{k=1}^{n}\cos \frac{k\pi }{n}&=&\lim_{n\rightarrow \infty }\sum_{k=1}^{n}\cos \left( c_{k}\right) \frac{%
x_{k}-x_{k-1}}{\pi }\\
&=&\lim_{n\rightarrow \infty }\sum_{k=1}^{n}\left(\frac{1}{\pi }\cos \left(
c_{k}\right)\right) (x_{k}-x_{k-1})\\
&=&\int_{0}^{\pi }\frac{1}{\pi }\cos x\ dx\end{eqnarray*}$$
The sum $\displaystyle\sum_{k=1}^{n}\left(\dfrac{1}{\pi }\cos \left(
c_{k}\right)\right) (x_{k}-x_{k-1})$ is a Riemann Sum of the function $f(x)=\dfrac{1}{\pi }\cos x$ in the interval $[0,\pi]$, but not of the function $\cos x$.
A: The Riemann sum is given by $$S=\sum_{i=1}^{n}f(y_{i})(x_{i}-x_{i-1})$$ where $x_{i-1}\leq y_{i}\leq x_{i}$. If you choose $f(y_{i})=\cos(y_{i})$, $y_{i}=\frac{i \pi}{n}$ and $x_{i}=\frac{i \pi}{n}$ you get
$$\int_{0}^{\pi} \cos(x)dx=\lim_{n\rightarrow{\infty}}\sum_{i=1}^{n}\cos\left(\frac{i \pi}{n}\right)(x_{i}-x_{i-1})$$ which is just the sum you have with an extra factor $\pi$. Therefore
$$\frac{1}{\pi}\int_{0}^{\pi} \cos(x)dx=\lim_{n\to\infty}\frac{1}{n}\left( \cos{\frac{\pi}{n}} + \cos{\frac{2\pi}{n}} + \ldots \cos{\frac{n\pi}{n}} \right)$$
A: $$\sum_{k=0}^n \cos\left(\frac{k\pi}{n}\right) = 0$$
So the expression equals to $-1/n$, and the limit is trivially equal to zero.
A: The key to this last assertion is the simple fact that $$\cos(\pi - x) = -\cos(x).$$  Said symmetry can be observed directly from the definition of the cosine function via the unit circle.
A: The sum is also the real part of
$$\frac{1}{n}\left(e^{i\frac{\pi}{n}}+e^{i\frac{2\pi}{n}}+\ldots+e^{i\frac{n\pi}{n}}\right) \; .$$
