How to sum $\sum_{x=0}^{N-1} \cos{\left( \frac{2\pi x}{N} \right)}^{2}$?

87 Views Asked by At

I've tried solving it, but I'm not familiar with these kind of progressions and I couldn't get to a result. Also, I've found that the result is just $N/2$, but I don't get why would that be the answer, as it doesn't work for $N=1$ or $N=2$.

Appreciate your help :)

2

There are 2 best solutions below

0
On BEST ANSWER

$$\sum_{x=0}^{N-1} \cos^2{\left( \frac{2\pi x}{N} \right)}=\sum_{x=0}^{N-1} \frac{1+\cos\left( \frac{4\pi x}{N}\right)}{2} =\boxed{\frac N2}+\frac12\sum_{x=0}^{N-1}\cos\left( \frac{4\pi x}{N}\right)\tag1$$

Now let compute the latter sum: $$ \sum_{x=0}^{N-1}\cos\left( \frac{4\pi x}{N}\right)= \operatorname{Re}\sum_{x=0}^{N-1}\exp\left( \frac{4\pi x}{N}i\right) =\operatorname{Re}\frac{1-\exp\left(4\pi i\right)}{1-\exp\left(\frac{4\pi}{N}i\right)}=0,\tag2 $$ where we applied the formula for the sum of geometric progression.

Observe that the last equality is valid only for $N>2$, since for $N=1,2$ the denominator degenerates to $0$. More generally $$\sum_{x=0}^{N-1}\exp\left( \frac{2K\pi x}{N}i\right)=0$$ for all $N $ except for the divisors of $K $.

0
On

Not for finite $N$, but a cute and fast way to see that asymptotically the result is true, and thus gives a simple sanity check as to "why [that] would be the answer."

If you are familiar with Riemann sums: you can write $$ \sum_{k=0}^{N-1} \cos\!\left(\frac{2\pi k}{N}\right)^2= N\cdot \frac{1}{N}\sum_{k=0}^{N-1} \cos\!\left(\frac{2\pi k}{N}\right)^2 =N\cdot \frac{1}{N}\sum_{k=0}^{N-1} f\!\left(\frac{k}{N}\right) $$ for $f\colon[0,1]\to\mathbb{R}$ defined by $f(x) = \cos(2\pi x)^2$. Now, under mild assumptions easy to check here, you get $$ \frac{1}{N}\sum_{k=0}^{N-1} f\!\left(\frac{k}{N}\right) \xrightarrow[N\to\infty]{} \int_0^1 f(x)dx $$ so you just need to compute $$ \int_0^1 \cos(2\pi x)^2dx = \frac{1}{2}. $$


This last part follows from (1) $ \int_0^1 \cos(2\pi x)^2dx + \int_0^1 \sin(2\pi x)^2dx = 1 $ (since $\cos^2+\sin^2=1$) and (2) $\int_0^1 \cos(2\pi x)^2dx = \int_0^1 \sin(2\pi x)^2 dx $ (e.g., via integration by parts).