Suppose $f(z)/g(z)$ has a pole of order 1 at $c$. Then its residue at $c$ is $f(c)/g'(c)$. I want a formula like this of a quotient for a pole of order 2. I know it's $\lim_{z\to c} \frac{d}{dz}[(z-c)^2\frac{f(z)}{g(z)}]$, but I want a more concise expression in terms of the derivatives of $g$ and/or $f$.
Computing $\frac{d}{dz}[(z-c)^2\frac{f(z)}{g(z)}]$ and noting that $g(c) = 0$ by assumption, we get
$$ 2(z - c)\frac{f}{g} + (z-c)^2\frac{f'g - fg'}{g^2}\\ = 2(z - c)\frac{f}{g} + \frac{f'g - fg'}{\left(\frac{g(z) - g(c)}{z-c}\right)^2} \\ \to 2\frac{f(c)}{g'(c)} + \frac{f'(c)\cdot0 - f(c)g'(c)}{g'(c)^2} \\ = \frac{f(c)}{g'(c)} $$
But this is the same expression for the first-order pole, and I know this is wrong. Where did I make a mistake? And what's the right expression?