<s>[INST] Series expansion of integral Consider the function $I(y)=\int_0^\infty e^{-\sqrt{x^2+y^2}} \mathrm{d} x$. I'd like to see the leading order term of $I(y)$ about $y=0$, so I expand the integrand:
$$
e^{-\sqrt{x^2+y^2}}=e^{-x}-e^{-x}\frac{1}{2x}y^2+e^{-x}\frac{1+x}{8x^3}y^4+\dots
$$
However, only the integral of the $0^\mathrm{th}$ order term converges (to $1$ of course). How would one proceed here to find the second order term (or higher)?
 [/INST] Let $I(y)$ be the integral of interest given by
$$\begin{align}
I(y)&=\int_0^\infty e^{-\sqrt{x^2+y^2}}\,dx\\\\
&=\int_0^{|y|} e^{-\sqrt{x^2+y^2}}\,dx+\int_{|y|}^\infty e^{-\sqrt{x^2+y^2}}\,dx \tag 1
\end{align}$$

For the first integral on the right-hand side of $(1)$, we note that $\sqrt{x^2+y^2}\le \sqrt{2}|y|$.  Therefore, inasmuch as we are developing an asymptotic series for "small" $|y|$, we can write
$$\begin{align}
\int_0^{|y|} e^{-\sqrt{x^2+y^2}}\,dx&=\sum_{n=0}^\infty \frac{(-1)^n}{n!}\int_0^{|y|}\left(x^2+y^2\right)^{n/2}\,dx\\\\
&=\sum_{n=0}^\infty \frac{(-1)^n|y|^{n+1}}{n!}\int_0^{\pi/4}\sec^{n+2}\theta \,d\theta\\\\
&=|y|-\left(\frac{\sqrt 2 +\log\left(1+\sqrt 2\right)}{2}\right)|y|^2+\frac23 |y|^3+O\left(|y|^4\right) \tag 2
\end{align}$$

To facilitate evaluation of the second integral on the right-hand side of $(1)$, we expand the exponential as 
$$\begin{align}
e^{-\sqrt{x^2+y^2}}&=e^{-x}-\frac12 y^2\frac{e^{-x}}{x}+\frac18 y^4\frac{(x+1)e^{-x}}{x^3}+O\left(y^6\right)\\\\
&=e^{-x}-\frac12 y^2\frac{e^{-x}}{x}+\frac18 y^4\frac{e^{-x}}{x^2}+\frac18 y^4\frac{e^{-x}}{x^3}+O\left(y^6\right) \tag 3\\\\
\end{align}$$

Next, we write the integral of the first term on the right-hand side of $(3)$ as 
$$\begin{align}
\int_{|y|}^\infty e^{-x}\,dx&=e^{-|y|}\\\\
&=\sum_{n=0}\frac{(-1)^n|y|^n}{n!}\\\\
&=1-|y|+\frac12 |y|^2-\frac16 |y|^3+O\left(|y|^4\right) \tag 4
\end{align}$$

We write the integral of the second term is
$$\begin{align}
-\frac12 |y|^2\,\int_{|y|}^\infty \frac{e^{-x}}x\,dx&=-\frac12 |y|^2\,\left(\int_{|y|}^1 \frac{e^{-x}}x\,dx+\int_1^\infty \frac{e^{-x}}x\,dx\right)\\\\
&=\frac12 \log (|y|)\,|y|^2-\frac12 \left(\int_1^\infty \frac{e^{-x}}x\,dx-\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n\,n!}\right)\,|y|^2-\frac12 \sum_{n=1}^\infty \frac{(-1)^{n-1}|y|^{n+2}}{n\,n!}\\\\
&=\frac12 \log (|y|)\,|y|^2+\frac12 \gamma\,|y|^2-\frac12 \sum_{n=1}^\infty \frac{(-1)^{n-1}|y|^{n+2}}{n\,n!}\\\\
&=\frac12 \log (|y|)\,|y|^2+\frac12 \gamma\,|y|^2-\frac12 |y|^3+O\left(|y|^4\right) \tag 5
\end{align}$$

Using integration by parts, we find the third integral on the right-hand side of $(3)$ as
$$\begin{align}
\frac18 |y|^4\,\int_{|y|}^\infty \frac{e^{-x}}{x^2}\,dx&=\frac18 |y|^4\left(\frac{e^{-|y|}}{|y|}\right)-\frac18 |y|^4\,\int_{|y|}^\infty \frac{e^{-x}}{x}\,dx\\\\
&=\frac18 e^{-|y|}|y|^3+\log (|y|)|y|^4+\frac18 \gamma |y|^4-\frac18 \sum_{n=1}^\infty \frac{(-1)^{n-1}|y|^{n+4}}{n\,n!}\\\\
&=\frac18 |y|^3+O\left(\log(|y|)\,|y|^4\right) \tag 6
\end{align}$$

Using integration by parts twice, we find the fourth integral on the right-hand side of $(3)$ as
$$\frac18\,|y|^4\int_{|y|}^\infty \frac{e^{-x}}{x^3}\,dx=-\frac1{16}|y|^2-\frac18|y|^3+O\left(\log(|y|)\,|y|^4\right)\tag 7$$

Putting together results from $(2)$ and $(4)-(7)$, we obtain so far 
$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty e^{-(x^2+y^2)}\,dx=1+\left(\frac{\log(|y|)+\gamma -\log(1+\sqrt 2)-(1-\sqrt 2)}{2}\right)\,y^2+O(y^4)}\tag 8$$
IMPORTANT NOTE:
In $(3)$, we have omitted terms beyond $\frac18 y^4\frac{e^{-x}}{x^3}$.  These terms will have a component that is of order $|y|^2$ and as such, the expansion in $(8)$ as written, is not correct.  
However, the expansion is correct up to order $\log(|y|)\,|y|^2$.  On way to complete the expansion up to order $|y|^2$ is to use the Faa di Bruno Formula to write the full expansion of $(3)$.
</s>