TITLE: How to integrate $\int_{-\infty}^\infty e^{- \frac{1}{2} ax^2 } x^{2n}dx$
QUESTION [8 upvotes]: 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.
Hints please? :)

REPLY [5 votes]: 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}}$$