Find a closed form for the following definite integral:
$$ I =\int_0^\pi \left( \frac{2 + 2\cos (x) - \cos((k-\frac{1}{2})x) - 2\cos ((k+\frac{1}{2})x) - \cos((k+\frac{3}{2})x)}{1-\cos(2x)}\right) \mathrm{d}x, $$ where $k \in \mathbb{N}_{>0}$.
This is related to a question posted by prof. Igor Rivin in a comment to another question of mine. It has been already proven that $I \in \mathbb{Q}$, but finding a simple closed form is harder.