# Gaussian integral using Feynman’s technique

In my last post we evaluated the following definite integral

$\int_0^\infty&space;e^{-x^t}\mathrm{d}x$

This is the formula we got:

$\int_0^\infty&space;e^{-x^t}\mathrm{d}x=\left&space;(\frac{1}{t}&space;\right&space;)!=\Gamma\left&space;(&space;\frac{1}{t}&space;+1\right&space;)$

and this is the integral we want to evaluate:

$\int_{-\infty}^{+\infty}&space;e^{-x^2}\mathrm{d}x$

which is equivalent to

$2\int_{0}^{\infty}&space;e^{-x^2}\mathrm{d}x$

because of symmetry: this is an even function, and since the integral has bounds –a and a, it becomes what I’ve just shown.

Here is the graph:

Since we have the formula, we can simply plug in the 2 and, voilà, we have the answer! We are going to do all of the calculations in a moment, but let’s actually substitute the 2 to see what the result is;

$2\int_0^\infty&space;e^{-x^2}\mathrm{d}x=2\left&space;(\frac{1}{2}&space;\right&space;)!=2\frac{\sqrt\pi}{2}=\sqrt\pi$

If you type 0.5! on Google you’ll get 0.88622692545 , which is the square root of pi. That’s a very beautiful result in my opinion!

But now, let’s actually find the result using Feynman’s technique, or differentiation under the integral sign. I talk about it in this post, where I show how to evaluate the integral from 0 to infinity of sin(x)/x. I am going to use the same approach I used in my previous post, for the generalised form of this integral.

$2\int_0^\infty&space;xe^{-\alpha&space;x^2}\mathrm{d}x$

an u-substitution would be enough; in order to get that extra x we need to write a new function with a parameter so that, when differentiating with respect to that parameter, the x we need will be generated.

We are going to write the integral as follows:

$I(\alpha)=2\int_0^\infty&space;e^{-\alpha&space;x^2}\mathrm{d}x$

this means that

$2\int_0^\infty&space;e^{-x^2}\mathrm{d}x=I(1)$

we will need this later on, but for now, let’s rewrite the parameterized integral:

$I(\alpha)=2\int_0^\infty&space;e^{-\alpha&space;x^2}\mathrm{d}x$

As we saw here, let’s take the derivative with respect to a on both sides:

$\frac{\mathrm{d}&space;}{\mathrm{d}&space;\alpha}I(\alpha)=2\frac{\mathrm{d}&space;}{\mathrm{d}&space;\alpha}\int_0^\infty&space;e^{-\alpha&space;x^2}\mathrm{d}x$

The derivative can be brought inside the integral, but it becomes partial derivative, since it’s the derivative of each term of the sum; it works the same way as a regular derivative though:

$\frac{\mathrm{d}&space;}{\mathrm{d}&space;\alpha}I(\alpha)=2\int_0^\infty\frac{\partial&space;}{\partial&space;\alpha}&space;e^{-\alpha&space;x^2}\mathrm{d}x$ $I'(\alpha)=2\int_0^\infty&space;-x^2e^{-\alpha&space;x^2}\mathrm{d}x$

Now we can perform a u-substitution:

$u=\alpha&space;x^2\,\,\,\,\,\mathrm{d}u=2\alpha&space;x\,\mathrm{d}x&space;\rightarrow&space;\mathrm{d}x=\frac{1}{2\alpha&space;x}\mathrm{d}u$ $I'(\alpha)=-2\int_0^\infty&space;x^2e^{-u}\frac{1}{2\alpha&space;x}\mathrm{d}u$

Don’t forget about the bounds of integration: u=ax², therefore the lower bound is u₁=ax₁²=0 and the upper bound is u₂=ax₂²=infinity. In this case they don’t change, but always remember to do this.

$I'(\alpha)=-\frac{1}{\alpha}\int_0^\infty&space;xe^{-u}\mathrm{d}u$

Since we are integrating with respect to u, we need to write the x in terms of u. We know that u=ax²2, therefore

$u=\alpha&space;x^2\rightarrow&space;x^2=\frac{u}{\alpha}\rightarrow&space;x=\left&space;(&space;\frac{u}{\alpha}&space;\right&space;)^\frac{1}{2}=u^\frac{1}{2}\alpha^{-\frac{1}{2}}$ $\dpi{120}&space;I'(\alpha)=-\alpha^{-1}\int_0^\infty&space;u^\frac{1}{2}\alpha^{-\frac{1}{2}}e^{-u}\mathrm{d}u$ $\dpi{120}&space;I'(\alpha)=-\alpha^{-1}\alpha^{-\frac{1}{2}}\int_0^\infty&space;u^\frac{1}{2}e^{-u}\mathrm{d}u$

