# How I Impressed My Wife: Part 3g

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}$

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

$= 2 \displaystyle \int_{0}^{2\pi} \frac{d\phi}{S + R \cos \phi}$

$= 2 \displaystyle \int_{-\pi}^{\pi} \frac{d\phi}{S + R \cos \phi}$

where $R = \sqrt{(2a)^2 + (1-a^2-b^2)^2}$ and $S = 1 + a^2 + b^2$ (and $\alpha$ is a certain angle that is now irrelevant at this point in the calculation).

As discussed in yesterday’s post, I now employ the “magic substitution” $u = \tan \displaystyle \frac{\phi}{2}$, so that

$\cos \phi = \displaystyle \frac{1-u^2}{1+u^2}$

and

$d\phi = \displaystyle \frac{2 du}{1+u^2}$.

Employing this substitution, the range of integration changes from $-\pi < \phi < \pi$ to $-\infty < u < \infty$, so that

$Q = 2 \displaystyle \int_{-\infty}^{\infty} \frac{ ~ \displaystyle \frac{2 du}{1+u^2} ~}{~ S + R \displaystyle \frac{1-u^2}{1+u^2} ~}$

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

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

Using the magic substitution, the integral $Q$ has been converted to a standard rational function. I’ll continue with this different method of evaluating this integral in tomorrow’s post.

## One thought on “How I Impressed My Wife: Part 3g”

This site uses Akismet to reduce spam. Learn how your comment data is processed.