Show that
$$
\textstyle
2\sin \frac12 \theta \, \cos r\theta = \sin\big(r+\frac12\big)\theta -
\sin\big(r-\frac12\big)\theta
\;.
$$
Hence, or otherwise, find all solutions of the equation
$$
\cos a\theta + \cos (a + 1) \theta + \dots + \cos(b-2)\theta+\cos (b - 1 ) \theta = 0
\;,
$$
where $a$ and $b$ are positive integers with $a < b-1\,$.