# Closed-form expression for residue of a pole of order 2

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?

I presume $$f(c)\ne0$$ but $$g$$ has a double zero at $$z$$. Then $$f(z)=a_0+a_1w+a_2w^2+\cdots$$ and $$g(z)=b_2w^2+b_3w^3+\cdots$$ where $$w=z-c$$. Then $$\frac{f(z)}{g(z)}=\frac{1}{w^2}\frac{a_0+a_1w+\cdots}{b_2+b_3w+\cdots} =\frac1{b_2w^2}(a_0+a_1w+\cdots)(1-(b_3/b_2)w+\cdots) =\frac{a_0+(a_1-a_0b_3/b_2)w+\cdots}{b_2w^2}$$ and so the residue is $$\frac{a_1-a_0b_3/b_2}{b_2} =\frac{a_1b_2-a_0b_3}{b_2^2}=\frac{f'(c)g''(c)/2-f(c)g'''(c)/6}{g''(c)^2/4} =\frac{6f'(c)g''(c)-2f(c)g'''(c)}{3g''(c)^2}.$$
It is NOT true that $$2(z - c)\frac{f}{g} + \frac{f'g - fg'}{\left(\frac{g(z) - g(c)}{z-c}\right)^2} \longrightarrow 2\frac{f(c)}{g'(c)} + \frac{f'(c)\cdot0 - f(c)g'(c)}{g'(c)^2}$$ because $$\frac{f(c)}{g'(c)}$$ does not exist, since $$z=c$$ is a double root for $$g$$.