Improper integral of an even power of $x$ times $e^{-x^2}$ In Donald McQuarrie’s Mathematical Methods for Scientists and Engineers, he has a problem I would like to assign to my class, but I am having trouble solving it. It states

Show that
$$\int_0^\infty e^{-x^2} \cos\alpha x \,dx = \frac{\sqrt{\pi}}{2} e^{-\alpha^2/4},$$
by expanding $\cos\alpha x$ in a Maclaurin series and integrating term by term.

Doing as suggested, you get
$$
\int_0^\infty e^{-x^2} \left( 1 - \frac{\alpha^2}{2!} x^2 + \frac{\alpha^4}{4!} x^4 + \dots \right)dx.
$$
I know that the first integral is $\sqrt{\pi}/2$ and that the remaining integrals can be evaluated using the following result from a table of integrals that I have
$$
\int_0^\infty x^{2n} e^{-x^2} dx = \frac{1 \cdot 3 \cdot 5 \dots (2n-1) }{2^{n+1}} \sqrt{\pi}.
$$
Doing this, I can complete the problem, the issue is that I do not know how to evaluate the above integral to obtain the result I found in the table of integrals.
Can anyone point me in the right direction?

As @Quanto already pointed out the Feynman method, let me add a more direct approach using integration by parts:
$$\int_0^{\infty} x^{2n}e^{-x^2} \, \mathrm{d}x = \int_0^{\infty} x^{2n-1} \cdot xe^{-x^2} \, \mathrm{d}x = -\frac{1}{2}x^{2n-1}e^{-x^2}\Big|_0^{\infty} + \frac{2n-1}{2}\int_0^{\infty} x^{2n-2}e^{-x^2} \, \mathrm{d}x.$$
The first summand vanishes; the formula thus follows by induction.
