How to show that $\int_{S}\frac{1}{z}\frac{1}{\cos(2\pi i a)-\cos(2\pi z)}dz\rightarrow 0$ as the sides of the square $S$ go to $\infty$. I have a question where I am asked to show that the following sum is
$$\sum_{k=-\infty}^\infty\frac{1}{a^2+k^2}=\frac{\pi}{a}\frac{e^{2\pi a}-e^{-2\pi a}}{e^{2\pi a}+e^{-2\pi a}-2}$$
by integrating the function 
$$f(z)=\frac{1}{z}\frac{1}{\cos(2\pi i a)-\cos(2\pi z)}$$
over a suitable closed path. A hint was given to use a square path, so my best guess was letting $N\in\mathbb{N}$ and integrate over the square contour with vertices
$$\pm(N+\frac{1}{2})\pm(N+\frac{1}{2})i.$$
I have already calculated the residues at the points $\{-ai+k,0,ai+k\}$ for $k\in\mathbb{Z}$ and verified that I get the desired equality if I assume that the integral goes to zero as $N\rightarrow \infty$. But I am having a hard time proving that the integral actually does go to zero. If I take the right vertical side with $\gamma(R)=(N+1/2)+Ri$, for $-(N+1/2)\leq R\leq N+1/2$, I try to estimate
$$\int^{N+1/2}_{-(N+1/2)}\left|
\frac{1}{N+\frac{1}{2}+Ri}\frac{1}{\cos(2\pi i a)-\cos(N+\frac{1}{2}+Ri)}
\right|dR$$
letting $\alpha=\cos(2\pi i a)$ I can write this as
$$\int^{N+1/2}_{-(N+1/2)}\left|
\frac{1}{N+\frac{1}{2}+Ri}\frac{2}{2\alpha-ie^{-2\pi R}+ie^{2\pi R}}
\right|dR$$
The first fraction is easily estimated, but 
$$|2\alpha-ie^{-2\pi R}+ie^{2\pi R}|\geq|2\alpha|$$
which does not involve $N$, so how would I estimate the second fraction? Or is this even possible? If not, how would I prove that the integral over the contour goes to zero?

Note that
$$\left|\displaystyle\int_\gamma f( z)dz\right| \leq |\gamma |\cdot\max_{z\in\gamma}\left|f(z )\right| \leq(2N+1)\cdot \dfrac{1}{\alpha}\max_{|R|\leq N+1/2} \left(\dfrac{1}{(N+1/2)^2 + R^2}\right)=\dfrac{4}{\alpha}\dfrac{1}{2N+1}\to 0$$
as $N\to \infty$.
Identical argument applies to the other sides.
