Many of us know about the Dirichlet kernel which is on lower level stated as
$$D_n(\theta) =\frac {\sin \left(n+\frac 12\right)\theta}{\sin \frac {\theta}{2}}=1+2\sum_{r=1}^n \cos (r\theta)$$
I have a devised another similar formula for
$$\frac {\cos \left(n+\frac 12\right)\theta}{\cos \frac {\theta}{2}}$$
which I have verified and proved using some simple trigonometry and telescoping series but I want to know if I could somehow prove the result using complex numbers which I know is possible in the case of Dirichlet kernel. So the similar formula I devised be defined as
$$F_n(\theta)= \frac {\cos \left(n+\frac 12\right)\theta}{\cos \frac {\theta}{2}}= (-1)^n\left(1+2\sum_{r=1}^n (-1)^r \cos(r\theta)\right) $$
Any hints or some kind of help would be very beneficial.
You can actually prove it from the Dirichlet kernel by substituting for the angle. Replacing $\theta$ by $\theta+\pi$, we have $$ \frac{\sin{(n+1/2)(\theta+\pi)}}{\sin{(\theta+\pi)/2}} = \frac{\sin{(n+1/2)\theta}\cos{(n+1/2)\pi}+\cos{(n+1/2)\theta}\sin{(n+1/2)\pi}}{\cos{(\theta/2)}} \\ = \frac{\cos{(n+1/2)\theta}}{\cos{\theta}} (-1)^n, $$ while on the other side, $\cos{(r(\theta+\pi))} = \cos{r\theta}\cos{r\pi} = (-1)^r \cos{r\theta}$. Putting these together gives the result.
This also tells you that if you really want, you can prove this using complex numbers by considering the sum of $e^{ir(\theta+\pi)}$, with exactly the same steps as the Dirichlet kernel.