Infinite sum with cosine Any idea how to evaluate this series?
$$\sum_{n=1}^{+\infty} \frac{(-1)^n \cos[(2n+1)\theta]}{(2n)^2-1}$$
where $0 \leq \theta \leq \pi/2$.
 A: $$
\begin{align}
& \cos\left(\theta(2n+1)\right) = \frac{1}{2}\left[e^{-i\,\theta(2n+1)}+e^{+i\,\theta(2n+1)}\right] = \frac{1}{2}\frac{e^{-i\,2\theta(2n+1)}+1}{e^{-i\,\theta(2n+1)}} = \frac{1}{2}\frac{e^{+i\,2\theta(2n+1)}+1}{e^{+i\,\theta(2n+1)}} \\[4mm]
& \frac{1}{(2n)^2-1} = \frac{1}{(2n-1)(2n+1)} = \frac{1}{2}\left[\frac{1}{2n-1}-\frac{1}{2n+1}\right] \\[4mm]
& \arctan(z) = \sum_{n=0}^{\infty}(-1)^n\frac{z^{2n+1}}{2n+1} = -\sum_{n=1}^{\infty}(-1)^n\frac{z^{2n-1}}{2n-1} \\[8mm]
& \sum_{n=1}^{\infty}(-1)^n\frac{\cos\left(\theta(2n+1)\right)}{(2n)^2-1} \\[4mm]
& \qquad = \frac{1}{4}\sum_{n=1}^{\infty}(-1)^n\left[+\frac{\left(e^{-i\,\theta}\right)^{2n+1}}{2n-1}+\frac{\left(e^{+i\,\theta}\right)^{2n+1}}{2n-1}-\frac{\left(e^{-i\,\theta}\right)^{2n+1}}{2n+1}-\frac{\left(e^{-i\,\theta}\right)^{2n+1}}{2n+1}\right] \\[4mm]
& \qquad = \frac{1}{4}\sum_{n=1}^{\infty}(-1)^n\left[+e^{-i\,2\theta}\frac{\left(e^{-i\,\theta}\right)^{2n-1}}{2n-1}+e^{+i\,2\theta}\frac{\left(e^{+i\,\theta}\right)^{2n-1}}{2n-1}-\frac{\left(e^{-i\,\theta}\right)^{2n+1}}{2n+1}-\frac{\left(e^{-i\,\theta}\right)^{2n+1}}{2n+1}\right] \\[4mm]
& \qquad = \frac{1}{4}\left[\small -e^{-i\,2\theta}\arctan\left(e^{-i\,\theta}\right)-e^{+i\,2\theta}\arctan\left(e^{+i\,\theta}\right)-\left(\arctan\left(e^{-i\,\theta}\right)-e^{-i\,\theta}\right)-\left(\arctan\left(e^{+i\,\theta}\right)-e^{+i\,\theta}\right)\normalsize\right] \\[4mm]
& \qquad = \frac{1}{4}\left[\left(e^{-i\,\theta}+e^{+i\,\theta}\right)-\left(e^{-i\,2\theta}+1\right)\arctan\left(e^{-i\,\theta}\right)-\left(e^{+i\,2\theta}+1\right)\arctan\left(e^{+i\,\theta}\right)\right] \\[4mm]
& \qquad = \frac{1}{4}\left[2\cos(\theta)-2\cos(\theta)\,e^{-i\,\theta}\arctan\left(e^{-i\,\theta}\right)-2\cos(\theta)\,e^{+i\,\theta}\arctan\left(e^{+i\,\theta}\right)\right] \\[4mm]
& \qquad = \color{red}{\frac{\cos(\theta)}{2}\left[1-\left(e^{-i\,\theta}\arctan\left(e^{-i\,\theta}\right)+e^{+i\,\theta}\arctan\left(e^{+i\,\theta}\right)\right)\right]} \\[4mm]
& \quad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\color{white}{\text{.}}
\end{align}
$$
