# How I Impressed My Wife: Part 3c

Previously in this series, I showed 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|}.$

My wife had asked me to compute this integral by hand because Mathematica 4 and Mathematica 8 gave different answers. At the time, I eventually obtained the solution by multiplying the top and bottom of the integrand by $\sec^2 x$ and then employing the substitution $u = \tan x$ (after using trig identities to adjust the limits of integration).
But this wasn’t the only method I tried. Indeed, I tried two or three different methods before deciding they were too messy and trying something different. So, for the rest of this series, I’d like to explore different ways that the above integral can be computed.

So far, I have shown 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 \int_0^{2\pi} \frac{2 \, dx}{1+\cos 2x + 2 a \sin 2x + (a^2 + b^2)(1-\cos 2x)}$

$= 2 \displaystyle \int_0^{2\pi} \frac{d\theta}{(1+a^2+b^2) + 2 a \sin \theta + (1 - a^2 - b^2) \cos \theta}$.

To simplify the denominator even further, I will combine the two trigonometric terms in the denominator; this is possible because the argument of both the sine and cosine functions are the same. To this end, notice that

$2 a \sin \theta + (1 - a^2 - b^2) \cos \theta = R \displaystyle \left[ \frac{2a}{R} \sin \theta + \frac{1-a^2-b^2}{R} \cos \theta \right]$,

where

$R = \sqrt{(2a)^2 + (1-a^2-b^2)^2}$

Next, let $\alpha$ be the unique angle so that

$\cos \alpha = \displaystyle \frac{1-a^2-b^2}{\sqrt{(2a)^2 + (1-a^2-b^2)^2}}$,

$\sin \alpha = \displaystyle \frac{2a}{\sqrt{(2a)^2 + (1-a^2-b^2)^2}}$.

With this substitution, we find that

$2 a \sin \theta + (1 - a^2 - b^2) \cos \theta = R [\cos \theta \cos \alpha + \sin \theta \sin \alpha]$

$= R \cos(\theta - \alpha)$

Therefore, the integral $Q$ may be rewritten as

$Q = 2 \displaystyle \int_0^{2\pi} \frac{d\theta}{S + R \cos (\theta - \alpha)}$,

where $R = \sqrt{(2a)^2 + (1-a^2-b^2)^2}$ and $S = 1 + a^2 + b^2$.

I’ll continue this different method of evaluating this integral in tomorrow’s post.