# How I Impressed My Wife: Part 4g

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 and the next post, I’d like to discuss alternate ways 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$

Therefore, the residue at $z = r$ is equal to $a_0$, or the constant term in the Taylor expansion of $\displaystyle \frac{g(z)}{h(z)}$ about $z = r$. Therefore,

$a_0 = \displaystyle \frac{g(r)}{h(r)}$

For the function at hand $g(z) \equiv 1$ and $h(z) = z-r_2$. Therefore, the residue at $z = r_1$ is equal to $\displaystyle \frac{1}{r_1 - r_2}$, matching the result found earlier.