# How to integrate $\int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}dx$

How can I approach this integral? ($0<a \in \mathbb{R}$ and $n \in \mathbb{N}$)

$$\large\int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}\, dx$$

Integration by parts doesn't seem to make it any simpler.

• @Travis it's no crime to put the infinitesimal before the integrand. :D – user76568 Sep 22 '14 at 14:04
• It's true that you'll see that in physics sometimes, especially when the integrand is complicated, but it's rare to the point of unfamiliarity in mathematics. – Travis Willse Sep 22 '14 at 14:06
• You guys are all very smart, but you can't beat Leibniz :) – user76568 Sep 22 '14 at 14:40
• Regarding the differential before integrand: see this question: math.stackexchange.com/questions/387572/… – apnorton Sep 28 '14 at 1:24

Integration by parts does help!

Let's assume $a>0, n\in\mathbb{N}$. Call your integral $I_{2n}$. Then,

\begin{align} I_{2n}&=\int_{-\infty}^\infty e^{-\frac{1}{2}a x^2} x\cdot x^{2n-1} dx=\int_{-\infty}^\infty -\frac{1}{a} \frac{d}{dx}\left(e^{-\frac{1}{2} ax^2}\right) x^{2n-1} dx \\ &= \frac{2n-1}{a} I_{2n-2} \end{align}

Knowing that $I_0=\int_{-\infty}^\infty e^{-\frac{1}{2} ax^2} dx = \sqrt{\frac{2\pi}{a}}$, we get

$$I_{2n}= \frac{(2n-1)!! \sqrt{2\pi}}{a^{n+\frac{1}{2}}}$$

• You didn't give me a chance to try it out with your fast additions to the hint (Just kidding). Thank you! – user76568 Sep 22 '14 at 13:58
• @YourAdHere: Right. Looks better now, I deleted my previous comment. :) – J. J. Sep 22 '14 at 14:11

This way is easier than IBP:

\begin{align} & \hspace{6mm}\int_{-\infty}^\infty e^{- \lambda x^2 } x^{2n} dx \\ &= \int_{-\infty}^\infty (-1)^n \frac{d^n}{d \lambda^n} e^{-\lambda x^2} dx \\ &= (-1)^n \frac{d^n}{d \lambda^n} \int_{-\infty}^\infty e^{-\lambda x^2} dx \end{align}

Since the integrand is even then \begin{align} \int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}\, dx=2\int_{0}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}\, dx \end{align} Using substitution $t=x^2$ we get \begin{align} \int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}\, dx&=2\int_{0}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}\, dx\\ &=\int_{0}^\infty t^{n-\frac{1}{2}}e^{- \frac{1}{2} at } \, dt \end{align} Then using substitution $u=\frac{1}{2} at$ we get \begin{align} \int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}\, dx &=\int_{0}^\infty t^{n-\frac{1}{2}}e^{- \frac{1}{2} at } \, dt\\ &=\int_{0}^\infty \left(\frac{2u}{a}\right)^{n-\frac{1}{2}}e^{- u } \, \frac{2du}{a}\\ &=\left(\frac{2}{a}\right)^{n+\frac{1}{2}}\int_{0}^\infty u^{n-\frac{1}{2}}e^{- u } \, du\\ &=\left(\frac{2}{a}\right)^{n+\frac{1}{2}}\Gamma\left(n+\frac{1}{2}\right) \end{align} where $\Gamma(z)$ is the gamma function.

All hail Leibniz!

It's essentially acting $-2 \frac{d}{da}$, $n$ times, on $\int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } dx = \sqrt{\frac{2 \pi}{a}}$:

$$\int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}dx = \int_{-\infty}^\infty (-2)^n \frac{d^n}{da^n} (e^{- \frac{1}{2}ax^2 })dx = (-2)^n \frac{d^n}{da^n} \int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } dx = (-2)^n \frac{d^n}{da^n} \sqrt{\frac{2 \pi}{a}} = \frac{(2n-1)!!}{a^n} \sqrt{\frac{2 \pi}{a}}$$

By expanding the integral as follows \begin{align} \int_{-\infty}^{\infty} e^{-a x^{2}/2} x^{2n} \, dx &= \int_{-\infty}^{0} e^{-a x^{2}/2} x^{2n} \, dx + \int_{0}^{\infty} e^{-a x^{2}/2} x^{2n} \, dx \\ &= 2 \int_{0}^{\infty} e^{-a x^{2}/2} x^{2n} \, dx \end{align} where the change $x \rightarrow -x$ was made in the first integral. Now make the substitution $u = ax^2/2$ to obtain the integral \begin{align} \int_{-\infty}^{\infty} e^{-a x^{2}/2} x^{2n} \, dx &= \left(\frac{2}{a}\right)^{n+1/2} \, \int_{0}^{\infty} e^{-u} u^{n-1/2} \, du \\ &= \left(\frac{2}{a}\right)^{n+1/2} \, \Gamma\left( n + \frac{1}{2} \right). \end{align}

Let us instead consider the integral $$\int_{-\infty}^\infty e^{-\frac{1}{2} a x^2} e^{t x} \, dx = \sum_{k=0}^\infty \frac{t^k}{k!} \int_{-\infty}^\infty e^{-\frac{1}{2} a x^2} x^k \, dx,$$ so that your integral will be the factor of $\frac{t^{2n}}{(2n)!}$ in the power series.

Now $$\int_{-\infty}^\infty e^{-\frac{1}{2} a x^2 + t x} \, dx = \int_{-\infty}^\infty e^{-\frac{1}{2}a(x - \frac{2}{a} t x)} \, dx = e^{\frac{t^2}{2a}} \int_{-\infty}^\infty e^{-\frac{1}{2} a x^2} \, dx = \frac{\sqrt{2\pi}}{\sqrt{a}} e^{\frac{t^2}{2a}}.$$ Thus the power series is $$\frac{\sqrt{2\pi}}{\sqrt{a}}\left(1 + \frac{t^2}{2a} + \frac{1}{2!} \frac{t^{4}}{(2a)^2} + \frac{1}{3!} \frac{t^{6}}{(2a)^3} + \dots\right),$$ so your integral is $\frac{\sqrt{2\pi} (2n)!}{\sqrt{a} n! (2a)^n}$.

Another non-IBP route: Consider the integral $\int_{-\infty}^\infty e^{-ax^2/2}e^{t x}\,dx$, which can be computed exactly by completing the square in the exponent. Expanding $e^{tx}$ in powers of $t$, we find that the coefficients are essentially just the desired integrals.