The antiderivative of 1/(x^4+1): Part 2

This antiderivative has arguable the highest ratio of “really hard to compute” to “really easy to write”:

\displaystyle \int \frac{1}{x^4 + 1} dx

To compute this integral, I will use the technique of partial fractions. This requires factoring the denominator over the real numbers, which can be accomplished by finding the roots of the denominator. In other words, I need to solve

x^4 + 1 = 0,

or

z^4 = -1.

I switched to the letter z since the roots will be complex. The four roots of this quartic equation can be found with De Moivre’s Theorem by writing

z = r (\cos \theta + i \sin \theta),

where r is a real number, and

-1 + 0i = 1(\cos \pi + \i \sin \pi)

By De Moivre’s Theorem, I obtain

r^4 (\cos 4\theta + i \sin 4 \theta) = 1 (\cos \pi + i \sin \pi).

Matching terms, I obtain the two equations

r^4 = 1 and 4\theta = \pi + 2\pi n

or

r = 1 and \theta = \displaystyle \frac{\pi}{4} + \displaystyle \frac{\pi n}{2}

or

r = 1 and \theta = \displaystyle \frac{\pi}{4}, \frac{3\pi}{4}, \frac{5\pi}{4}, \frac{7\pi}{4}.

This yields the four solutions

z = 1 \left[ \cos \displaystyle \frac{\pi}{4} + i \sin \frac{\pi}{4} \right] = \displaystyle \frac{\sqrt{2}}{2} + i \frac{\sqrt{2}}{2}

z = 1 \left[ \cos \displaystyle \frac{3\pi}{4} + i \sin \frac{3\pi}{4} \right] = -\displaystyle \frac{\sqrt{2}}{2} + i \frac{\sqrt{2}}{2}

z = 1 \left[ \cos \displaystyle \frac{5\pi}{4} + i \sin \frac{5\pi}{4} \right] = -\displaystyle \frac{\sqrt{2}}{2} - i \frac{\sqrt{2}}{2}

z = 1 \left[ \cos \displaystyle \frac{7\pi}{4} + i \sin \frac{7\pi}{4} \right] = \displaystyle \frac{\sqrt{2}}{2} - i \frac{\sqrt{2}}{2}

Therefore, the denominator x^4 + 1 can be written as the following product of linear factors over the complex plane:

\displaystyle \left(x - \left[ \displaystyle \frac{\sqrt{2}}{2} + i \frac{\sqrt{2}}{2} \right] \right)\left(x - \left[ \displaystyle \frac{\sqrt{2}}{2} - i \frac{\sqrt{2}}{2} \right] \right) \left(x - \left[ -\displaystyle \frac{\sqrt{2}}{2} + i \frac{\sqrt{2}}{2} \right] \right) \left(x - \left[ - \displaystyle \frac{\sqrt{2}}{2} - i \frac{\sqrt{2}}{2} \right] \right)

or

\displaystyle \left(\left[x - \displaystyle \frac{\sqrt{2}}{2} \right] - i \frac{\sqrt{2}}{2} \right)\left( \left[ x - \displaystyle \frac{\sqrt{2}}{2} \right] + i \frac{\sqrt{2}}{2} \right) \left( \left[ x + \displaystyle \frac{\sqrt{2}}{2} \right] - i \frac{\sqrt{2}}{2} \right) \left( \left[ x + \displaystyle \frac{\sqrt{2}}{2} \right] + i \frac{\sqrt{2}}{2} \right)

or

\displaystyle \left(\left[x - \displaystyle \frac{\sqrt{2}}{2} \right]^2 - \left[ i \frac{\sqrt{2}}{2} \right]^2 \right) \left( \left[ x + \displaystyle \frac{\sqrt{2}}{2} \right]^2 - \left[i \frac{\sqrt{2}}{2} \right]^2 \right)

or

\displaystyle \left(x^2 - x \sqrt{2} + \displaystyle \frac{1}{2} + \displaystyle \frac{1}{2}\right) \left(x^2 + x \sqrt{2} + \displaystyle \frac{1}{2} + \displaystyle \frac{1}{2}\right)

or

\displaystyle \left(x^2 - x \sqrt{2} + 1 \right) \left(x^2 + x \sqrt{2} + 1\right).

We have thus factored the denominator over the real numbers:

\displaystyle \int \frac{dx}{x^4 + 1} = \displaystyle \int \frac{dx}{\left(x^2 - x \sqrt{2} + 1 \right) \left(x^2 + x \sqrt{2} + 1\right)} ,

