How to manipulate $\frac{1}{\sin x}-\frac{1}{x}$ into $\sum_{k\geq 1}\left(\frac{1}{x-k\pi}+\frac{1}{x+k\pi}\right)(-1)^k$? 1) How do you get to $\sum_{k\geq 1}\left(\frac{1}{x-k\pi}+\frac{1}{x+k\pi}  \right)(-1)^k$ from $\frac{1}{\sin x}-\frac{1}{x}$? (as demostrated here)

If $\pi\cot\pi x=\frac{1}{x}+\sum_{k\geq 1}\left(\frac{1}{x-k}+\frac{1}  {x+k}\right)$ multiplying by cosine or $(-1)^k$ gets the $\frac{1}{\sin x}$ but I cannot see how it does not make $\pi\csc\pi x=(-1)^k[\frac{1}{x}+\sum_{k\geq 1}\left(\frac{1}{x-k}+\frac{1}{x+k}\right)]$

 A: Not a full solution, but an attempt to use special functions here instead of complex analysis.
We are interested in the series:
$$f(x)=\frac{2x}{\pi^2} \sum_{k=1}^\infty \frac{(-1)^{k+1}}{(k-x/\pi)(k+x/\pi)} $$
Let's consider an auxiliary function:
$$g(x,y)= -\frac{x^2}{\pi^2} \sum_{k=0}^\infty \frac{y^k}{(k-x/\pi)(k+x/\pi)}$$
$$g(x,0)=1$$
If we denote the terms $a_k$, we have:
$$\frac{a_{k+1}}{a_k}=\frac{(k+1)(k-x/\pi)(k+x/\pi)}{(k+1-x/\pi)(k+1+x/\pi)} \frac{y}{k+1}$$
This means that:
$$g(x,y)={_3 F_2} \left(1, \frac{x}{\pi},-\frac{x}{\pi};1+\frac{x}{\pi},1-\frac{x}{\pi}; y \right)$$
So we have:
$$f(x)=\frac{2}{x} (g(x,-1)-1)$$
Which means we need to prove that:
$$\frac{2}{x} \left({_3 F_2} \left(1, \frac{x}{\pi},-\frac{x}{\pi};1+\frac{x}{\pi},1-\frac{x}{\pi}; y \right)-1 \right)=\frac{1}{\sin x}-\frac{1}{x}$$
$${_3 F_2} \left(1, \frac{x}{\pi},-\frac{x}{\pi};1+\frac{x}{\pi},1-\frac{x}{\pi}; -1 \right)=\frac{1}{2} \left(1+\frac{x}{\sin x} \right)$$

In the next part for brevity, let's introduce a new variable $x=\pi z$:

$${_3 F_2} \left(1, z,-z;1+z,1-z; -1 \right)=\frac{1}{2} \left(1+\frac{\pi z}{\sin \pi z} \right)$$

Note that from the Gamma function reflection theorem:
$$\frac{\pi z}{\sin \pi z}=z \Gamma(z) \Gamma(1-z)=z B(z,1-z)$$
Using the Euler's integral transform for the hypergeometric function, we have:
$${_3 F_2} \left(1, z,-z;1+z,1-z; -1 \right)= \frac{\Gamma(1+z)}{\Gamma(z)} \int_0^1 t^{z-1} {_2 F_1} (1,-z ; 1-z; -t ) dt$$
$${_3 F_2} \left(1, z,-z;1+z,1-z; -1 \right)=z \int_0^1 t^{z-1} {_2 F_1} (1,-z ; 1-z; -t ) dt$$
On the other hand:
$$1= z \int_0^1 t^{z-1} dt$$
$$z B(z,1-z)= z \int_0^1 t^{z-1} (1-t)^{-z} dt$$
So we need to prove that:

$$\int_0^1 t^{z-1} \left(2 ~{_2 F_1} (1,-z ; 1-z; -t )-1-(1-t)^{-z} \right) dt=0$$


While I can't prove it right now, I can prove a particular case:
$$z=\frac{1}{2} \\ {_2 F_1} \left(1,-\frac{1}{2} ; \frac{1}{2}; -t \right)=1+ \sqrt{t} \arctan \sqrt{t}$$
So we have:
$$\int_0^1 \frac{1}{\sqrt{t}} \left(1+2\sqrt{t} \arctan \sqrt{t}-\frac{1}{\sqrt{1-t}} \right) dt$$
Doing each part separately (all are elementary integrals) we have:
$$2 + (\pi-2) -\pi=0$$
So at least for $z=1/2$ we have our proof.
