# How I Impressed My Wife: Part 2a

Some husbands try to impress their wives by lifting extremely heavy objects or other extraordinary feats of physical prowess.

That will never happen in the Quintanilla household in a million years.

But she was impressed that I broke an impasse in her research and resolved a discrepancy between Mathematica 4 and Mathematica 8 by finding the following integral by hand in less than an hour:

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

In this series, I’ll explore different ways of evaluating this integral.I begin by adjusting the range of integration:

$Q = Q_1 + Q_2 + Q_3$,

where

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

$Q_2 = \displaystyle \int_{\pi/2}^{3\pi/2} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$,

$Q_3 = \displaystyle \int_{3\pi/2}^{2\pi} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$.

I’ll begin with $Q_3$ and apply the substitution $u = x - 2\pi$, or $x = u + 2\pi$. Then $du = dx$, and the endpoints change from $3\pi/2 \le x 2\pi$ to $-\pi/2 \le u \le 0$. Therefore,

$Q_3 = \displaystyle \int_{-\pi/2}^{0} \frac{du}{\cos^2 (u+2\pi) + 2 a \sin (u+2\pi) \cos (u+2\pi) + (a^2 + b^2) \sin^2 (u+2\pi)}$.

Next, we use the periodic property for both sine and cosine — $\sin(x + 2\pi) = \sin x$ and $\cos(x + 2\pi) = \cos x$ — to rewrite $Q_3$ as

$Q_3 = \displaystyle \int_{-\pi/2}^{0} \frac{du}{\cos^2 u + 2 a \sin u \cos u + (a^2 + b^2) \sin^2 u}$.

Changing the dummy variable from $u$ back to $x$, we have

$Q_3 = \displaystyle \int_{-\pi/2}^{0} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$.

Therefore, we can combined $Q_3 + Q_1$ into a single integral:

$Q_3 + Q_1 = \displaystyle \int_{-\pi/2}^{0} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$

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

$Q_3 + Q_1 = \displaystyle \int_{-\pi/2}^{\pi/2} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$

Next, we work on the middle integral $Q_2$. We use the substitution $u = x - \pi$, or $x = u + \pi$, so that $du = dx$. Then the interval of integration changes from $\pi/2 \le x \le 3\pi/2$ to $-\pi/2 \le u \le \pi/2$, so that

$Q_2 = \displaystyle \int_{\pi/2}^{3\pi/2} \frac{dx}{\cos^2 x + 2 a \sin x \cos x + (a^2 + b^2) \sin^2 x}$

$= \displaystyle \int_{-\pi/2}^{\pi/2} \frac{du}{\cos^2 (u+\pi) + 2 a \sin (u+\pi) \cos (u+\pi) + (a^2 + b^2) \sin^2 (u+\pi)}$.

Next, we use the trigonometric identities

$\sin(u + \pi) = \sin u \cos \pi + \cos u \sin \pi = \sin u \cdot (-1) + \cos u \cdot 0 = - \sin u$,

$\cos(u + \pi) = \cos u \cos \pi - \sin u \sin \pi = \cos u \cdot (-1) - \sin u \cdot 0 = - \cos u$,

so that the last integral becomes

$Q_2 = \displaystyle \int_{-\pi/2}^{\pi/2} \frac{dx}{(-\cos u)^2 + 2 a (-\sin u)(- \cos u) + (a^2 + b^2) (-\sin u)^2}$

$= \displaystyle \int_{-\pi/2}^{\pi/2} \frac{du}{\cos^2 u + 2 a \sin u \cos u + (a^2 + b^2) \sin^2 u}$

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

On the line above, I again replaced the dummy variable of integration from $u$ to $x$. We see that $Q_2 = Q_1 + Q_3$, and so

$Q = Q_1 + Q_2 + Q_3$

$Q = 2 Q_2$

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

I’ll continue with the evaluation of this integral in tomorrow’s post.

## One thought on “How I Impressed My Wife: Part 2a”

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