# How I Impressed My Wife: Part 6f

This series was inspired by a question that my wife asked me: calculate

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

Originally, I multiplied the top and bottom of the integrand by $\tan^2 x$ and performed a substitution. However, as I’ve discussed in this series, there are four different ways that this integral can be evaluated.
Starting with today’s post, I’ll begin a fifth method. I really like this integral, as it illustrates so many different techniques of integration as well as the trigonometric tricks necessary for computing some integrals.

Since $Q$ is independent of $a$, I can substitute any convenient value of $a$ that I want without changing the value of $Q$. As shown in previous posts, substituting $a =0$ yields the following simplification:

$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 \int_{0}^{2\pi} \frac{dx}{\cos^2 x + 2 \cdot 0 \cdot \sin x \cos x + (0^2 + b^2) \sin^2 x}$

$= \displaystyle \int_{0}^{2\pi} \frac{dx}{\cos^2 x + b^2 \sin^2 x}$

$= \displaystyle \int_{-\pi}^{\pi} \frac{dx}{\cos^2 x + b^2 \sin^2 x}$

$= \displaystyle \int_{-\infty}^{\infty} \frac{ 2(1+u^2) du}{u^4 + (4 b^2 - 2) u^2 + 1}$

$= \displaystyle \lim_{R \to \infty} \oint_{C_R} \frac{ 2(1+z^2) dz}{z^4 + (4 b^2 - 2) z^2 + 1}$,

where $C_R$ is the contour in the complex plane shown below (graphic courtesy of Mathworld).

Amazingly, contour integrals can be simply computed by evaluating the residues at every pole located inside of the contour. (See Wikipedia and Mathworld for more details.) I have already handled the case of $|b| = 1$ and $|b| > 1$. Today, I begin the final case of $|b| < 1$.

Earlier in this series, I showed that

$z^4 + (4b^2 - 2) z^2 + 1 = (z^2 + 2z \sqrt{1-b^2} + 1)(z^2 - 2z \sqrt{1-b^2} + 1)$

if $|b| < 1$, and so the quadratic formula can be used to find the four poles of the integrand:

$r_1 = \sqrt{1-b^2} + |b|i$,

$r_2 = -\sqrt{1-b^2} + |b|i$,

$r_3 = \sqrt{1-b^2} - |b|i$,

$r_4 = -\sqrt{1-b^2} - |b|i$.

Of these, only two lie ($r_1$ and $r_2$) within the contour for sufficiently large $R$ (actually, for $R > 1$ since all four poles lie on the unit circle in the complex plane).

As shown earlier in this series, the residue at each pole is given by

$\displaystyle \frac{r^2 + 1}{2r^3 + (4b^2-2)r}$

I’ll now simplify this considerably by using the fact that $r^4 + (4b^2-2)r^2 + 1 = 0$ at each pole:

$\displaystyle \frac{r^2 + 1}{2r^3 + (4b^2-2)r} = \displaystyle \frac{r(r^2+1)}{2r^4+(4b^2)-r^2}$

$= \displaystyle \frac{r(r^2+1)}{r^4+r^4 + (4b^2)-r^2}$

$= \displaystyle \frac{r(r^2+1)}{r^4-1}$

$= \displaystyle \frac{r(r^2+1)}{(r^2+1)(r^2-1)}$

$= \displaystyle \frac{r}{r^2-1}$.

Therefore, to evaluate the contour integral, I simply the sum of the residues within the contour and multiply the sum by $2\pi i$:

$Q = \displaystyle \lim_{R \to \infty} \oint_{C_R} \frac{ 2(1+z^2) dz}{z^4 + (4 b^2 - 2) z^2 + 1} = 2\pi i \left[\displaystyle \frac{r_1}{r_1^2-1} + \displaystyle \frac{r_2}{r_2^2-1} \right]$.

So, to complete the evaluation of $Q$, I need to simplify the right-hand side. I’ll complete this in tomorrow’s post.