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)$?


**Purpose**


This was part of a bigger project to find an analytic continuation of $\zeta^\*(s)$ where $\zeta^\*(s) = \zeta(s)$ if $\Re(s)$ is an integer. The hope was that the analytic continuation would coincide with $\zeta(s)$. You may replace $\zeta,\zeta^\*$ by the Dirichlet eta function or related functions. You could do the same using $\Im(s)$ instead of $\Re(s)$.


The first step is establish the following and check when it is valid, for an arbitrary even function $f(t)$:


$$ f(t) = \frac{\sin(\pi t)}{\pi} \cdot \Bigg[\frac{f(0)}{t} + \phi'(t)\sum\_{k=1}^\infty (-1)^k \frac{f(k)}{\phi(t) - \phi(k)}\Bigg].$$
Here I used $\phi(t)=t^2$. Then have a similar formula for odd functions, and by combining both, a formula for any function regardless of parity.


I did get some pretty decent approximation (analytic extension) when working with $\Re(s)$ fixed and $t$ is the variable. But not an exact continuation. However, it does not lead to anything interesting, even if the approximation was exact. It's less accurate anyway as $t$ increases.


What I really wanted is the same thing but with $\Im(s)$ fixed instead, and $\sigma$ playing the role of $t$. There I failed; it would have been an exciting development otherwise. I am not finished yet, as there are plenty of options for $\phi(t)$, not just $\phi(t)=t^2$. I tried many low-hanging fruits; all failed. There has to be some $\phi$ that will work, I guess, though it won't be a simple function. You could choose $\phi$ by solving an integral equation in $\phi$ so that the RHS matches the LHS. Anyway, that's where I am now. Not sure if I will pursue the idea.



Convergence of series related to partial fraction expansion of cotangent function
Here's a complex analysis proof. For $|\theta|\leq\pi,$ we have that
$$
F(t)=\frac{\cos(\theta t)\pi}{\sin (\pi t)}
$$
is an odd meromorphic function for $t\in\mathbb{C}$ with simple poles at $k\in\mathbb{Z}$, which moreover is bounded as $|\Im t|\to\infty$.


We claim that the series in brackets
$$
G(t)=\frac{1}{t} + 2t \sum\_{k=1}^\infty (-1)^k \frac{\cos(k\theta)}{t^2 - k^2}
$$
has all the same properties. Indeed, we have
$$
\left|(-1)^k\frac{\cos (k\theta)}{t^2-k^2}\right|\leq 
\frac{1}{|(\Re t)^2-(\Im t)^2-k^2|}\leq \frac{2}{(\Im t)^2+k^2},
$$
if either $(\Im t)^2\geq 2(\Re t)^2$, or $k^2\geq 2(\Re t)^2$. From the latter case, the series converges absolutely and uniformly on compact subsets of $\mathbb{C}\setminus \mathbb{Z}$, and the former case can be used to show, e.g., by comparing with the integral, that $|G(t)|$ is bounded over $|\Im t|\geq 10$, say. The poles at $\pm k$ only come from $k$-th term.


Now we simply note that $F$ and $G$ have the same residues at the poles, so $F-G$ is a holomophic function in the whole plane $\mathbb{C}.$ It is enough to show that $F-G$ is bounded, then it is constant by Liouville's theorem, and since it is odd, the constant is zero.


To check boundedness, by maximum principle, it suffices to upper-bound $|F|$ and $|G|$ separately on the boundary of each box $$R\_m=\left\{m-\frac12<\Re t<m+\frac12,|\Im t|\leq 10\right\},$$
by a constant independent of $m$. For $F$, we just upper-bound $|\cos t\theta|\leq e^{10|\theta|}$ and lower-bound $\sin(\pi t)$ by its minimum (which is independent of $m$ by periodicity). For $G$, we notice that we can actually write, for any $m$,
\begin{multline}
G(t)=\lim\_{N\to\infty}\sum\_{k=-N}^N(-1)^k\cos(k\theta)\frac{1}{t-k}=\lim\_{N\to\infty}\sum\_{k=-N+m}^{N+m}(-1)^k\cos(k\theta)\frac{1}{t-k}\\=\frac{(-1)^m}{t-m}+2(t-m)\sum\_{k=1}^\infty(-1)^{k-m}\frac{\cos((k-m)\theta)}{(t-m)^2-k^2},
\end{multline}
and bounding the absolute value term by term, as above, on the boundary of $R\_m$, yields an estimate independent of $m$.


If $\theta>\pi$, then $F(t)$ is no longer bounded as $t\to\infty$, while the RHS still is, so the equality cannot hold. As noted by Conrad in the comments, the RHS does not change under replacing $\theta\mapsto \theta+2\pi m$, so by choosing an appropriate $m$ we can reduce this to the previous case.