and the technique of partial fractions can be applied.

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

Different ways of solving a contest problem (Part 3)

The following problem appeared on the American High School Mathematics Examination (now called the AMC 12) in 1988:

If 3 \sin \theta = \cos \theta, what is \sin \theta \cos \theta?

When I presented this problem to a group of students, I was pleasantly surprised by the amount of creativity shown when solving this problem.

Yesterday, I presented a solution using a Pythagorean identity, but I was unable to be certain if the final answer was a positive or negative without drawing a picture. Here’s a third solution that also use a Pythagorean trig identity but avoids this difficulty. Again, I begin by squaring both sides.

9 \sin^2 \theta = \cos^2 \theta

9 (1 - \cos^2 \theta) = \cos^2 \theta

9 - 9 \cos^2 \theta = \cos^2 \theta

9 = 10 \cos^2 \theta

\displaystyle \frac{9}{10} = \cos^2 \theta

\displaystyle \pm \frac{3}{\sqrt{10}} = \cos \theta

Yesterday, I used the Pythagorean identity again to find \sin \theta. Today, I’ll instead plug back into the original equation 3 \sin \theta = \cos \theta:

3 \sin \theta = \cos \theta

3 \sin \theta = \displaystyle \frac{3}{\sqrt{10}}

\sin \theta = \displaystyle \pm \frac{1}{\sqrt{10}}

Unlike the example yesterday, the signs of \sin \theta and \cos \theta must agree. That is, if \cos \theta = \displaystyle \frac{3}{\sqrt{10}}, then \sin \theta = \displaystyle \frac{1}{\sqrt{10}} must also be positive. On the other hand, if \cos \theta = \displaystyle -\frac{3}{\sqrt{10}}, then \sin \theta = \displaystyle -\frac{1}{\sqrt{10}} must also be negative.

If they’re both positive, then

\sin \theta \cos \theta = \displaystyle \left( \frac{1}{\sqrt{10}} \right) \left( \frac{3}{\sqrt{10}} \right) =\displaystyle \frac{3}{10},

and if they’re both negative, then

\sin \theta \cos \theta = \displaystyle \left( -\frac{1}{\sqrt{10}} \right) \left( -\frac{3}{\sqrt{10}} \right) = \displaystyle \frac{3}{10}.

Either way, the answer must be \displaystyle \frac{3}{10}.

This is definitely superior to the solution provided in yesterday’s post, as there’s absolutely no doubt that the product \sin \theta \cos \theta must be positive.

Different ways of solving a contest problem (Part 2)

The following problem appeared on the American High School Mathematics Examination (now called the AMC 12) in 1988:

If 3 \sin \theta = \cos \theta, what is \sin \theta \cos \theta?

When I presented this problem to a group of students, I was pleasantly surprised by the amount of creativity shown when solving this problem.

Yesterday, I presented a solution using triangles. Here’s a second solution that I received: begin by squaring both sides and using a Pythagorean trig identity.

9 \sin^2 \theta = \cos^2 \theta

9 (1 - \cos^2 \theta) = \cos^2 \theta

9 - 9 \cos^2 \theta = \cos^2 \theta

9 = 10 \cos^2 \theta

\displaystyle \frac{9}{10} = \cos^2 \theta

\displaystyle \pm \frac{3}{\sqrt{10}} = \cos \theta

We use the Pythagorean identity again to find \sin \theta:

\displaystyle \frac{9}{10} = \cos^2 \theta

\displaystyle \frac{9}{10} = 1 - \sin^2 \theta

\sin^2 \theta = \displaystyle \frac{1}{10}

\sin \theta = \displaystyle \pm \frac{1}{\sqrt{10}}

Therefore, we know that

\sin \theta \cos \theta = \displaystyle \left( \pm \frac{1}{\sqrt{10}} \right) \left( \pm \frac{3}{\sqrt{10}} \right) = \displaystyle \pm \displaystyle \frac{3}{10},

so the answer is either \displaystyle \frac{3}{10} or \displaystyle -\frac{3}{10}. However, this was a multiple-choice contest problem and \displaystyle -\frac{3}{10} was not listed as a possible answer, and so the answer must be \displaystyle \frac{3}{10}.

green lineFor a contest problem, the above logic makes perfect sense. However, the last step definitely plays to the fact that this was a multiple-choice problem, and the concluding step would not have been possible had \displaystyle -\frac{3}{10} been given as an option.

 

Different ways of solving a contest problem (Part 1)

The following problem appeared on the American High School Mathematics Examination (now called the AMC 12) in 1988:

