What is $\sum_{k=-\infty}^{\infty} \frac{(-1)^k}{x+(2k+1)}$? Is there a closed form for the following?$$\sum_{k=-\infty}^{\infty} \frac{(-1)^k}{x+(2k+1)}$$
I know that the non-sign-alternating sum for all integer k (i.e. $\sum \frac{1}{x+k}$)is $\pi cot(\pi x)$.  But I am not able to use that result to get what I want.
 A: Split it up:
$$\sum_{k=-\infty}^\infty\frac{(-1)^k}{x+2k+1}=\sum_{k=-\infty}^\infty\underbrace{\frac1{x+4k+1}}_{S_1}-\underbrace{\frac1{x+4k+3}}_{S_2}$$
$$S_1=\sum_{k=-\infty}^\infty\frac1{4k+x+1}=\frac14\sum_{k=-\infty}^\infty\frac1{k+\frac{x+1}4}=\frac\pi4\cot\left(\frac{x+1}4\pi\right)$$
$$S_2=\sum_{k=-\infty}^\infty\frac1{4k+x+3}=\frac14\sum_{k=-\infty}^\infty\frac1{k+\frac{x+3}4}=\frac\pi4\cot\left(\frac{x+3}4\pi\right)$$
$$\sum_{k=-\infty}^\infty\frac{(-1)^k}{x+2k+1}=\frac\pi4\left[\cot\left(\frac{x+1}4\pi\right)+\tan\left(\frac{x+1}4\pi\right)\right]=\frac\pi2\sec\left(\frac{\pi x}2\right)$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\sum_{k = -\infty}^{\infty}{\pars{-1}^{k} \over x + \pars{2k + 1}} =
{1 \over x + 1} + \sum_{k = 1}^{\infty}\bracks{%
{\pars{-1}^{-k} \over x + \pars{-2k + 1}} +
{\pars{-1}^{k} \over x + \pars{2k + 1}}}
\\[5mm] = &\
-\,{1 \over x + 1} + {1 \over 2}\sum_{k = 0}^{\infty}\bracks{%
{\pars{-1}^{k} \over k + \pars{x + 1}/2} -
{\pars{-1}^{k} \over k - \pars{x + 1}/2}}
\\[5mm] = &\
-\,{1 \over 4\xi} + 
\bracks{{1 \over 2}\sum_{k = 0}^{\infty}{\pars{-1}^{k} \over k + 2\xi} -
\pars{~\xi \leftrightarrow -\xi~}}\qquad
\mbox{where}\quad \xi \equiv {1 \over 4}\pars{x + 1}.\label{1}\tag{1}
\end{align}

Then,
\begin{align}
{1 \over 2}\sum_{k = 0}^{\infty}{\pars{-1}^{k} \over k + 2\xi} & =
{1 \over 2}\sum_{k = 0}^{\infty}
\pars{{1 \over 2k + 2\xi} - {1 \over 2k + 1 + 2\xi}} =
{1 \over 4}\sum_{k = 0}^{\infty}
\pars{{1 \over k + \xi} - {1 \over k + \xi + 1/2}}
\\[5mm] & =
{H_{\xi - 1/2} - H_{\xi - 1} \over 4}\qquad\pars{~H_{z}:\ Harmonic Number~}
\label{1.a}\tag{1.a}
\end{align}

\eqref{1} becomes:
\begin{align}
&\sum_{k = -\infty}^{\infty}{\pars{-1}^{k} \over x + \pars{2k + 1}} =
-\,{1 \over 4\xi} + \pars{%
{H_{\xi - 1/2} - H_{\xi - 1} \over 4} - {H_{-\xi - 1/2} - H_{-\xi - 1} \over 4}}
\\[5mm] = &\  
{H_{\xi - 1/2} - H_{-\xi - 1/2} \over 4} -
{\pars{H_{\xi - 1} + 1/\xi} - H_{-\xi - 1} \over 4} =
{H_{\xi - 1/2} - H_{-\xi - 1/2} \over 4} -
{H_{\xi} - H_{-\xi - 1} \over 4}
\label{2}\tag{2}
\end{align}
where I used the $\ds{H_{z}}$ Recursive Property.

With Euler Reflection Formula:
$$
\left\{\begin{array}{l}
\ds{H_{\xi - 1/2} - H_{-\xi - 1/2} =
\pi\cot\pars{\pi\,\bracks{-\xi + {1 \over 2}}} = \bbx{\pi\tan\pars{\pi\xi}}}
\\[5mm]
\ds{H_{\xi} - H_{-\xi - 1} =
\pi\cot\pars{\pi\bracks{-\xi}} =
\bbx{-\pi\cot\pars{\pi\xi}}}
\end{array}\right.
$$

\eqref{2} becomes:
\begin{align}
\sum_{k = -\infty}^{\infty}{\pars{-1}^{k} \over x + \pars{2k + 1}} & =
{1 \over 4}\,\pi\bracks{\tan\pars{\pi\xi} + \cot\pars{\pi\xi}} =
{1 \over 4}\,\pi\,{\sec^{2}\pars{\pi\xi} \over  \tan\pars{\pi\xi}} =
{1 \over 2}\,\pi\,{1 \over \sin\pars{2\pi\xi}}
\\[5mm] & = {1 \over 2}\,\pi\,
{1 \over \sin\pars{\pi x/2 + \pi/2}} =
\bbox[#ffe,15px,border:1px dotted navy]{%
{1 \over 2}\,\pi\sec\pars{\pi x \over 2}}
\end{align}
A: From the residue theorem we know that $$\sum_{k\in\mathbb{Z}}\left(-1\right)^{k}f\left(k\right)=-\sum\textrm{residues of }\pi\csc\left(\pi z\right)f\left(z\right)\textrm{ at }f\left(z\right)\textrm{ poles}$$ where $f\left(z\right)$ verifies some hypotheses (see here). So since we have a simple pole at $z=\left(-x-1\right)/2,$ we get $$\sum_{k\in\mathbb{Z}}\frac{\left(-1\right)^{k}}{x+2k+1}=-\underset{z=\left(-x-1\right)/2}{\textrm{Res}}\frac{\pi\csc\left(\pi z\right)}{2z+1+x}=\color{red}{\frac{\pi}{2}\sec\left(\frac{\pi}{2}x\right)}$$ as wanted.
