Solution (source code)

= Solution

The integrand is an <entire function>, so the defining contour is immaterial. A rectangular contour, closed far to the right where the <Gaussian function> decays, gives the exact horizontal-tail identity
$$
f(z)=\frac{\sqrt\pi}{2}-e^{-z^2}\int_0^\infty e^{-2zs-s^2}\,ds\qquad(\operatorname{Re}z\ge0).
$$
The constant is the half-line <Gaussian integral>. Expand the endpoint amplitude $e^{-s^2}=1-s^2+\cdots$ in this <Watson lemma>. Alternatively, repeated <integration by parts> gives the same expansion, including purely imaginary $z$, because every derivative of $e^{-s^2}$ is integrable on the positive real axis. Thus, on each fixed ray in the stated quadrant,
$$
f(z)=\frac{\sqrt\pi}{2}-\frac{e^{-z^2}}{2z}\left(1-\frac1{2z^2}+O(|z|^{-4})\right).
$$
The remainder is measured on the exponential endpoint scale. When that scale grows, this formula does not resolve terms exponentially small relative to it.

Write $z=re^{i\theta}$. The endpoint term has modulus $e^{-r^2\cos2\theta}/(2r)$. For $0\le\theta<\pi/4$ it is exponentially small, and at $\theta=\pi/4$ it is oscillatory of order $r^{-1}$. For $\pi/4<\theta\le\pi/2$ it dominates the constant. The <quadrant asymptotics of the error function> therefore give the requested leading <asymptotic expansions>
$$
\boxed{f(re^{i\theta})\sim\begin{cases}\sqrt\pi/2,&0\le\theta\le\pi/4,\\-e^{-r^2e^{2i\theta}}/(2re^{i\theta}),&\pi/4<\theta\le\pi/2.\end{cases}}
$$
The boundary ray $\theta=\pi/4$ belongs to the constant-dominated case because of the extra factor $1/r$. On the imaginary axis this gives $f(ir)\sim i e^{r^2}/(2r)$, consistent with $f(ir)=i\int_0^r e^{s^2}ds$. The constant/exponential dominance exchange is an <anti-Stokes line> phenomenon; it should not be confused with dropping the constant everywhere in the quadrant.