If 3 \sin \theta = \cos \theta, what is \sin \theta \cos \theta?

When I presented this problem to a group of students, I was pleasantly surprised by the amount of creativity shown when solving this problem.

Here’s the first solution that I received: draw the appropriate triangles for the angle \theta:

3 \sin \theta = \cos \theta

\tan \theta = \displaystyle \frac{1}{3}

Therefore, the angle \theta must lie in either the first or third quadrant, as shown. (Of course, \theta could be coterminal with either displayed angle, but that wouldn’t affect the values of \sin \theta or \cos \theta.)

AHSME problem

In Quadrant I, \sin \theta = \displaystyle \frac{1}{\sqrt{10}} and \cos \theta = \displaystyle \frac{3}{\sqrt{10}}. Therefore,

\sin \theta \cos \theta = \displaystyle \frac{1}{\sqrt{10}} \times \frac{3}{\sqrt{10}} = \displaystyle \frac{3}{10}.

In Quadrant III, \sin \theta = \displaystyle -\frac{1}{\sqrt{10}} and \cos \theta = -\displaystyle \frac{3}{\sqrt{10}}. Therefore,

\sin \theta \cos \theta = \displaystyle \left( - \frac{1}{\sqrt{10}} \right) \times \left( -\frac{3}{\sqrt{10}} \right) = \displaystyle \frac{3}{10}.

Either way, we can be certain that \sin \theta \cos \theta = \displaystyle \frac{3}{10}.

How I Impressed My Wife: Part 5h

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.
green lineSince 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}

The four roots of the denominator satisfy

u^2 = \displaystyle 1 - 2b^2 \pm 2|b| \sqrt{b^2 - 1}

So far, I’ve handled the cases |b| = 1 and |b| > 1. In today’s post, I’ll start considering the case |b| < 1.

Factoring the denominator is a bit more complicated if |b| < 1. Using the quadratic equation, we obtain

u^2 = \displaystyle 1 - 2b^2 \pm 2|b| i \sqrt{1-b^2}

However, unlike the cases |b| \ge 1, the right-hand side is now a complex number. So, To solve for u, I’ll use DeMoivre’s Theorem and some surprisingly convenient trig identities. Notice that

(1-2b^2)^2 + (2|b| \sqrt{1-b^2})^2 = 1 - 4b^2 + b^4 + 4b^2 (1 - b^2) = 1 - 4b^2 + b^4 + 4b^2 - b^4 = 1.

Therefore, the four complex roots of the denominator satisfy |u^2| = 1, or |u| = 1. This means that all four roots can be written in trigonometric form so that

u^2 = \cos 2\phi + i \sin 2\phi,

where 2\phi is some angle. (I chose the angle to be 2\phi instead of \phi for reasons that will become clear shortly.)

I’ll begin with solving

u^2 = \displaystyle 1 - 2b^2 + 2|b| i \sqrt{1-b^2}.

Matching the real and imaginary parts, we see that

\cos 2\phi = 1-2b^2,

\sin 2\phi = 2|b| \sqrt{1-b^2}

This completely matches the form of the double-angle trig identities

\cos 2\phi = 1 - 2\sin^2 \phi,

\sin 2 \phi = 2 \sin\phi \cos \phi,

and so the problem reduces to solving

u^2 = \cos 2\phi + i \sin 2\phi,

where $\sin \phi = |b|$ and $\cos \phi = \sqrt{1-b^2}$. By De Moivre’s Theorem, I can conclude that the two solutions of this equation are

u = \pm(\cos \phi + i \sin \phi),

or

u = \pm( \sqrt{1-b^2} + i |b|).

I could re-run this argument to solve u^2 = \displaystyle 1 - 2b^2 - 2|b| i \sqrt{1-b^2} and get the other two complex roots. However, by the Conjugate Root Theorem, I know that the four complex roots of the denominator u^4 + (4 b^2 - 2) u^2 + 1 must come in conjugate pairs. Therefore, the four complex roots are

u = \pm \sqrt{1-b^2} \pm i |b|.

Therefore, I can factor the denominator as follows:

u^4 + (4 b^2 - 2) u^2 + 1 = (u - [\sqrt{1-b^2} + i|b|])(u - [\sqrt{1-b^2} - i|b|])

\qquad \times (u - [-\sqrt{1-b^2} + i|b|])(u - [-\sqrt{1-b^2} + i|b|])

= (u - \sqrt{1-b^2} - i|b|)(u - \sqrt{1-b^2} + i|b])

