Is it possible to evaluate this integral in closed form?
$$I(a)=\int_0^\infty \frac{e^{-x^2}}{1+a \cos x}dx$$
$$0<a<1$$
I encountered this integral when trying to find a closed form for the series from this question.
Denominator doesn't have any zeroes on the real line, however it does have complex zeroes. I'm not sure how to use residues here, because the usual methods involve either a polynomial in the denominator with infinite limits, or trigonometric functions but with limits $\pm \pi/2$. Which is not the case here.
Another way would be to expand the denominator as the Taylor series, but I don't know the closed form for $\int_0^\infty e^{-x^2} \cos^k x dx$ much less the resulting series.
The function under the integral is even, so the limits can be extended to $\pm \infty$.

First I intoduce the auxiliary integral:$$\int_0^{2\pi}\frac{\cos(nx)}{1+a \cos(x)}~dx=\frac{2\pi(-1)^n \alpha ^n}{\sqrt{1-a^2}}$$ where $\alpha=\frac1a-\sqrt{\frac1a^2-1}$ and $n\in\mathbb{Z}$.
Proof. $\triangleright$ $$ \begin{align} \int_0^{2\pi}\frac{\cos(nx)}{1+a \cos(x)}~dx&=\Re\int_0^{2\pi}\frac{e^{nix}}{1+a \cos(x)}~dx=\left[ \begin{matrix} z=e^{ix}\\ \cos x=\frac12\left(z+\frac1z\right)\\ dx=\frac{dz}{iz} \end{matrix} \right]\\ &=\Re\int_{|z|=1}\frac{z^n}{1+\frac a2\left(z+\frac1z\right)}\frac{dz}{iz} =\Re\int_{|z|=1}\frac{-2iz^n}{az^2+2z+a}~dz\\ &=\Re\left(2\pi i\operatorname*{Res}_{z=-\frac1a+\sqrt{\frac1a^2-1}}\frac{-2iz^n}{az^2+2z+a}\right)=\frac{2\pi(-1)^n \alpha ^n}{\sqrt{1-a^2}} \end{align}$$ where $\alpha=\frac1a-\sqrt{\frac1a^2-1}$ $\triangleleft$.
Finally let's crack the initial integral
$$\begin{align} I=\int_0^{+\infty}\frac{e^{-x^2}}{1+a\cos x}~dx&=\frac12\int_{-\infty}^{+\infty}\frac{e^{-x^2}}{1+a\cos x}~dx\\ &=\frac12\sum_{n=-\infty}^{+\infty}\int_{2\pi n}^{2\pi+2\pi n}\frac{e^{-x^2}}{1+a\cos x}~dx\\ &=\frac12\sum_{n=-\infty}^{+\infty}\int_{0}^{2\pi}\frac{e^{-(x+2\pi n)^2}}{1+a\cos (x+2\pi n)}~dx\\ &=\frac12\sum_{n=-\infty}^{+\infty}\int_{0}^{2\pi}\frac{e^{-x^2-2\pi n x-4\pi^2n^2}}{1+a\cos x}~dx\\ &=\frac12\int_0^{2\pi}\frac{e^{-x^2}\sum_{n=-\infty}^{+\infty}e^{-2\pi n x-4\pi^2n^2}}{1+a\cos x}~dx \end{align}$$
Next I will use the result of this. After some transforms we get (note that there is a little typo in the question: in the second parameter of theta function the denominator should be equal to $\alpha$ but not $2\alpha$)
$$ I=\frac1{4\sqrt{\pi}}\int_0^{2\pi}\frac{\vartheta_3\left(\frac x2,e^{-\frac14}\right)}{1+a\cos x}~dx $$ where $\vartheta_3(u,q)$ is one of Jacobi theta functions. I'd like to note that this result impressed me a lot because of it quite simple form.
Well, let's continue. It's known that theta function could be expressed as a sum: $\vartheta_3(u,q)=1+2\sum_{n=1}^\infty q^{n^2}\cos(2 n u)$. Thus
$$\begin{align} I&=\frac1{4\sqrt{\pi}}\int_0^{2\pi}\frac{1+2\sum_{n=1}^\infty e^{-\frac14 n^2}\cos(n x)}{1+a\cos x}~dx\\ &=\frac1{4\sqrt{\pi}} \left( \int_0^{2\pi}\frac{dx}{1+a\cos x}+2\sum_{n=1}^\infty e^{-\frac14 n^2}\int_0^{2\pi}\frac{\cos(nx)}{1+a \cos(x)}~dx \right)\\ &=\frac1{4\sqrt{\pi}} \left( \frac{2\pi}{\sqrt{1-a^2}}+2\sum_{n=1}^\infty e^{-\frac14 n^2}\frac{2\pi(-1)^n \alpha ^n}{\sqrt{1-a^2}} \right)\\ &=\frac12\sqrt{\frac\pi{1-a^2}}\left(1+2\sum_{n=1}^\infty (-1)^n e^{-\frac{n^2}4}\alpha^n\right) \end{align}$$
where $\alpha=\frac1a-\sqrt{\frac1a^2-1}$.
I tried to find closed form of this infinite sum using theta functions but haven't succeeded so far.