This is the gamma function! Hence,

$\dpi{120}&space;I'(\alpha)=-\alpha^{-1-\frac{1}{2}}\Gamma\left&space;(&space;\frac{1}{2}&space;+1\right&space;)$

or

$\dpi{120}&space;I'(\alpha)=-\alpha^{-1-\frac{1}{2}}\left&space;(&space;\frac{1}{2}\right&space;)!$

Now we can take the integral on both sides, since this is I’(a);

$\dpi{120}&space;\int&space;I'(\alpha)\,\mathrm{d}\alpha=\int-\left&space;(&space;\frac{1}{2}\right&space;)!\,\alpha^{-1-\frac{1}{2}}\,\mathrm{d}\alpha$

Let’s apply linearity:

$\dpi{120}&space;I(\alpha)=-\left&space;(&space;\frac{1}{2}\right&space;)!\int\,\alpha^{-1-\frac{1}{2}}\,\mathrm{d}\alpha$

Let’s now apply the power rule:

$\dpi{120}&space;I(\alpha)=-\left&space;(&space;\frac{1}{2}\right&space;)!\frac{\alpha^{-1-\frac{1}{2}+1}}{-1-\frac{1}{2}+1}$ $\dpi{120}&space;I(\alpha)=-\left&space;(&space;\frac{1}{2}\right&space;)!\frac{\alpha^{-\frac{1}{2}}}{-\frac{1}{2}}$ $\dpi{120}&space;I(\alpha)=-\left&space;(&space;\frac{1}{2}\right&space;)!\alpha^{-\frac{1}{2}}\left&space;(&space;-2&space;\right&space;)$ $\dpi{120}&space;I(\alpha)=2\left&space;(&space;\frac{1}{2}\right&space;)!\alpha^{-\frac{1}{2}}+C$

Don’t forget the +C!

Overall, we can write

$\dpi{120}&space;2\int_0^\infty&space;e^{-\alpha&space;x^2}\mathrm{d}x=2\left&space;(&space;\frac{1}{2}\right&space;)!\alpha^{-\frac{1}{2}}+C$

Now, we need to find a number that makes the integral equal to 0 in order to find C; after that we will plug in the 1 that we had at the beginning in the original integral and we will find the answer. When a=infinity, we get e^-infinity, which is equal to 0, and therefore the whole integral:

$\dpi{120}&space;2\int_0^\infty&space;e^{-\infty}\mathrm{d}x=2\left&space;(&space;\frac{1}{2}\right&space;)!\cdot&space;\infty^{-\frac{1}{2}}+C$ $\dpi{120}&space;0=2\left&space;(&space;\frac{1}{2}\right&space;)!\cdot&space;0+C$

When infinity is raised to a negative number, it gives 0; this is why:

$\dpi{120}&space;\infty^{-\frac{1}{n}}=\frac{1}{\infty^n}=\frac{1}{\infty}=0$

Anyway,

$\dpi{120}&space;0=0+C\rightarrow&space;C=0$

Now, if you remember, we know that

$\dpi{120}&space;I(1)=2\int_0^\infty&space;e^{-x^2}\mathrm{d}x$

when a=1; therefore, to find its value, we will plug 1 into this:

$\dpi{120}&space;2\int_0^\infty&space;e^{-\alpha&space;x^2}\mathrm{d}x=2\alpha^{-\frac{1}{2}}\left&space;(&space;\frac{1}{2}&space;\right&space;)!+0$

Hence,

$\dpi{120}&space;2\int_0^\infty&space;e^{-x^2}\mathrm{d}x=2\left&space;(&space;\frac{1}{2}&space;\right&space;)!$

We now know that 0.5!=sqrt(pi)/2, so

$\dpi{120}&space;2\int_0^\infty&space;e^{-x^2}\mathrm{d}x=2\frac{\sqrt\pi}{2}$

Finally,

$\dpi{120}&space;\int_{-\infty}^\infty&space;e^{-x^2}\mathrm{d}x=\sqrt\pi$

And we’re done!

Hope you liked this post, and if you did give it a like and subscribe to stay updated, it would mean so much to me! If you have any doubts, questions, suggestions, leave a comment and I’ll be happy to reply!

Join 31 other followers

This site uses Akismet to reduce spam. Learn how your comment data is processed.