Computing Residue for a General, Multiple-Poled function? I'm trying to compute the residue of the following function at $a$. I'm having a little trouble seeing which poles are relevant:

Compute $\,Res_f(a)$ for the following function:
  $$f(z) = \frac{1}{(z - a)^3}\ \tanh z $$

What I'm confused about is the ambiguity surrounding $a$. Indeed, there is a pole of order 3 at $a$, but since $a$ isn't clearly defined, couldn't $a$ assume a value whereby there's a pole in $\tanh z = \frac{sinh\, z}{cosh\, z}$, in addition to the pole already caused by the $\frac{1}{(z-a)^3}$ term? Initially, I just assumed I could use the residue derivative formula, but even then, things get a bit hairy with the second derivative of $\tanh z$.
Should I just assume that $a$ never achieves a value that would put a pole in the denominator of $\tanh z$ and use the derivative formula to compute the residue of a third order pole at $a$?

You need to separate between a few cases:  
$a=i(\frac{\pi}{2}+\pi k)$
In this case we have $\lim_{z \to a}(z-a)^4f(z)$ is finite and different from $0$ so $a$ is a pole of order $4$
$a=\pi ki$
In this case $\lim_{z \to a}(z-a)^2f(z)$ is finite and different from $0$ so $a$ is a pole of order $2$
$a \ne i(\frac{\pi}{2}+\pi k), \space \pi ki$
In this case $\lim_{z \to a}(z-a)^3f(z)$ is finite and different from $0$ so $a$ is a pole of order $3$
You can use the formula in Panja's answer to calculate the residue at $a$ in each case.
