I'm using Gauss-Hermite quadrature to integrate
$ \int_{-\infty}^{\infty} \! e^{-x^2} \cos x\,\mathrm{d}x $
The exact solution is evidently $\sqrt{\pi\,\text{exp}(1/4)}$, but to be honest I don't even understand what this value is supposed to represent. How is $\cos x$ from ($-\infty,\infty$) a small, finite number? I've written code to apply the weights and abscissas for $2\text{ to } 16$ points, but the numbers I've gotten do not approach the true value and do not even converge on anything as I increase the number of points.
Would appreciate any guidance.