Problem: Evaluate the following double integral.

\(I=\displaystyle\int\limits_{-\infty}^{\infty}dx\int\limits_{-\infty}^{\infty}dy\; e^{-x^2-y^2-(x-y)^2}\)Solution: This problem was taken from the collection “Berkeley Problems in Mathematics“, Problem 2.3.3. Two solutions are given, neither of which are close to [stylistically] mine, which I give below.

First, change to polar coordinates; that is, \(x=r \cos \theta\), \(y=r \sin\theta\). Using the Jacobian \(dx\,dy=r\,dr\,d\theta\), we get

\(I=\displaystyle\int\limits_{0}^{2\,\pi}d\theta\int\limits_{0}^{\infty}dr\,r\;e^{-2\,(1-\sin \theta\, \cos \theta)\,r^{2}}\)Or…

\(I=\displaystyle\frac{1}{4}\,\int\limits_{0}^{2\,\pi}\frac{d\theta}{1-\sin \theta\,\cos \theta}=\frac{1}{4}\,\int\limits_{0}^{2\,\pi}\frac{d\theta}{1-\frac{1}{2}\sin \theta}\).

Now, there are two ways I can think of to go about evaluating this latter integral. First, we can Taylor expand and hope for the best; it turns out that the resulting series converges to something well-known, but you have to be an expert at recognizing such things. [I so hate solutions that require a *deus ex machina* like that.] The other way is to convert to complex variables and use the Residue Theorem. [I’m afraid, however, if you are not familiar with the Residue Theorem, then we are back to a *deus ex machina.* But one has to draw the line somewhere, I guess…]

So, consider the following integral:

\(J(a)=\displaystyle\int\limits_{0}^{2\,\pi}\frac{d\theta}{1-a\,\sin \theta}\;:|a|<1\).

Observe that

\(\displaystyle \sin \theta=\frac{1}{2 i}\left (e^{i \theta}-e^{-i \theta} \right )\).

The trick is to recognize that we are integrating over the unit circle \(C\). if we let \(z=e^{i \theta}\), and transform to an integral over \(z\), then the result is the following:

\(J(a)=-\displaystyle\frac{2}{a}\,\displaystyle\oint\limits_C \frac{dz}{z^2-i \frac{2}{a}\,z-1}\).

Recall that a residue of a function \(f\) at \(z=z_0\) is equal to

\(\mbox{Res}(f;z_0)=\displaystyle\lim_{z \to z_0} (z-z_0)\,f(z)\),

with the Residue Theorem stating that, for a function \(f\) having simple poles \(\displaystyle\{z_n\}_{n=1}^{N}\) within the simple closed curve \(C\), then

\(\displaystyle\oint\limits_C dz\,f(z)=i\,2\,\pi\,\sum\limits_{n=1}^{N} \mbox{Res}(f;z_n)\).

To compute \(J\) using the Residue Theorem, we must compute the roots of the quadratic in the denominator of the integrand. These roots are at

\(z=z_{\pm}=\displaystyle\frac{i}{a}\left (1 \pm \sqrt{1-a^2} \right )\).

Note that \(\displaystyle |z_{+}|>1\), so that we need only consider the root \(z_{-}\). Hence,

\(J(a)=-\displaystyle\frac{2}{a}\,i\,2\,\pi\,\frac{1}{z_{-}-z_{+}}=\frac{2 \pi}{\sqrt{1-a^2}}\).

Finally, the result is

\(I=\displaystyle\frac{1}{4}\,J \left (\frac{1}{2} \right )=\frac{\pi}{\sqrt{3}}\).