## A fun integral

I am writing this post with the intent of making it a little more accessible than usual, where I mean “accessible” in two senses. If you are a mathematical person who is more interested in analysis than algebra, this will be a much easier and more pleasant read than the usual algebraic geometry and representation theory. On the other hand, if you are not a self-declared mathematical person and ended your mathematical education after high school or maybe a semester in college, I hope that this post will be at least readable and maybe even interesting. To understand all the details requires a lot of calculus, but to follow the outline of the proof you only need to know basic properties of integration (the precise definition of an integral, for example, is not important).

Today I will explain how to evaluate the integral

.

The reader – mathematically inclined or not – may ask why one would want to do such a thing. I cannot offer any reason other than the fact that the solution invokes some techniques which are not at all obvious from the statement: to a mathematician, this is interesting and makes the effort worth more than simply finding the answer (which we will see is unsatisfyingly complicated). I will use one nontrivial theorem from complex analysis, but if the reader is willing to take this for granted then no knowledge of complex analysis is required. It seems slightly miraculous to me that the integral, which apparently does not involve complex numbers at all, has an elegant solution using complex analysis. An observant reader might have noticed that the integrand is well-defined because for all real numbers , but this quadratic polynomial does have two complex roots and (for example, one can apply the quadratic formula).

For reasons which will become apparent later, it is convenient to replace the integrand by the complex-valued function . Using Euler’s formula , we can see that the real part of this new function is our original integrand , so if we can compute the new integral we can recover the old one by taking the real part of the answer.

We compute this improper integral by integrating over a bounded interval and passing to the limit as the interval becomes larger:

.

The trick is to think of the bounded interval as a path in the complex plane, and then connect the end of the path to the beginning via a rectangular path through the upper half-plane, forming a closed loop .

It does not matter precisely where the top edge of the rectangle is, as long as the loop encloses the complex number , which we say is a *pole* of the integrand (note that we have changed the variable to to emphasize that we are considering a function of complex numbers) because the denominator of this function vanishes there. In a sense, this is the best (or rather least bad) kind of pole, since if we multiply the function by the pole disappears and the function is perfectly well-behaved near : we call this a *first-order* or *simple *pole.

Here is where the magic of complex analysis comes into play: we will use the *residue theorem* to evaluate the integral around this loop. A weak form of the residue theorem can be stated as follows: suppose and are differentiable functions of the complex variable , that and are continuous, and that has a simple pole at . Let be a “nice” loop in (let’s not get into technical details, but “nice” might mean piecewise smooth and not self-intersecting) which goes around once counterclockwise and encloses no other poles of , i.e. zeroes of . Then the residue theorem says that

.

It is not hard to see that the condition that is a simple pole of the integrand guarantees that , so the answer is well-defined.

Applying this to our situation, we find that

.

But how does this help us calculate the integral along the real line? First, writing we have along , and in particular for large we can estimate

where is a constant. Thus if we let denote one of the vertical edges of and the the length of , we have

,

so this integral vanishes as . We conclude that

,

where and is the horizontal line that passes through (note that since we moved the integral along to other other side of the equation, we must now integrate left-to-right along rather than right-to-left as in ).

We claim that the integral along vanishes. To this end, consider the following rectangular contour , which lies entirely above .

Now we invoke another special case of the residue theorem, known as *Cauchy’s theorem*. This result says that when a loop encloses *no* poles of a continuously differentiable function, or in other words the integrand is well-defined and continuously differentiable everywhere in the interior of the loop, the integral around that loop is actually . So we see that in our case, we have

By the estimate above, the integral along the vertical edges vanishes as , whence

for all . But in fact, the integral along must tend to zero as , since for large we can estimate

,

where is another constant: this yields

,

and since is a constant independent of we see that the integral vanishes as . But we already proved that the integral does not depend on , so we must have

for all . Combining this with our earlier calculation using the residue theorem, we obtain the final answer

.

If you’re curious, this is : you can check this approximate answer by numerically integrating with Wolfram Alpha or a good calculator.

why do you need to use cauchy’s residue theorem, can’t you just stop at taking the real part of the integrand after applying the residue theorem. By doing so you still get the same answer that you eventually got.

The residue theorem allows us to compute the integral around the rectangle gamma_N. The rest of the post shows that this gives the same answer as integrating over the real line. The point is that the integral over the left, right, and top edges vanishes as N goes to infinity.