# How I Impressed My Wife: Part 4h

So far in this series, I have used three different techniques to show that

$Q = \displaystyle \int_0^{2\pi} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x} = \displaystyle \frac{2\pi}{|b|}$.

For the third technique, a key step in the calculation was showing that the residue of the function

$f(z) = \displaystyle \frac{1}{z^2 + 2\frac{S}{R}z + 1} = \displaystyle \frac{1}{(z-r_1)(z-r_2)}$

at the point

$r_1 = \displaystyle \frac{-S + \sqrt{S^2 -R^2}}{R}$

was equal to

$\displaystyle \frac{R}{ 2 \sqrt{S^2-R^2} }$.

Initially, I did this by explicitly computing the Laurent series expansion about $z = r_1$ and identifying the coefficient for the term $(z-r_1)^{-1}$.

In this post, I’d like to discuss another way that this residue could have been obtained.

Notice that the function $f(z)$ has the form $\displaystyle \frac{g(z)}{(z-r) h(z)}$, where $g$ and $h$ are differentiable functions so that $g(r) \ne 0$ and $h(r) \ne 0$. Therefore, we may rewrite this function using the Taylor series expansion of $\displaystyle \frac{g(z)}{h(z)}$ about $z = r$:

$f(z) = \displaystyle \frac{1}{z-r} \left[ \frac{g(z)}{h(z)} \right]$

$f(z) = \displaystyle \frac{1}{z-r} \left[ a_0 + a_1 (z-r) + a_2 (z-r)^2 + a_3 (z-r)^3 + \dots \right]$

$f(z) = \displaystyle \frac{a_0}{z-r} + a_1 + a_2 (z-r) + a_3 (z-r)^2 + \dots$

Clearly,

$\displaystyle \lim_{z \to r} (z-r) f(z) = \displaystyle \lim_{z \to r} \left[ a_0 + a_1 (z-r) + a_2 (z-r)^2 + a_3 (z-r)^3 + \dots \right] = a_0$

Therefore, the residue at $z = r$ can be found by evaluating the limit $\displaystyle \lim_{z \to r} (z-r) f(z)$. Notice that

$\displaystyle \lim_{z \to r} (z-r) f(z) = \displaystyle \lim_{z \to r} \frac{(z-r) g(z)}{(z-r) h(z)}$

$= \displaystyle \lim_{z \to r} \frac{(z-r) g(z)}{H(z)}$,

where $H(z) = (z-r) h(z)$ is the original denominator of $f(z)$. By L’Hopital’s rule,

$a_0 = \displaystyle \lim_{z \to r} \frac{(z-r) g(z)}{H(z)} = \displaystyle \lim_{z \to r} \frac{g(z) + (z-r) g'(z)}{H'(z)} = \displaystyle \frac{g(r)}{H'(r)}$.

For the function at hand, $g(z) \equiv 1$ and $H(z) = z^2 + 2\frac{S}{R}z + 1$, so that $H'(z) = 2z + 2\frac{S}{R}$. Therefore, the residue at $z = r_1$ is equal to

$\displaystyle \frac{1}{2r_1+2 \frac{S}{R}} = \displaystyle \frac{1}{2 \displaystyle \frac{-S + \sqrt{S^2 -R^2}}{R} + 2 \frac{S}{R}}$

$= \displaystyle \frac{1}{ ~ 2 \displaystyle \frac{\sqrt{S^2 -R^2}}{R} ~ }$

$= \displaystyle \frac{R}{2 \sqrt{S^2-R^2}}$,

matching the result found earlier.