My Favorite One-Liners: Part 76

In this series, I’m compiling some of the quips and one-liners that I’ll use with my students to hopefully make my lessons more memorable for them.

Here’s a problem that might arise in trigonometry:

Compute $\cos \displaystyle \frac{2017\pi}{6}$.

To begin, we observe that $\displaystyle \frac{2017}{6} = 336 + \displaystyle \frac{1}{6}$, so that

$\cos \displaystyle \frac{2017\pi}{6} = \cos \left( \displaystyle 336\pi + \frac{\pi}{6} \right)$.

We then remember that $\cos \theta$ is a periodic function with period $2\pi$. This means that we can add or subtract any multiple of $2\pi$ to the angle, and the result of the function doesn’t change. In particular, $-336\pi$ is a multiple of $2 \pi$, so that

$\cos \displaystyle \frac{2017\pi}{6} = \cos \left( \displaystyle 336\pi + \frac{\pi}{6} \right)$

$= \cos \left( \displaystyle 336\pi + \frac{\pi}{6} - 336\pi \right)$

$= \cos \displaystyle \frac{\pi}{6}$

$= \displaystyle \frac{\sqrt{3}}{2}$.

Said another way, $336\pi$ corresponds to $336/2 = 168$ complete rotations, and the value of cosine doesn’t change with a complete rotation. So it’s OK to just throw away any even multiple of $\pi$ when computing the sine or cosine of a very large angle. I then tell my class:

In mathematics, there’s a technical term for this idea; it’s called $\pi$ throwing.

How I Impressed My Wife: Index

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:

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

Yes, I married well indeed.

In this post, I collect the posts that I wrote last summer regarding various ways of computing this integral.

Part 1: Introduction
Part 2a, 2b, 2c, 2d, 2e, 2f: Changing the endpoints of integration, multiplying top and bottom by $\sec^2 x$, and the substitution $u = \tan x$.
Part 3a, 3b, 3c, 3d, 3e, 3f, 3g, 3h, 3i: Double-angle trig identity, combination into a single trig function, changing the endpoints of integration, and the magic substitution $u = \tan \theta/2$.
Part 4a, 4b, 4c, 4d, 4e, 4f, 4g, 4h: Double-angle trig identity, combination into a single trig function, changing the endpoints of integration, and contour integration using the unit circle
Part 5a, 5b, 5c, 5d, 5e, 5f, 5g, 5h, 5i, 5j: Independence of the parameter $a$, the magic substitution $u = \tan \theta/2$, and partial fractions.
Part 6a, 6b, 6c, 6d, 6e, 6f, 6g:Independence of the parameter $a$, the magic substitution $u = \tan \theta/2$, and contour integration using the real line and an expanding semicircle.
Part 7: Concluding thoughts… and ways that should work that I haven’t completely figured out yet.

How I Impressed My Wife: Part 5c

Earlier in this series, I gave three different methods of showing 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|}.$

Using the fact that $Q$ is independent of $a$, I’ll now give a fourth method.
Since $Q$ is independent of $a$, I can substitute any convenient value of $a$ that I want without changing the value of $Q$. For example, let me substitute $a =0$:

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

So that I can employ the magic substitution $u = \tan x/2$, I’ll divide the interval of integration into two pieces and then perform the substitution $x = t + 2\pi$ on the second piece:

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

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

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

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

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

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

How I Impressed My Wife: Part 3e

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

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).

I now write $Q$ as a new sum $Q_5 + Q_6$ by again dividing the region of integration:

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

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

For $Q_6$, I employ the substitution $u = \phi - 2\pi$, so that $\phi = u + 2\pi$ and $d\phi= du$. Also, the interval of integration changes from $\pi \le \phi \le 2\pi$ to $-\pi \le u \le 0$, so that

$Q_6 = 2 \displaystyle \int_{-\pi}^{0} \frac{du}{S + R \cos (u + 2\pi)}$

Next, I employ the trigonometric identity $\cos(u + 2\pi) = \cos u$:

$Q_6 = 2 \displaystyle \int_{-\pi}^{0} \frac{du}{S + R \cos u} = 2 \displaystyle \int_{-\pi}^{0} \frac{d\phi}{S + R \cos \phi}$,

where I have changed the dummy variable from $u$ back to $\phi$.

Therefore, $Q = Q_6 + Q_5$ becomes

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

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

Once again, the fact that the integrand is over an interval of length $2\pi$ allows me to shift the interval of integration.

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

How I Impressed My Wife: Part 3d

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

where $R = \sqrt{(2a)^2 + (1-a^2-b^2)^2}$, $S = 1 + a^2 + b^2$, and $\alpha$ is a certain angle (that will soon become irrelevant).

I now write $Q$ as a new sum $Q_3 + Q_4$ by dividing the region of integration:

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

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

For $Q_3$, I employ the substitution $u = \theta + 2\pi$, so that $\theta = u - 2\pi$ and $d\theta = du$. Also, the interval of integration changes from $0 \le \theta \le \alpha$ to $2\pi \le u \le 2\pi + \alpha$, so that

$Q_3 = 2 \displaystyle \int_{2\pi}^{2\pi + \alpha} \frac{du}{S + R \cos (u - 2\pi - \alpha)}$

Next, I employ the trigonometric identity $\cos(u - 2\pi - \alpha) = \cos (u -\alpha)$:

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

where I have changed the dummy variable from $u$ back to $\theta$.

Therefore, $Q = Q_4 + Q_3$ becomes

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

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

Next, I employ the substitution $\phi = \theta - \alpha$, so that $d\phi = d\theta$ and the interval of integration changes from $\alpha \le \theta \le 2\pi + \alpha$ to $0 \le \phi \le 2\pi$:

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

Almost by magic, the mysterious angle $\alpha$ has completely disappeared, making the integral that much easier to compute.

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

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.