Computing an infinite sum using the Residue theorem Show that  $$\sum_{n=-\infty}^\infty \frac{1}{(3n-1)^2} = \frac{4\pi^2}{27}$$
Here is what I tried so far. I know that I can use the Residue theorem to solve a summation of this form. 
$$\sum_{n=-\infty}^{\infty} f(n) = -\sum_k \text{res}_{z=z_k} \pi \cot{\pi z}\, f(z)$$
So the poles of $\frac{1}{(3z-1)^2}$ is z= $\frac{1}{3}$ (order 2). 
Next I need to find the residues of $\frac{1}{(3n-1)^2} \times \pi \cot(\pi z)$ at z= $\frac{1}{3}$. But, the limit of $\frac{1}{(3z-1)^2} \times \pi \cot(\pi z)$ at z= $\frac{1}{3}$ is $\infty$. 
I am not sure what to do at this point. Any help is appreciated.
 A: The mistake is that you calculate the residue in the wrong way. Define 
$$g(z)=\frac{\pi\cot(\pi z)}{(3z-1)^2}=\frac{h(z)}{(z-\frac{1}{3})^2},$$
where $h(z)=\frac{\pi}{9}\cot(\pi z)$. Note that $z=\frac{1}{3}$ is a pole of order $2$ and $h$ is analytic at $\frac{1}{3}$ with $h(\frac{1}{3})\neq 0$. Thus
$$\text{res}_{z=\frac{1}{3}}g(z)=h'(\frac{1}{3})=-\frac{\pi^2}{9}\csc^2(\pi z)|_{z=\frac{1}{3}}=-\frac{4\pi^2}{27}.$$
In general, if $z_0$ is a pole of order $m$ of the function $g$, then we can write 
$$g(z)=\frac{h(z)}{(z-z_0)^m}$$
near the point $z_0$ such that $h$ is analytic at $z_0$ with $h(z_0)\neq 0$. Moreover in this case we have
$$\text{res}_{z=z_0}g(z)=\frac{h^{(m-1)}(z_0)}{(m-1)!}.$$
A: Just for the fun of it since you did ask for this problem solution using complex analysis and here we don't:
$$\frac{\pi^2}6=\sum_{n=1}^\infty\frac1{n^2}=\sum_{n=1}^\infty\frac1{(3n-2)^2}+\sum_{n=1}^\infty\frac1{(3n-1)^2}+\overbrace{\frac19\sum_{n=1}^\infty\frac1{n^2}}^{=\frac19\frac{\pi^2}6}\implies$$
$$\sum_{n=1}^\infty\frac1{(3n-2)^2}+\sum_{n=1}^\infty\frac1{(3n-1)^2}=\frac4{27}\pi^2$$
Now just observe that
$$\sum_{n=-\infty}^0\frac1{(3n-1)^2}=\sum_{n=1}^\infty\frac1{(3n-2)^2}$$
