Infinite sum and the conditions with tanh Is there a way to prove this relation?:
$$\sum_{\text{n}=0}^\infty\frac{1}{\text{s}^2+\left(1+2\text{n}\right)^2\omega^2}=\frac{\pi\tanh\left(\frac{\pi\text{s}}{2\omega}\right)}{4\text{s}\omega}$$
And find the conditions for which this equality hold?
 A: A real-analytic derivation through Fourier series.

You may remove a useless parameter by setting $s=\omega t$ then look for a closed form for
$$ S(t)=\sum_{n\geq 0}\frac{1}{t^2+(2n+1)^2}\tag{1} $$
Integration by parts gives a useful lemma:
$$ \forall a,b>0,\qquad\int_{0}^{+\infty}\frac{\sin(a x)}{a} e^{-bx}\,dx = \frac{1}{a^2+b^2}\tag{2} $$
and
$$ \sum_{n\geq 0}\frac{\sin((2n+1)x)}{2n+1}=W(x)\tag{3} $$
is a $2\pi$-periodic rectangle wave that equals $\frac{\pi}{4}$ over $(0,\pi)$ and $-\frac{\pi}{4}$ over $(\pi,2\pi)$. By exploiting $(2)$ and $(3)$,
$$ S(t) = \int_{0}^{+\infty}W(x) e^{-tx}\,dx =\frac{\pi}{4}\sum_{n\geq 0}(-1)^n\int_{n\pi}^{(n+1)\pi}e^{-tx}\,dx\tag{4}$$
and by computing the last integrals and the resulting geometric series,
$$ \sum_{n\geq 0}\frac{1}{t^2+(2n+1)^2}=\color{red}{\frac{\pi}{4t}\,\tanh\left(\frac{\pi t}{2}\right)}\tag{5}$$
follows. The same can be achieved through the Poisson summation formula.
A: Using the identity $$\sum_{n\in\mathbb{Z}}f\left(n\right)=-\sum\left\{ \textrm{Residues of }\pi\cot\left(\pi z\right)f\left(z\right)\textrm{ at }f'\textrm{s poles}\right\} $$ which follows from the residue theorem we have $$\sum_{n\geq0}\frac{1}{s^{2}+\left(2n+1\right)^{2}\omega^{2}}=\frac{1}{2}\sum_{n\in\mathbb{Z}}\frac{1}{s^{2}+\left(2n+1\right)^{2}\omega^{2}}$$ and since we have poles at $z=-\frac{1}{2}\pm\frac{i\sqrt{s^{2}}}{2\sqrt{\omega^{2}}}$ we can conclude that $$\sum_{n\geq0}\frac{1}{s^{2}+\left(2n+1\right)^{2}\omega^{2}}=\color{red}{\frac{\pi\tanh\left(\frac{\pi s}{2\omega}\right)}{4s\omega}}$$ as wanted.
A: $\newcommand{\bbx}[1]{\,\bbox[8px,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_{\mrm{n} = 0}^{\infty}
{1 \over \mrm{s}^{2} + \pars{1 + 2\mrm{n}}^{2}\omega^{2}} =
{1 \over 4\omega^{2}}\sum_{\mrm{n} = 0}^{\infty}
{1 \over \pars{\mrm{n} + 1/2}^{2} + \mrm{s}^{2}/\pars{4\omega^{2}}}
\\[5mm] = &\
{1 \over 4\omega^{2}}\sum_{\mrm{n} = 0}^{\infty}{1 \over
\bracks{\mrm{n} + 1/2 + \mrm{s}\,\ic\,/\pars{2\omega}}
\bracks{\mrm{n} + 1/2 - \mrm{s}\,\ic\,/\pars{2\omega}}}
\\[5mm] = &\
{1 \over 4\omega^{2}}\,
{\Psi\pars{1/2 + \mrm{s}\,\ic\,/\bracks{2\omega}} -
\Psi\pars{1/2 - \mrm{s}\,\ic\,/\bracks{2\omega}}\over \mrm{s}\,\ic\,/\omega}
\\[5mm] = &\
-\,{\ic \over 4\,\mrm{s}\omega}\,
\bracks{\pi\cot\pars{\pi\bracks{{1 \over 2} - {\mrm{s} \over 2\omega}\,\ic}}} =
-\,{\pi\ic \over 4\,\mrm{s}\omega}\,
\tan\pars{{\pi\,\mrm{s} \over 2\omega}\,\ic}
\\[5mm] & =
-\,{\pi\ic \over 4\,\mrm{s}\omega}\,
\bracks{\ic\tanh\pars{\pi\,\mrm{s} \over 2\omega}}
\\[5mm] = &\
\bbox[15px,#ffe,border:1px dotted navy]{\ds{{\pi \over 4\,\mrm{s}\omega}\,
\tanh\pars{\pi\,\mrm{s} \over 2\omega}}} \\ &
\end{align}
