๐Ÿงฎ Brain Teaser

The Integral That Completes the Square in the Exponent

Evaluate:

I=โˆซ0โˆžeโˆ’x2cosโก(2bx)โ€‰dxI = \int_0^\infty e^{-x^2} \cos(2bx)\, dx

where bโˆˆRb \in \mathbb{R} is a real parameter.

Gaussian integralcompleting the squareFourier transformcontour shiftingintegration bee

Answer: The Integral That Completes the Square in the Exponent

Key Idea / Intuition

The cosine can be "absorbed" into the Gaussian by completing the square in the exponent. Writing cosโก(2bx)=Reโก(e2ibx)\cos(2bx) = \operatorname{Re}(e^{2ibx}), the product eโˆ’x2e2ibxe^{-x^2} e^{2ibx} becomes eโˆ’(xโˆ’ib)2โ‹…eโˆ’b2e^{-(x-ib)^2} \cdot e^{-b^2}. The extra factor eโˆ’b2e^{-b^2} pops out, and the remaining integral over the shifted Gaussian still equals ฯ€2\frac{\sqrt{\pi}}{2} by contour integration (the integrand decays fast enough that we can shift the contour without picking up any residues).


Formal Proof / Solution

Step 1: Bring cosine into the exponential.

Since cosโก(2bx)=Reโก(e2ibx)\cos(2bx) = \operatorname{Re}(e^{2ibx}), we have

I=Reโกโˆซ0โˆžeโˆ’x2+2ibxโ€‰dx.I = \operatorname{Re} \int_0^\infty e^{-x^2 + 2ibx}\, dx.

Step 2: Complete the square.

โˆ’x2+2ibx=โˆ’(x2โˆ’2ibx)=โˆ’(xโˆ’ib)2โˆ’b2.-x^2 + 2ibx = -(x^2 - 2ibx) = -(x - ib)^2 - b^2.

So

I=Reโก[eโˆ’b2โˆซ0โˆžeโˆ’(xโˆ’ib)2โ€‰dx].I = \operatorname{Re}\left[ e^{-b^2} \int_0^\infty e^{-(x-ib)^2}\, dx \right].

Step 3: Shift the contour.

Consider the contour integral of eโˆ’z2e^{-z^2} over the rectangle with vertices 0,R,Rโˆ’ib,โˆ’ib0, R, R-ib, -ib (where we take b>0b > 0 for concreteness; the case b<0b < 0 is symmetric). Since eโˆ’z2e^{-z^2} is entire, the integral over the closed rectangle is 00.

The contributions from the vertical sides [R,Rโˆ’ib][R, R-ib] and [0,โˆ’ib][0, -ib] vanish as Rโ†’โˆžR \to \infty (since eโˆ’z2e^{-z^2} decays rapidly on the right vertical side, and the left vertical side is finite). Therefore

โˆซ0โˆžeโˆ’(xโˆ’ib)2โ€‰dx=โˆซ0โˆžeโˆ’t2โ€‰dt=ฯ€2,\int_0^\infty e^{-(x-ib)^2}\, dx = \int_0^\infty e^{-t^2}\, dt = \frac{\sqrt{\pi}}{2},

where we set t=xโˆ’ibt = x - ib and shift the real contour back.

More precisely: the horizontal contour at Imโก(z)=โˆ’b\operatorname{Im}(z) = -b from 0โˆ’ib0-ib to โˆžโˆ’ib\infty - ib equals the horizontal contour at Imโก(z)=0\operatorname{Im}(z) = 0 from 00 to โˆž\infty, because the closing vertical segments contribute zero.

Step 4: Read off the answer.

Since eโˆ’b2e^{-b^2} and ฯ€2\frac{\sqrt{\pi}}{2} are both real,

I=eโˆ’b2โ‹…ฯ€2.I = e^{-b^2} \cdot \frac{\sqrt{\pi}}{2}.

I=ฯ€2โ€‰eโˆ’b2.\boxed{I = \frac{\sqrt{\pi}}{2}\, e^{-b^2}.}

Why this is beautiful: The result says that the Gaussian eโˆ’b2e^{-b^2} is its own Fourier transform (up to constants). Completing the square turns a hard oscillatory integral into a pure Gaussian one โ€” the oscillation is "hidden" inside the shifted exponent, and the only trace left is the decay factor eโˆ’b2e^{-b^2}. This is the computation that underlies the entire theory of Fourier analysis on R\mathbb{R}.

Type: IntegrationEdit on GitHub โ†—