I am looking at the convergence of the series $$ \cos(t\theta) = \frac{\sin(\pi t)}{\pi} \cdot \Bigg[\frac{1}{t} + 2t \sum_{k=1}^\infty (-1)^k \frac{\cos(k\theta)}{t^2 - k^2}\Bigg].$$ Here $t\in\mathbb{R}$. The above equality is rather trivial, but the convergence of the right side towards the left side is not straightforward to me. Based on empirical observations, we have convergence to the target function if $|\theta| <\pi$, regardless of $t$ (even if $t\in\mathbb{Z}$, by taking the limit). If $|\theta|>\pi$, we still have convergence, but towards a different function rather than $\cos(t\theta)$. Is that correct? How to prove it or find the conditions on $\theta,t$ for the convergence to $\cos(t \theta)$?