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

and then employing the substitution

(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






where
and
(and
is a certain angle that is now irrelevant at this point in the calculation).
There are actually a couple of ways for computing this last integral. Today, I’ll lay the foundation for the “magic substitution”

With this substitution, the above integral will become a rational function, which can then be found using standard techniques.
First, we use some trig identities to rewrite
in terms of
:



![= \displaystyle \frac{ 2 - [ 1 + \tan^2 x])}{1 + \tan^2 x}](https://s0.wp.com/latex.php?latex=%3D+%5Cdisplaystyle+%5Cfrac%7B+2+-+%5B+1+%2B+%5Ctan%5E2+x%5D%29%7D%7B1+%2B+%5Ctan%5E2+x%7D&bg=ffffff&fg=000000&s=0&c=20201002)

Next, I’ll replace
by
:
.
Second, for the sake of completeness (even though it isn’t necessary for this particular integral), I’ll rewrite
in terms of
:






Next, I’ll replace
by
:
.
Third, again for the sake of completeness,
.
Finally, I need to worry about what happens to the
:


![du = \displaystyle \frac{1}{2} \left[ 1 + \tan^2 \displaystyle \frac{\phi}{2} \right] d\phi](https://s0.wp.com/latex.php?latex=du+%3D+%5Cdisplaystyle+%5Cfrac%7B1%7D%7B2%7D+%5Cleft%5B+1+%2B+%5Ctan%5E2+%5Cdisplaystyle+%5Cfrac%7B%5Cphi%7D%7B2%7D+%5Cright%5D+d%5Cphi&bg=ffffff&fg=000000&s=0&c=20201002)


These four substitutions can be used to convert trigonometric integrals into some other integral. Usually, the new integrand is pretty messy, and so these substitutions should only be used sparingly, as a last resort.

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