Cotangent expansion to compute infinite products At the end of class my professor remarked that the infinite product expansion of cotangent, 
$$\text{cot}(z)=\frac{1}{z}+\prod \frac{2z}{z^2-n^2\pi^2}$$
can be used to compute infinite products like $\prod \frac{1}{n^2+1}$,$\prod \frac{1}{n^2+a^2}$. I'm assuming I'd substitute in some value for $z$ and the whole thing would pop up. But, I can't figure out how to get rid of the negative sign and its driving me crazy.
 A: Let $z = \pi i a$. Then 
\begin{align*}
\cot (\pi i a) &= \frac{1}{\pi i a} + \prod \frac{2\pi i a}{i^2 \pi^2 a^2 - n^2 \pi^2}\\
- i \coth (\pi a) &= - \frac{i}{\pi a} - \frac{2 i a}{\pi} \prod \frac{1}{a^2 + n^2}\\
\frac{2 a}{\pi} \prod \frac{1}{a^2 + n^2} &= \coth (\pi a) - \frac{1}{\pi a} \\
\prod \frac{1}{a^2 + n^2} &= \frac{\pi}{2a} \coth (\pi a) - \frac{1}{2 a^2}.
\end{align*}
A: For infinite products you should be using the identity
$$\sin z=z\prod_{n=1}^\infty\left(1-\frac{z^2}{n^2\pi^2}\right).$$
This is equivalent to your cotangent identity: if you note that
$$\frac{d}{dz}\ln\sin z=\cot z=\frac1z+\sum_{n=1}^\infty\frac{2z}{z^2-n^2\pi^2}$$
and integrate termwise carefully, you get a sum for $\ln\sin z$ and
then the above product for the sine. Replacing $z$ by $iz$ gives
$$\sinh z=z\prod_{n=1}^\infty\left(1+\frac{z^2}{n^2\pi^2}\right).$$
As an example, $z=\pi$ now gives
$$\sinh\pi=\pi\prod_{n=1}^\infty\frac{1+n^2}{n^2}.$$
That gives
$$\prod_{n=1}^\infty\frac{n^2}{1+n^2}=\frac{\pi}{\sinh\pi}$$
etc. (Of course $\prod 1/(n^2+1)^2=0$).
