Using contour integration to evaluate an alternating series that doesn't converge absolutely Let $P(z)$ and $Q(z)$ be polynomials such that the degree of $Q(z)$ is exactly one degree more than the degree of $P(z)$.
And assume that $ \displaystyle \sum_{n=-\infty}^{\infty} (-1)^{n} \frac{P(n)}{Q(n)}$ converges.
If you try to evaluate the above series by integrating the function $ \pi \csc (\pi z) \frac{P(z)}{Q(z)} $ around a square contour with vertices at $\pm(N + \frac{1}{2}) \pm i (N+ \frac{1}{2})$, does the integral vanish as $N \to \infty$ through the positive integers?
I know that $\csc(\pi z)$ is uniformly bounded on the contour, but that's not enough to conclude that the integral vanishes.
If you assume that the integral does vanish, you seem to get correct results, such as $$\sum_{n=-\infty}^{\infty}\frac{(-1)^{n}}{3n+1} = \frac{2 \pi}{3\sqrt{3}}.$$
EDIT: Read both of Marko Riedel's answers.  They go together.
 A: We introduce $$f(z) = \pi \csc(\pi z) \frac{P(z)}{Q(z)} $$ and in order to evaluate the sum in question using residues as proposed, we need to show that the integral along the square goes to zero. To do this, assume the degree of $Q(z)$ is some integer $m$ plus the degree of $P(z),$ where $m$ is at least two.
I will do two of the four sides of the contour. On the left side, call it $\Gamma_1$, we have $z = N + \frac{1}{2} + it$, with $-(N+\frac{1}{2}) \le t \le N+\frac{1}{2}.$
This yields 
$$\left|\int_{\Gamma_1} f(z) dz \right| \le (2N+1) \max_{\Gamma_1} |f(z)|.$$
Now $$|\csc(\pi z)| = 
\frac{2}
{\left|e^{\pi i (N + \frac{1}{2}) -\pi t}-e^{- \pi i (N + \frac{1}{2}) +\pi t}\right|}
= \frac{2}{\left|(-1)^N i e^{-\pi t} + (-1)^N i e^{\pi t}\right|} =
\frac{2}{\left|e^{-\pi t} + e^{\pi t}\right|}\le 1,$$
because the maximum of the norm occurs at $t=0,$ where the denominator is minimal. 
It follows that the bound on the integral is in fact
$$(2N+1) \max_{\Gamma_1} |f(z)| \le 
(2N+1) \max_{\Gamma_1} \left|\frac{P(z)}{Q(z)}\right| \in
\Theta\left((2N+1)\frac{1}{N^m}\right).$$ 
But this is$$\Theta\left(\frac{1}{N^{m-1}}\right)
\to 0 \quad \text{as} \quad N\to\infty.$$
On the top side, call it $\Gamma_2$, we have $z = t + i(N + \frac{1}{2})$, with $-(N+\frac{1}{2}) \le t \le N+\frac{1}{2}.$
This yields 
$$\left|\int_{\Gamma_2} f(z) dz \right| \le (2N+1) \max_{\Gamma_2} |f(z)|.$$
The cosecant term along $\Gamma_2$ has
$$|\csc(\pi z)| = 
\frac{2}
{\left|e^{\pi i t  -\pi (N + \frac{1}{2})}-e^{- \pi i t +\pi  (N + \frac{1}{2})}\right|}
\le \frac{2}{e^{\pi  (N + \frac{1}{2})} - e^{-\pi  (N + \frac{1}{2})}}
\in \Theta\left(e^{-\pi N}\right).$$
It follows that the bound on the second integral is 
$$(2N+1) \max_{\Gamma_2} |f(z)| \le 
(2N+1) \frac{2}{e^{\pi  (N + \frac{1}{2})} - e^{-\pi  (N + \frac{1}{2})}}
\max_{\Gamma_2} \left|\frac{P(z)}{Q(z)}\right| \in
\Theta\left((2N+1) e^{-\pi N}\frac{1}{N^m}\right).$$ 
But this is$$\Theta\left(\frac{e^{-\pi N}}{N^{m-1}}\right)
\to 0 \quad \text{as} \quad N\to\infty.$$
This concludes the argument and shows that
$$ \sum_{n=-\infty}^\infty (-1)^n \frac{P(n)}{Q(n)} =
-\sum_{z_0\in S} 
\operatorname{Res}\left(\pi\csc(\pi z) \frac{P(z)}{Q(z)}; z=z_0\right),$$
where $S$ is the set of poles of $f(z)$ other than at the integers and we assume for simplicity that the quotient of the two polynomials does not have any poles at the integers.
Here we have made use of the fact that with 
$$P(n) = p_0 + p_1 n + p_2 n^2 + \cdots + p_\alpha n^\alpha$$ and
$$Q(n) = q_0 + q_1 n + q_2 n^2 + \cdots + q_\beta n^\beta$$
and $\beta\ge\alpha,$ we have
$$ \frac{P(n)}{Q(n)} = 
\frac{p_\alpha + \cdots + p_0/n^\alpha}{q_\beta n^{\beta-\alpha} + \cdots + q_0/n^\alpha}
\in \Theta\left( \frac{1}{n^{\beta-\alpha}} \right)
\quad \text{as} \quad n \to\infty.$$
A: We can in fact fix the calculation from the previous post for vertical segments so that it goes through even when $m=1,$ namely by using a tighter bound.
We have
$$\left|\int_{\Gamma_1} f(z) dz \right| =
\left|i \int_{-(N+1/2)}^{N+1/2} \pi\csc\left(\pi\left(N+\frac{1}{2} +it \right)\right) 
\frac{P\left(N+\frac{1}{2} +it\right)}{Q\left(N+\frac{1}{2} +it\right)}
dt \right| \\ \le 
\pi \int_{-(N+1/2)}^{N+1/2} \frac{2}{e^{\pi t} + e^{-\pi t}} \frac{C}{N^m} dt \le
\frac{C}{N^m} \int_{-\infty}^\infty \frac{\pi}{\cosh (\pi t)} dt \\=
\frac{C}{N^m} \left[ 2 \arctan(\exp(\pi t)) \right]_{-\infty}^\infty =
\frac{C}{N^m} \left(2\frac{\pi}{2} - 0\right) \\= \pi \frac{C}{N^m} 
\in \Theta\left(\frac{1}{N^m}\right) \to 0
\quad \text{as} \quad N\to \infty,$$
even when $m=1.$
This answers the question from the OP in the affirmative. The existence of $C$ is assured for $N$ large enough.
