Residue of a pole of order 6 I am in the process of computing an integral using the Cauchy residue theorem, and I am having a hard time computing the residue of a pole of high order.
Concretely, how would one compute the residue of the function $$f(z)=\frac{(z^6+1)^2}{az^6(z-a)(z-\frac{1}{a})}$$ at $z=0$?
Although it is not needed here, $a$ is a complex number with $|a|<1$.
Thanks in advance for any insight.

$$g(z)=\frac{1}{(z-a)(z-\frac{1}{a})}=\frac{\frac{1}{a-\frac{1}{a}}}{z-a}+\frac{\frac{-1}{a-\frac{1}{a}}}{z-\frac{1}{a}}$$
we know:
$$(a+b)^n =a^n+\frac{n}{1!}a^{n-1}b+\frac{n(n-1)}{2!}a^{n-2}b^2+...+b^n$$
$$ \text{As regards }: |a|<1 $$
Taylor series of f(z) is: 
$$g(z)=\frac{\frac{1}{a-\frac{1}{a}}}{z-a}+\frac{\frac{1}{a-\frac{1}{a}}}{\frac{1}{a}-z}=(\frac{1}{a-\frac{1}{a}}) \left[ \frac{-\frac{1}{a}}{1-\frac{z}{a}}+\frac{a}{1-az} \right]$$
$$g(z)=(\frac{1}{a-\frac{1}{a}}) \left[ \frac{-1}{a} \sum_{n=0}^{\infty}(\frac{z}{a})^n+a \sum_{n=0}^{\infty} (az)^n \right]$$
$$f(z)=\frac{(z^6+1)^2}{az^6}g(z)=\frac{z^{12}+2z^2+1}{az^6}g(z)=\left(
\frac{z^6}{a} + \frac{2}{az^4} + \frac{1}{az^6} \right)g(z)$$
$$ f(z)= \left(
\frac{z^6}{a} + \frac{2}{az^4} + \frac{1}{az^6} \right) \left(\frac{1}{a-\frac{1}{a}}\right) \left[ \frac{-1}{a} \sum_{n=0}^{\infty}(\frac{z}{a})^n+a \sum_{n=0}^{\infty} (az)^n \right]$$
$$ \text{ so residue is coefficient of term }z^{-1} $$
$$ f(z)=\frac{1}{a(a-\frac{1}{a})} \left[ \frac{-1}{a}\left( \sum_{n=0}^{\infty}\frac{z^{n+6}}{a^n} +2\sum_{n=0}^{\infty}\frac{z^{n-4}}{a^n} +\sum_{n=0}^{\infty} \frac{z^{n-6}}{a^n}\right)   
+a \left( \sum_{n=0}^{\infty} a^nz^{n+6}+2\sum_{n=0}^{\infty} a^nz^{n-4} +\sum_{n=0}^{\infty} a^nz^{n-6} \right) \right]$$
$$ \text{residue of function at z=0 is :}  $$
$$ \frac{1}{a(a-\frac{1}{a})} \left[ \frac{-1}{a}\left( 0 +2\frac{1}{a^3} +\frac{1}{a^5}\right)   
+a \left( 0+2a^3 +a^5 \right) \right] $$
