Problem with a residue calculation I have a problem with calculating a residue. I want to calculate Res($f,\frac{1}{2}$), where
$$ f(z) = \frac{z^6 +1}{z^3(2z-1)(z-2)} =  \frac{z^6 +1}{2z^5 -5z^4+2z^3}.$$ 
$$ $$
One method is to view $f(z)$ as $\frac{p(z)}{q(z)}$, where both $p$ and $q$ are analytic; here the residue of $\frac{1}{2}$ is then: 
$$ Res(f,\frac{1}{2})= \frac{p(\frac{1}{2})}{q'(\frac{1}{2})} = \frac{(\frac{1}{2})^6 +1}{10(\frac{1}{2})^4 -20(\frac{1}{2})^3+6(\frac{1}{2})^2} = -\frac{65}{24}.$$
$$ $$
Another method we learnt is this: We can view $f(z)$ as  $f(z) = \frac{\phi(z)}{(z-a)^n}$, where $\phi(z)$ is analytic. The residue here is then given by: $Res(f,a) = \frac{\phi^{(n-1)}(a)}{(n-1)!} $. 
Applying this to our example, where $\phi(z) = \frac{z^6 +1}{z^3(z-2)}$, gives:
$$Res(f,\frac{1}{2}) = \frac{z^6 +1}{z^3(z-2)}|_\frac{1}{2} = \frac{(\frac{1}{2})^6 +1}{(\frac{1}{2})^3(\frac{1}{2}-2)} =-\frac{65}{12}. $$
$$ $$
Why are the two residues different? The first residue is the correct one. Why can't I here apply the second rule? In other examples both methods give the same residue. 

$\text{Res}(f,\frac 12)=\lim_{z \to \frac 12}(z-\frac 12)f(z)=\lim_{z\to \frac 12} \frac {(z-\frac 12)(z^6+1)}{(z^3)(z-2)(2z-1)} =\lim_{z\to \frac 12}\frac {(z-\frac 12)(z^6+1)}{2(z^3)(z-2)(z-\frac 12)}=\lim_{z\to \frac 12} \frac {z^6+1}{2(z^3)(z-2)}=-\frac {65}{24}$.
