# Partial fraction of $\sec(z)$ from $\frac{\pi}{\sin (\pi z)}$

Given $$\frac{\pi}{\sin (\pi z)}=\sum_{n=-\infty}^\infty (-1)^n \frac{1}{z-n},$$ is there a fast way to get $$\sec(z)=\sum_{n=1}^\infty \frac{(-1)^n(2n-1)\pi}{z^2-(n-1/2)^2\pi^2}?$$ I've tried computing it, but I get a huge mess. Would anybody have some ideas? Thanks in advance.

-

Let's rewrite your first equation as : $$\frac{\pi}{\cos(\pi/2-\pi z)}=\sum_{n=-\infty}^\infty \frac{(-1)^n}{z-n}$$ and set $\ x:=\pi\bigl(\frac 12-z\bigr)\$ then (dividing by $\pi$) : $$\sec(x)=\sum_{n=-\infty}^\infty \frac {(-1)^n}{\pi z-\pi/2-(n-1/2)\pi}$$ for $m:=-n$ : $$\sec(x)=-\sum_{n=1}^\infty \frac {(-1)^n}{x+(n-1/2)\pi}-\sum_{m=0}^\infty \frac {(-1)^m}{x+(-m-1/2)\pi}$$ for $n':=m+1$ : $$\sec(x)=-\sum_{n=1}^\infty \frac {(-1)^n}{x+(n-1/2)\pi}+\sum_{n'=1}^\infty \frac {(-1)^{n'}}{x-(n'-1/2)\pi}$$ Putting everything together we conclude : $$\sec(x)=\sum_{n=1}^\infty \frac{(-1)^n(2n-1)\pi}{x^2-(n-1/2)^2\pi^2}.$$