<s>[INST] $\frac{1}{z} \prod_{n=1}^{\infty} \frac{n^2}{n^2 - z^2} = \frac{1}{z} + 2z\sum_{n=1}^{\infty} \frac{(-1)^n}{z^2-n^2}$? I am trying to show that

$$\frac{1}{z} \prod_{n=1}^{\infty} \frac{n^2}{n^2 - z^2} = \frac{1}{z} + 2z\sum_{n=1}^{\infty} \frac{(-1)^n}{z^2-n^2}$$

This question stems from the underlying homework problem, which asks to show
$$ \frac{\pi}{\sin(\pi z)} = \frac{1}{z} + 2z\sum_{n=1}^{\infty} \frac{(-1)^n}{z^2-n^2}, $$
to which I am at my wits end.  I have a couple of identities on hand, namely
$$ \pi \cot (\pi z) = \frac{1}{z} + \sum_{n \in \mathbb{Z}; n \neq 0} \frac{1}{z - n} + \frac{1}{n} $$
and
$$ \frac{\sin (\pi z)}{\pi} = z \prod_{n=1}^{\infty} \left( 1 - \frac{z^2}{n^2} \right) $$
and
$$ \frac{\pi^2}{\sin^2 (\pi z)} = \sum_{n \in \mathbb{Z}} \frac{1}{(z - n)^2} $$
I've tried fooling around with these identities and am getting nowhere.  Any hints or suggestions would be greatly appreciated.
 [/INST] Let $ \displaystyle f(z) = \frac{\pi}{\sin \pi z} - \frac{1}{z}$.
Then according to the Mittag-Leffler pole expansion theorem, $$ \frac{\pi}{\sin \pi z} - \frac{1}{z} = f(0) + \sum_{n=1}^{\infty} \text{Res}[f,n] \Big( \frac{1}{z-n} + \frac{1}{n} \Big) + \sum_{n=1}^{\infty} \text{Res}[f,-n] \Big( \frac{1}{z+n} - \frac{1}{n} \Big)$$
$$ = \sum_{n=1}^{\infty} (-1)^{n} \Big( \frac{1}{z-n} + \frac{1}{n} \Big) + \sum_{n=1}^{\infty} (-1)^{n} \Big( \frac{1}{z+n} - \frac{1}{n} \Big)$$
$$ = \sum_{n=1}^{\infty} (-1)^{n} \Big(\frac{1}{z-n} + \frac{1}{z+n} \Big) = \sum_{n=1}^{\infty} (-1)^{n} \frac{2z}{z^{2}-n^{2}}$$
</s>