Clean proof for trigonometry identity? I know what the answer is, but I feel like there should be like a $1$-$2$ liner to compute this Fix $j,k$ with $0 \leq j,k \leq N$. If $j+k$ is even, (i.e. if $j,k$ have same parity), then
$$
\sum_{n=1}^{N-1} \cos\left(\frac{j\pi}Nn\right)\sin\left(\frac{k \pi}Nn\right) = 0 
$$
and
$$
\sum_{n=0}^{N-1} \cos\left(\frac{j\pi}Nn\right) \cos\left(\frac{k\pi}Nn\right) = 0 
$$
Except the second sum is $4$ for $j=k$.
 A: Let $S_1$ be the sum in the first equation and let $S_2$ be what you get when you replace $\sin$ with $\cos$ and $\cos$ with $\sin$, i.e.
\begin{align*}
S_1 &= \sum_{n=0}^{n-1} \cos \left( \frac{nj\pi}N \right) \sin \left( \frac{nk\pi}N \right) & S_2 &= \sum_{n=0}^{n-1} \sin \left( \frac{nj\pi}N \right) \cos \left( \frac{nk\pi}N \right)
\end{align*}
Then
\begin{align*}
S_1 + S_2 &= \sum_{n=0}^{n-1} \cos \left( \frac{nj\pi}N \right) \sin \left( \frac{nk\pi}N \right) + \sin \left( \frac{nj\pi}N \right) \cos \left( \frac{nk\pi}N \right) = \sum_{n=0}^{n-1} \sin \left( \frac{n(j+k)\pi}{N} \right) = 0
\end{align*}
(note: this would not equal zero if $j$ and $k$ did not have the same parity)
and by a similar calculation $S_1 - S_2 = 0$. Then
$$2S_1 = (S_1 + S_2) + (S_1 - S_2) = 0$$
so $S_1 = 0$. We can employ the same trick (swap the sines and the cosines to get a sum formula) to prove the second equation.
I'm not sure if this proof is sufficiently clean; I've tried to keep it brief because the crux of the proof (defining $S_2$ and calculating $S_1 - S_2$ and $S_1 + S_2$) is quite clean.
