Tangent series representation How to prove that for any complex number $z$ which is not equal to $\pi k + \frac{\pi}{2}$ ($k\in\mathbb Z$) :
$$ \tan z = \sum_{n=0}^\infty \frac{8z}{(2n+1)^2\pi^2 - 4z^2} $$ 
Using complex analysis, I started with the contour intergal 
$$ \oint_{C_N} \frac{\tan \frac{\pi s}{2}}{s^2-z^2}\,\mathrm ds = \sum_{n=-N}^N \frac{-4i}{(2n+1)^2 - z^2} + \frac{2\pi i \tan \frac{\pi z}{2}}{z}$$
where $C_N$ is the circle centered at 0 of radius $N+1/2$ ($N\in\mathbb N$).
The complex number $z$ is chosen to be non zero & non odd integer.
However, I don't know how proceed to show that the LHS goes to $0$ as $N\to \infty$ :(
Thanks in advance for answers.
 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}$

You can use the Mittag-Leffler Expansion:

$\ds{\tan\pars{z}}$ has single poles at
$\ds{p_{n} = \pars{2n + 1}{\pi \over 2}}$, with residues
$\ds{r_{n} = -1}$, where $\ds{n \in \mathbb{Z}}$ .
$$
\bbx{\mbox{Note that}\quad p_{-n} = -p_{n - 1}}
$$

Then,
\begin{align}
\tan\pars{z} & =
\sum_{n = -\infty}^{\infty}\pars{-1}\pars{{1 \over z - p_{n}} + {1 \over p_{n}}} =
\sum_{n = 1}^{\infty}\bracks{%
\pars{{1 \over p_{n} - z} - {1 \over p_{n}}} +
\pars{{1 \over p_{-n} - z} - {1 \over p_{-n}}}}
\\[2mm] & +
\pars{{1 \over p_{0} - z} - {1 \over p_{0}}}
\\[5mm] & =
\lim_{N \to \infty}\sum_{n = 1}^{N}\bracks{%
\pars{{1 \over p_{n} - z} - {1 \over p_{n}}} +
\pars{{1 \over -p_{n - 1} - z} + {1 \over p_{n - 1}}}} +
\pars{{1 \over p_{0} - z} - {1 \over p_{0}}}
\\[5mm] & =
\lim_{N \to \infty}\bracks{\pars{{1 \over p_{0} - z} - {1 \over p_{0}}} +
\sum_{n = 1}^{N}\pars{{1 \over p_{n} - z} - {1 \over p_{n}}} +
\sum_{n = 1}^{N}\pars{{1 \over -p_{n - 1} - z} + {1 \over p_{n - 1}}}}
\\[5mm] & =
\lim_{N \to \infty}\bracks{\sum_{n = 0}^{N - 1}
\pars{{1 \over p_{n} - z} - {1 \over p_{n}}} +
\pars{{1 \over p_{N} - z} - {1 \over p_{N}}} +
\sum_{n = 0}^{N - 1}\pars{-\,{1 \over p_{n} - z} + {1 \over p_{n}}}}
\\[5mm] & =
\sum_{n = 0}^{\infty}\pars{{1 \over p_{n} - z} - {1 \over p_{n} + z}} =
\sum_{n = 0}^{\infty}{2z \over p_{n}^{2} - z^{2}} =
\sum_{n = 0}^{\infty}{8z \over \pars{2p_{n}}^{2} - 4z^{2}}
\\[5mm] & =
\bbx{\sum_{n = 0}^{\infty}{8z \over \pars{2n + 1}^{2}\pi^{2} - 4z^{2}}}
\end{align}
A: Short answer: both the LHS and the RHS are meromorphic functions with simple poles at the elements of $\frac{\pi}{2}+\pi\mathbb{Z}$. A simple computation of residues leads to the fact that
$$ g(z)\stackrel{\text{def}}{=}\frac{\sin z}{\cos z}-\sum_{n\geq 0}\frac{8z}{(2n+1)^2\pi^2-4z^2} $$
is an entire function. Then we may check that for any $w$ in the region $0<\text{Re}(w)<\frac{\pi}{2}$ we have
$$ \int_{0}^{w}g(z)\,dz = 0,$$
hence $g$ constantly equals $0$ on the previous open set. Since $g$ is entire, $g\equiv 0$.
