Evaluating the contour integral $\int_{|z|=1}\dfrac{\tan\pi z}{z^{3}}dz$ As the title suggests, i am evaluating the contour integral $$\int_{|z|=1}\dfrac{\tan\pi z}{z^{3}}dz.$$  
My steps are as follows:  
$f(z)=\dfrac{\tan\pi z}{z^{3}}=\dfrac{\phi(z)}{z^{3}}$ has $z=0$ as a singular point. It is a pole of order 3.
By Cauchy's Residue Theorem,
$$\int_{|z|=1}f(z)=2\pi i.Res_{z=0}f(z)=2\pi i(\phi''(z))|_{z=0}= 2\pi i(0)=0 $$  
(1) May i ask if this is a correct solution?  
(2) Also, another possible solution is to express $f(z)=\dfrac{\sin\pi z}{z^{3}\cos\pi z}$. With that, we can easily see that aside from $z=0$, $z=(n+\frac{1}{2}), \forall n \in \mathbb{Z}$ are also singularities of the function. Due to this version of this soultion, i am now quite confused if my initial solution shown above is correct. The problem is that when i try to compute the residue, $Res_{z=n+\frac{1}{2}}f(z)$ will seem like a mess as there seems to be infinitely many $n+\frac{1}{2}$ to consider. For the second case if i had expressed $f(z)=\dfrac{\sin\pi z}{z^{3}\cos\pi z}$, will i still get$\int_{|z|=1}\dfrac{\tan\pi z}{z^{3}}dz=0$?  
Thanks in advance for your help.
 A: Besides $z=0$, you have to consider the singularities at $z = \pm 1/2$.  Not all $n + 1/2$, only the ones inside the contour.  By the way, the pole at $z=0$ has order $2$, not $3$, because $\tan(\pi z)$ has a simple zero at $z=0$.
You might also note that $\tan(\pi z)/z^3$ is an even function, so by symmetry 
$\oint_\Gamma f(z)\; dz = 0$ for any contour $\Gamma$ that is invariant under the reflection $z \to -z$.
A: For $f(z)=\dfrac{\tan\pi z}{z^{3}}$ we have a pole at $z=0$ of order $2$ and two simple poles $z=\pm\dfrac12$ which lie inside $|z|=1$. Then with
\begin{align}
\dfrac{\tan\pi z}{z^{3}}
&= \dfrac{\pi}{z^2}\dfrac{\sin\pi z}{\pi z}\dfrac{1}{\cos \pi z} \\
&= \dfrac{\pi}{z^2}\left(1-\dfrac{(\pi z)^2}{3!}+\dfrac{(\pi z)^4}{5!}-\dfrac{(\pi z)^6}{7!}+\cdots\right)/
\left(1-\dfrac{(\pi z)^2}{2!}+\dfrac{(\pi z)^4}{4!}-\dfrac{(\pi z)^6}{6!}+\cdots\right) \\
&= \dfrac{\pi}{z^2}+\dfrac{\pi^3}{3}+\dfrac{2\pi^5z^2}{15}+\cdots
\end{align}
we have
\begin{align}
&\operatorname{Res}_{z=0}f(z)=0\\
&\operatorname{Res}_{z=\frac12}f(z)=-\dfrac{8}{\pi}\\
&\operatorname{Res}_{z=-\frac12}f(z)=\dfrac{8}{\pi}\\
\end{align}
so
$$\int_{|z|=1}\dfrac{\tan\pi z}{z^{3}}dz=2\pi i\sum \operatorname{Res}_{z=0,\pm\frac12}f(z)=0$$
