Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
If the "$1/n$" represents the $\triangle x$, then notice that the "$k/n$"s in the sum are being multiplied by $\pi$. Thus, this isn't the Riemann sum of $\cos x$ from $0$ to $\pi$, but of $\cos(\pi x)$ from $0$ to $1$. Alternatively, if you multiply the $1/n$ by $\pi$, then your $\triangle x$ will incorporate the $\pi$, and you'll have the Riemann sum for $\cos x$; but you'll have to divide the result by $\pi$ to make up for multiplying by $\pi$ earlier. – Blue Nov 27 '10 at 20:21
Since "the book" points you to the integral, I'm guessing this is an exercise in recognizing Riemann sums. However, there is also a more-direct approach to the limit: set aside $\cos(n\pi/n)$, and pair each remaining $\cos(k\pi/n)$ with $\cos((n-k)\pi/n)$; these pairs cancel, leaving only the set-aside term (with value $-1$) in the sum. The limit of $-1/n$ as $n\to\infty$ is zero. – Blue Nov 27 '10 at 20:35
$\pi$ is the width of the interval of integration. – Américo Tavares Nov 27 '10 at 21:12
up vote 10 down vote accepted

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)$$

share|cite|improve this answer
@Robert Smith, You have forgotten to write $\lim_{n\rightarrow \infty }$ before the sum $\displaystyle\sum_{i=1}^{n}\left(\dfrac{i\pi}{n}\right) (x_i-x_{i-1})$. – Américo Tavares Nov 27 '10 at 20:52
I mean of course $\cos\left(\dfrac{i\pi}{n}\right)$ – Américo Tavares Nov 27 '10 at 21:02
@Americo: Right, fixed now. – Robert Smith Nov 27 '10 at 21:21
you need to put in another $\lim_{n \rightarrow \infty}$ in the last equation too – Zarrax Nov 27 '10 at 21:27
Conversely you can put $f(y_i) = cos(\pi y_i)$ and you will get the same result because the $\pi$ comes out on the bottom when you integrate $cos(\pi x)$. – AnonymousCoward Nov 28 '10 at 0:06

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$.

share|cite|improve this answer

$$\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.

share|cite|improve this answer

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.

share|cite|improve this answer

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) \; .$$

share|cite|improve this answer
True, but what does this have to do with the question being asked? It seems a completely orthogonal point... – Steven Stadnicki Nov 28 '10 at 2:34
Why use Riemann sums, when you can solve it differently? – Raskolnikov Nov 28 '10 at 11:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.