There is a well-known trick for integrating $\int_{-\infty}^\infty e^{-x^2}\mathrm dx$, which is to write it as $\sqrt{\int_{-\infty}^\infty e^{-x^2}\mathrm dx\int_{-\infty}^\infty e^{-y^2}\mathrm dy}$, which can then be reexpressed in polar coordinates as an easy integral. Is this trick a one-hit wonder, or are there other cases where this trick works and is also necessary? It seems to depend on the defining property of the exponential function that $f(a+b)=f(a)f(b)$, which would make me think that it would only allow fairly trivial generalizations, e.g., to $\int_{-\infty}^\infty 7^{-x^2}\mathrm dx$ or $\int_{-\infty}^\infty a^{bx^2+cx+d}\mathrm dx$.

Can it be adapted through rotation in the complex plane to do integrals like $\int_{-\infty}^\infty \sin(x^2)\mathrm dx$? Here I find myself confused by trying to simultaneously visualize both the complex plane and the $(x,y)$ plane.

WP http://en.wikipedia.org/wiki/Gaussian_integral discusses integrals that have a similar form and seem to require different methods, but I'd be more interested in integrals that have different forms but can be conquered by the same trick.

The trick involves expanding from 1 dimension to 2. Is there a useful generalization where you expand from $m$ dimensions to $n$?

This is not homework.

  • $\begingroup$ Once you know the answer for that gaussian integral, you can use differentiation under integral sign (en.wikipedia.org/wiki/Differentiation_under_the_integral_sign) to solve very similar and much more complicated ones. $\endgroup$
    – r_31415
    Feb 3, 2012 at 5:28
  • 13
    $\begingroup$ Robert Dawson wrote about the limits of this method: cs.smu.ca/~dawson/Poisson.pdf $\endgroup$
    – user940
    Feb 3, 2012 at 5:29
  • $\begingroup$ @ByronSchmuland: If you make this an answer, I'll accept it. The only thing I'm slightly vague on is what Dawson means by "of the form." E.g., does he consider $e^{ax^2+bx+c}$ to be "of the form" $ke^{ax^2}$? He also only considers the reals, which makes me wonder about the complex rotation issue, which might lead to integrals like $\int_{-\infty}^\infty \sin(x^2)dx$. $\endgroup$
    – user13618
    Feb 3, 2012 at 5:42
  • 2
    $\begingroup$ @Ben: If you rewrite $ax^2+bx+c$ as $a(x-b)^2+h$ and $k=e^h$, then it's an obvious translate of the function $ke^{ax^2}$. $\endgroup$
    – anon
    Feb 3, 2012 at 5:45
  • 1
    $\begingroup$ @BenCrowell Well, the Wikipedia article I linked before has plenty of examples but taking your Gaussian integral as a starting point, take a look at math.uconn.edu/~kconrad/blurbs/analysis/diffunderint.pdf (page 6, higher moments of the Gaussian). However, the point being that this "technique" works fine in a wide variety of situations. $\endgroup$
    – r_31415
    Feb 3, 2012 at 5:55

5 Answers 5


I would like to answer to your question about Fresnel integral as I did this in my undergraduate studies. So, let us consider the integrals

$$S_1=\int_{-\infty}^\infty dx\sin(x^2) \qquad C_1=\int_{-\infty}^\infty dx\cos(x^2).$$

We want to apply the same technique used for Gauss integral in this case and consider the two-dimensional integrals

$$S_2=\int_{-\infty}^\infty\int_{-\infty}^\infty dxdy\sin(x^2+y^2) \qquad C_2=\int_{-\infty}^\infty\int_{-\infty}^\infty dxdy\cos(x^2+y^2).$$

If you go to polar coordinates, these integrals doe not converge. So, we introduce a convergence factor in the following way

$$S_2(\epsilon)=\int_{-\infty}^\infty\int_{-\infty}^\infty dxdy e^{-\epsilon(x^2+y^2)}\sin(x^2+y^2)$$ $$C_2(\epsilon)=\int_{-\infty}^\infty\int_{-\infty}^\infty dxdy e^{-\epsilon(x^2+y^2)}\cos(x^2+y^2).$$

Then one has, moving to polar coordinates,

$$S_2(\epsilon)=2\pi\int_0^\infty \rho d\rho e^{-\epsilon\rho^2}\sin(\rho^2) \qquad C_2(\epsilon)=2\pi\int_0^\infty \rho d\rho e^{-\epsilon\rho^2}\cos(\rho^2)$$

that is

$$S_2(\epsilon)=\pi\int_0^\infty dx e^{-\epsilon x}\sin(x) \qquad C_2(\epsilon)=\pi\int_0^\infty dx e^{-\epsilon x}\cos(x).$$

These integrals are well known and give

$$S_2(\epsilon)=\frac{\pi}{1+\epsilon^2} \qquad C_2(\epsilon)=\frac{\epsilon\pi}{1+\epsilon^2}$$

noting that integration variables are dummy. Now, in this case one can take the limit for $\epsilon\rightarrow 0$ producing

$$S_2=\int_{-\infty}^\infty\int_{-\infty}^\infty dxdy\sin(x^2+y^2)=\pi \qquad C_2=\int_{-\infty}^\infty\int_{-\infty}^\infty dxdy\cos(x^2+y^2)=0$$