\qquad \times (u +\sqrt{1-b^2} + i|b|)(u +\sqrt{1-b^2} + i|b|)

= ([u - \sqrt{1-b^2}]^2 +b^2)([u + \sqrt{1-b^2}]^2 +b^2)

To double-check my work, I can directly multiply this product:

([u - \sqrt{1-b^2}]^2 +b^2)([u + \sqrt{1-b^2}]^2 +b^2)

= (u^2 - 2u \sqrt{1-b^2} + 1 - b^2 + b^2) (u^2 + 2u \sqrt{1-b^2} + 1 - b^2 + b^2)

= ([u^2 +1] - 2u\sqrt{1-b^2})([u^2+1] + 2u\sqrt{1-b^2})

= [u^2+1]^2 - [2u\sqrt{1-b^2}]^2

= u^4 + 2u^2 + 1 - 4u^2 (1-b^2)

= u^4 + u^2 (2 - 4[1-b^2]) + 1

= u^4 + u^2 (4b^2 - 2) + 1.

So, at last, I can rewrite the integral Q as

Q = \displaystyle \int_{-\infty}^{\infty} \frac{ 2(1+u^2) du}{ ([u - \sqrt{1-b^2}]^2 +b^2)([u + \sqrt{1-b^2}]^2 +b^2)}

green line

I’ll continue with this fourth evaluation of the integral, continuing the case |b| < 1, in tomorrow’s post.

How I Impressed My Wife: Part 4b

Previously in this series, I have used two different techniques to show 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|}.

Originally, 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.
green lineLet me backtrack to a point in the middle of the previous solution:

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

Earlier in this series, I used the magic substitution u = \tan \displaystyle \frac{\phi}{2} to evaluate this last integral. Now, I’ll instead use contour integration; see Wikipedia for more details. I will use Euler’s formula as a substitution (see here and here for more details):

z = e^{i \phi} = \cos \phi + i \sin \phi,

so that the integral Q is transformed to a contour integral in the complex plane. Under this substitution, as discussed in yesterday’s post,

\cos \phi = \displaystyle \frac{1}{2} \left[z + \displaystyle \frac{1}{z} \right]

and

d\phi = \displaystyle -\frac{i}{z} dz

Employing this substitution, the region of integration changes from 0 \le \phi \le 2\pi to a the unit circle C, a closed counterclockwise contour in the complex plane:

Q = 2 \displaystyle \oint_C \frac{\displaystyle -\frac{i}{z} dz}{S + \displaystyle \frac{R}{2} \left[z + \displaystyle \frac{1}{z} \right]}

= -4i \displaystyle \oint_C \frac{dz}{Rz^2 + 2Sz + R}

= \displaystyle -\frac{4i}{R} \oint_C \frac{dz}{z^2 + 2\frac{S}{R}z + 1}

green lineWhile this looks integral in the complex plane looks a lot more complicated than a regular integral, it’s actually a lot easier to compute using residues. I’ll discuss the computation of this contour integral in tomorrow’s post.

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.
green line

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.

green line

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

How I Impressed My Wife: Part 3b

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.
green line
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)}

We now employ the substitution \theta = 2x, so that d\theta = 2 \, dx. Also, the limits of integration change from 0 \le x \le 2\pi to 0 \le \theta \le 4\pi, so that

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

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

Next, I’ll divide write Q = Q_1 + Q_2 by dividing the interval of integration (not to be confused with the Q_1 and Q_2 used in the previous method), where

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

Q_2 = \displaystyle \int_{2\pi}^{4\pi} \frac{d\theta}{(1+a^2+b^2) + 2 a \sin \theta + (1 - a^2 - b^2) \cos \theta}

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

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

Next, I use the periodic property for both sine and cosine — \sin(u + 2\pi) = \sin u and \cos(u+ 2\pi) = \cos u — to rewrite Q_2 as

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

Except for the dummy variable u, instead of \theta, we see that Q_2 is identical to Q_1. Therefore,

Q = Q_1 + Q_2 = 2 Q_1 = 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}.

green line

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

How I Impressed My Wife: Part 3a

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.
green line
For this next technique, I begin by using the trigonometric identities

\sin^2 x = \displaystyle \frac{1-\cos 2x}{2},

\cos^2x = \displaystyle \frac{1+\cos 2x}{2},

2 \sin x \cos x = \sin 2x.

Using these identities, we obtain

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

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

In this way, the exponents have been removed from the denominator, thus making the integrand somewhat less complicated.

green line

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