calculate a summation or a complex integral! I am here again! This time is a complex integral question! I can not work it out by myself!

Consider 
$I(x)=\sum_{n=-\infty}^{+\infty}g_n(x)$ and $g_n(x)=\frac{1}{i(2n+1)-x}$, where x is a real variable and i is the imaginary unit.
The goal of this question is to calculate the sum above by transforming it into a complex integral. The hint is to show that $I(x)=\int_Cf(z)\frac1{z-x}dz$ by introducing z as a complex number and $f(z)=\frac1{2\pi i}(\frac1{e^z+1})$ and choose a proper contour C for integration at the same time. Then calculate the integral to get $I(x)$
From my point, there must be a connection between the singularities of $f(z)$ and the $i(2n+1)\pi$ in $g_n(x)$ and I need to use the residue. Then, game is over.
 A: Proof sketch that uses the fact that $f(z) + f(-z) = 1$:


*

*Since $I(x) = -I(-x)$, you can assume without loss of generality $x < 0$. The semicircular contour $$
C_N = \{x/2+iy: -2\pi N < y< 2\pi N\}\cup \{x/2 + 2\pi N e^{i\theta}:-\pi/2 < \theta < \pi/2\}
$$contains the first $2N$ poles of $f(z)$. In the limit as $N\rightarrow\infty$, this will include all the poles of $f(z)$, but never contains $x$, and you can show the value of $\int_{C_N}f(z)/(z-x)dz$ will go to $-I(x)$.

*Consider $f(-z)/(z-x)$ using the semicircular contour $$
C^-_N = \{x/2+iy: -2\pi N < y< 2\pi N\}\cup \{x/2 - 2\pi N e^{i\theta}:-\pi/2 < \theta < \pi/2\}.
$$This contour contains none of the poles of $f(-z)$ for any $N$, but does contain $x$ for $N > -x/(4\pi)$. You can show from this that $\int_{C^-_N}f(-z)/(z-x)dz = f(-x)$ for large $N$.

*As $N\rightarrow\infty$, you can show the semicircle part of the integrals of $f(z)/(z-x)$ over $C_N$ and $f(-z)/(z-x)$ over $C_N^-$ to to zero. From this, you can show $$
 I(x) + f(-x) = -\int_{x/2+i\infty}^{x/2-i\infty} \frac{f(-z)dz}{z-x}+\int_{x/2-i\infty}^{x/2+i\infty} \frac{f(z)dz}{z-x}  = \frac{1}{2\pi i}\int_{x/2-i\infty}^{x/2+i\infty} \frac{dz}{z-x} = \frac{1}{2}
$$

*Since $f(-x) = 1/(e^{-x} + 1)$, you can conclude that $I(x) = -\tanh(x/2)/2$.

