I want to calculate the following integral $$\int_{x_1+\ldots+x_n \geq a} \exp\left[ -\pi \left(x_1^2+\ldots+x_n^2 \right)\right] dx_1\cdots dx_n, $$ as a function of $a$, in possibly the shortest and the easiest way. I need such result in a paper in mathematical psychology and I would like to avoid writing a dedicated appendix.

I know how to find the solution. However, I believe there is a simpler solution (eg. a clever change of variables, or a trick with differentiation). Do you know one?

My solution:


$$I(n,a,b) = \int_{x_1+\ldots+x_n \geq a} \exp\left[ -\pi \left(b x_1^2+\ldots+x_n^2 \right)\right] dx_1\cdots dx_n$$ After change of variables $t = x_1+\ldots+x_n$ we obtain $$I(n,a,b) = \int_{-\infty}^{\infty}\cdots \int_{-\infty}^{\infty} \int_{a}^{\infty} \exp\left[ -\pi \left(b (t-x_2-\ldots-x_n)^2+\ldots+x_n^2 \right)\right] dt dx_2\cdots dx_n.$$ After integrating out $x_n$ we arrive at $$I(n,a,b)=\tfrac{1}{\sqrt{1+b}}I(n-1,a,\tfrac{b}{1+b}).$$ Then $$I(n,a,1) = \tfrac{1}{\sqrt{2}} I(n-1,a,\tfrac{1}{2}) = \ldots = \tfrac{1}{\sqrt{k}} I(n-k+1,a,\tfrac{1}{k}) = \ldots = \tfrac{1}{\sqrt{n}} I(1,a,\tfrac{1}{n}).$$ Consequently, we get the solution $$I(n,a,1) = \int_{a}^\infty \frac{1}{\sqrt{n}} \exp \left[ -\pi \frac{1}{n} t^2\right]dt = \int_{a/\sqrt{n}}^\infty \exp \left[ -\pi t^2\right]dt,$$ which is related to the error function (Erf).


Let $X_k$ denote i.i.d. centered Gaussian random variables with variance $v=1/(2\pi)$. Then your integral is $I_n(a)=P(X_1+\cdots+X_n\ge a)$ and $X_1+\cdots+X_n$ is centered Gaussian with variance $nv$ hence $I_n(a)=P(\sqrt{nv}X\ge a)$ where $X$ is standard Gaussian.

Finally, $a/\sqrt{nv}=a\sqrt{2\pi/n}$ hence $I_n(a)=P(X\ge a\sqrt{2\pi/n})=1-\Phi(a\sqrt{2\pi/n})$.

Second solution If one wants to hide the Gaussian random variables, one can prove this formula recursively over $n$. Starting from $$ I_{n+1}(a)=\int\limits_{-\infty}^{+\infty} I_n(a-x)\mathrm{e}^{-\pi x^2}\mathrm{d}x, $$ and assuming that $$ \partial_aI_n(a)=-\frac{a}{\sqrt{n}}\mathrm{e}^{-\pi a^2/n}, $$ one gets $$ \partial_aI_{n+1}(a)=-\frac{a}{\sqrt{n}}\int\limits_{-\infty}^{+\infty} \mathrm{e}^{-\pi (a-x)^2/n}\mathrm{e}^{-\pi x^2}\mathrm{d}x, $$ hence $$ \partial_aI_{n+1}(a)=-\frac{a}{\sqrt{n}}\mathrm{e}^{-\pi a^2/(n+1)}\int\limits_{-\infty}^{+\infty} \mathrm{e}^{-\pi (x-a/(n+1))^2(n+1)/n}\mathrm{d}x. $$ The last integral being $$ \int\limits_{-\infty}^{+\infty} \mathrm{e}^{-\pi x^2(n+1)/n}\mathrm{d}x=\sqrt{\frac{n}{n+1}}, $$ this proves the result.


The function you are integrating is spherically symmetric, since it depends on $x_1,\ldots,x_n$ only through the sum of their squares. Consequently you can rotate about the origin without changing the form of the function at all. So let the new coordinate system have coordinates $w_1,\ldots,w_n$. Let the $w_1$ axis point in a direction at right angles to the hyperplane $x_1,\ldots,x_n$, so the $w_2,\ldots,w_n$ space is parallel to that hyperplane. Then the integral becomes $$ \int_{w_1\ge\text{something}} \exp(-\pi(w_1^2+\cdots+w_n^2) \; dw_1\cdots dw_n. $$ So you can split it into $$ \int_{w_1\ge\text{something}} \exp(-\pi w_1^2)\;dw_1 \cdot \int_{-\infty}^\infty \exp(-\pi w_2^2)\;dw_2 \cdots \int_{-\infty}^\infty \exp(-\pi w_n^2)\;dw_n. $$ The last $n-1$ integrals are all the same and their value is well-known. The first one is the probability that a normal random variable is greater than "something", and you need to figure out the variance (that's easy). And "something" is the distance from the origin to the hyperplane $x_1+\cdots+x_n = a$, i.e. from the origin to $(a/n,\ldots,a/n)$.

  • $\begingroup$ Or perhaps the distance from the origin to $(a/n,\dots,a/n)$. $\endgroup$ – robjohn Sep 1 '11 at 17:18
  • $\begingroup$ Haste makes waste..... I've corrected it. $\endgroup$ – Michael Hardy Sep 1 '11 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.