By applying simple trigonometric formulas you will get back the value of the Fresnel integrals. But now, as a bonus, you have got the value of these integrals in two dimensions.

  • $\begingroup$ Great answer! Are you sure the $S_2=\pi$ at the end shouldn't be $S_2=\pi/4$? Let $S_1=\int_0^\infty \sin(x^2)dx$ and similarly for $C_1$. Then $C_2=0$ tells us that $S_1=\pm C_1$, so that with $S_2=2C_1S_1$ I get $C_1=S_1=\sqrt{S_2/2}$, which would seem to require $S_2=\pi/4$ in order to produce the correct result $S_1=C_1=\sqrt{\pi/8}$. Is it possible that your value of $\pi$ is for $\int_{-\infty}^\infty \int_{-\infty}^\infty$? $\endgroup$
    – user13618
    Feb 3, 2012 at 16:30
  • $\begingroup$ @BenCrowell: Of course you are right. I fix it. $\endgroup$
    – Jon
    Feb 3, 2012 at 17:38

Robert Dawson wrote about the limitations of this method in this article in the American Mathematical Monthly.


The distance metric that we use is quadratic in nature. No matter what dimensional $\mathbb{R}^n$ we are working in, the distance between two points is given by $r^2=\sum(\Delta x_i)^2$. It's the ability to swap out $\sum(\Delta x_i)^2$ with $r^2$ that helps compute $\int_{-\infty}^{\infty}e^{-x^2}\,dx$. No higher dimensional space will make this particular exchange any nicer. So this helps explain why the property you mention ($f(x^2)f(y^2)=f(x^2+y^2)$) is important.

On the other hand, what happens here is an exchange between Cartesian coordinates for $\mathbb{R}^2$ and polar coordinates. So could we do something similar in $\mathbb{R}^3$ with spherical coordinates?

$$\left(\int_{\mathbb{R}}f(x)\,dx\right)^3=\iiint_{\mathbb{R}^3} f(x)f(y)f(z)\,dxdydz=\iiint_{\mathbb{R}^3} F(\rho,\theta,\varphi)\,d\rho d\theta d\varphi$$

If $F(\rho,\theta,\varphi)$ breaks up as $g(\rho)h(\theta)k(\varphi)$, then you might have a slick way to compute $\int_{\mathbb{R}}f(x)\,dx$.


To answer the question in the first paragraph: Yes the exact same trick works for both $\int_{-\infty}^\infty 7^{-x^2}dx$ and $\int_{-\infty}^\infty a^{bx^2+cx+d}dx$, provided $b<0$. (The second generalizes the first, so we need only consider it). First, complete the square for the quadratic, and write $$bx^2+cx+d=b\left(x^2+\frac{c}{b}x+\frac{d}{b}\right)=b\left(x+\frac{c}{2b}\right)^2-\frac{c}{4b}+d.$$ Then our integral is $$a^{d-\frac{c}{4b}} \int_{-\infty}^\infty e^{\log(a)b\left(x+\frac{c}{2b}\right)^2}dx.$$ Since we are integrating over the real line, we may shift by $\frac{c}{2b}$ and then let $u=\sqrt{-b\log a}x$ (remember, $b<0$) to get $$a^{d-\frac{c}{4b}} \int_{-\infty}^\infty e^{\log(a)bx^2}dx=\frac{a^{d-\frac{c}{4b}}}{\sqrt{-b\log a}} \int_{-\infty}^\infty e^{-u^2}dx$$

$$=\frac{a^{d-\frac{c}{4b}}}{\sqrt{-b\log a}}\sqrt{\pi}.$$


Another example: If

$$I = \int_{-\infty}^{\infty} x^4 e^{-ax^2} dx$$


$$I^2 = \int_{-\infty}^{\infty} x^4 e^{-ax^2} dx \ \cdot \int_{-\infty}^{\infty} y^4 e^{-ay^2} dx = \int\int_{\mathbb R^2} (xy)^4 e^{-a(x^2 + y^2)} dx \ dy$$

Moving to polar coordinates,

$$I^2 = \int_0^{2\pi} \int_0^\infty r^8 \cos^4\theta\sin^4\theta e^{-ar^2} r \ dr \ d\theta = \int_0^\infty r^9e^{-ar^2} \ dr \ \cdot \ \int_0^{2\pi} \left(\frac{1}{2}\sin2\theta\right)^4 \ d\theta$$

With substitution $u = r^2$, the first integral is $\frac{4!}{2a^5}$. As $\sin^4 2\theta = \frac{1}{8} ( -4\cos4\theta + \cos 8\theta + 3)$, in the second integral the first two terms vanish over the domain of integration $[0,2\pi]$ and

$$I^2 = \frac{4!}{2a^5} \cdot \frac{1}{2^4} \frac{3}{8} 2\pi = \frac{9\pi}{16a^5}$$

Hence, as $I$ is positive,

$$I = \frac{3\sqrt \pi}{4a^{5/2}}$$

Returning to the OP,

Is this trick a one-hit wonder, or are there other cases where this trick works and is also necessary?

this integral can be evaluated other ways. But I thought it was a nice extension of this method.


You must log in to answer this question.