I have the equation
$\sum_1^N \cos\omega_p t\cos\omega_qt$
Where N is an even number representing the number of time steps
$\omega_p=\frac{2\pi p}{N}$ p=1,...,$\frac{N}{2}$
I need to prove the following 3 cases:
Case 1:
$\sum_1^N \cos\omega_p t\cos\omega_qt=0$
if $p \neq q$
Case 2:
$\sum_1^N \cos\omega_p t\cos\omega_qt=N$
if $p=q=\frac{N}{2}$
Case 3:
$\sum_1^N \cos\omega_p t\cos\omega_qt=\frac{N}{2}$
if $p=q\neq\frac{N}{2}$
The 2nd case is easy:
$p=q=\frac{N}{2}$ hence $\omega_p=\omega_q=\pi$
clearly when this value is substituted in
$\cos\omega_p t\cos\omega_qt=1$
and summing this N times gives N
I'm having problems with the other two cases?
Taking the 3rd case first:
$\cos\omega_p t\cos\omega_qt$
$=\frac{1}{2}[cos(\omega_p t-\omega_q t)+cos(\omega_p t+\omega_q t)] $
given in this case: $p=q\neq\frac{N}{2}$
$=\frac{1}{2}[cos(0)+cos(2\omega_p t)]$
$=\frac{1}{2}[1+cos(2\omega_p t)]$
To get the correct answer the $cos(2\omega_p t)$ must equal zero in every case. But as far as I can see it will only happen when $\omega_p=\frac{\pi}{4}$ which will certainly not be true for all p?
We have $$\begin{align} \cos \omega_pt \cos \omega_qt &=\frac12(\cos (\omega_p-\omega_q)t+\cos (\omega_p+\omega_q)t)\\\\ &=\frac12(\cos (2\pi(p-q)/N)t+\cos (2\pi(p+q)/N)t)\\\\ &=\frac12\text{Re}\left(e^{i(2\pi(p-q)/N)t}+e^{i(2\pi(p+q)/N)t}\right)\tag 1 \end{align}$$
CASE 1:
Summing $(1)$ from $t=1$ to $t=N$ reveals that for $p\ne q$
$$\sum_{t=1}^N\,\cos \omega_pt \cos \omega_qt =\frac12\left(\frac{\cos\left(\frac{\pi(p+q)(N+1)}{N}\right)\sin(\pi(p+q))}{\sin\left(\frac{\pi(p+q)}{N}\right)}+\frac{\cos\left(\frac{\pi(p-q)(N+1)}{N}\right)\sin(\pi(p-q))}{\sin\left(\frac{\pi(p-q)}{N}\right)}\right)$$
which is obviously zero for $p\ne q$ since the numerators have terms $\sin (\pi(p\pm q)) =0$. It is important to remark that the denominators are not zero since $0<p+q<N$ whenever $p\ne q$.
CASE 3:
Summing $(1)$ from $t=1$ to $t=N$ reveals that for $p=q \ne N/2$
$$\sum_{t=1}^N\,\cos \omega_pt \cos \omega_qt =\frac12\left(\frac{\cos\left(\frac{2\pi p(N+1)}{N}\right)\sin 2\pi p}{\sin\left(\frac{2\pi p}{N}\right)}+N\right)$$
which is obviously N/2 for $p = q\ne N/2$ since the numerator has the term $\sin 2\pi p =0$. It is important to remark that the denominator is not zero since $2p<N$.