Definite integral involving an error function Let $$\mathrm{erf}(x) = \frac{2}{\sqrt{\pi}}\int\limits_{0}^x e^{-t^2}dt$$ be the error function. Then, I have tow questions.


*

*For a positive integer $n$, is there a close-form solution of 
$f_n=\int_{0}^\infty 1- (\mathrm{erf}(x))^n dx$?

*Is there a positive $c<\infty$ such that $\lim\limits_{n\to\infty}\frac{f_n}{\sqrt{\log n}} =c$.
Mathematica returns $1/\sqrt{\pi}$ when $n=1$ and $\sqrt{2/\pi}$ when $n=2$.
 A: Let $\Delta^{n}$ be a portion of the unit $n$-sphere $S^n$ defined by
$$ \Delta^n = \{ \omega \in S^n : 0 < \omega_1 < \cdots < \omega_n < \tfrac{1}{\sqrt{2}} \omega_{n+1} \}. \tag{1} $$
Then it is not hard to check that for $n \geq 2$, 
$$ f_n = 2^{n-\frac{5}{2}} \pi^{-n/2} n! \left( \tfrac{n-3}{2} \right)! \operatorname{Vol}(\Delta^{n-2}). $$
(Here, we use the convention that $\Delta^0$ is a single point and thus $\operatorname{Vol}(\Delta^0) = 1$.) This allows to compute $f_n$ for certain $n$'s:


*

*When $n = 2$, we immediately have
$$ f_2 = \sqrt{\frac{2}{\pi}}. $$

*When $n = 3$, then $\Delta^1$ is a portion of the unit circle with arc length $\arctan(1/\sqrt{2})$. So we have
$$ f_3 = \frac{6\sqrt{2}}{\pi^{3/2}} \arctan(1/\sqrt{2}). $$

*When $n = 4$, it is not hard to check that $\Delta^2$ is a spherical triangle with angles $\frac{\pi}{4}$, $\frac{\pi}{2}$ and $\arctan \sqrt{2}$. Consequently the area of $\Delta^2$ is $\frac{\pi}{4} - \arctan(1/\sqrt{2})$, which is equal to $\frac{1}{2}\arctan(1/\sqrt{8})$. So we have
$$ f_4 = \frac{12\sqrt{2}}{\pi^{3/2}} \arctan(1/\sqrt{8}). $$
I am not sure about $n =5$, but it probably requires some well-established theory on orthoschemes to compute the volume of $\Delta^3$. So I will stop here.
Instead, let us investiguate the asymptotic behavior of $f_n$.

Intuition. Let $X_1, X_2, \cdots$ be i.i.d. such that the common CDF $F_X$ is given by $\mathrm{erf}$. (In particular, $X_i$ are a.s. non-negative.) Let $M_n = \max\{X_1, \cdots, X_n\}$. Then
$$ \Bbb{P}(M_n > x) = 1 - \Bbb{P}(M_n \leq x) = 1 - F_X(x)^n = 1 - \operatorname{erf}(x)^n. $$
Consequently we have
$$ f_n = \int_{0}^{\infty} (1 - \operatorname{erf}(x)^n) \, dx
= \Bbb{E}M_n. $$
In general, $M_n$ has roughly the same asymptotics as the last $n$-quantile of the distribution of $X$. In other words, if $x_n$ is chosen so that $F_X(x_n) = 1 - n^{-1}$ then $M_n$ and $x_n$ has roughly the same order. But in our case, it is not hard to show that $x_n \sim (\log n)^{1/2}$. Thus we expect that $f_n \sim (\log n)^{1/2}$.

Solution. Apply the substitution $x \mapsto x \sqrt{\log n}$ to write
$$ \frac{f_n}{\sqrt{\log n}} = \int_{0}^{\infty} (1 - \operatorname{erf}(x \sqrt{\log n})^n ) \, dx. $$
In order to facilitate this identity, we first make the following simple observation:

Lemma. We have $\operatorname{erf}(x) = 1 - \frac{1 + o(1)}{x\sqrt{\pi}} e^{-x^2} $ as $x \to \infty$.

Indeed, this is a direct consequence of the L'Hospital's rule. Now fix any $R > 1$. By the lemma, there exists a sufficiently large $N = N(R)$ such that for $x \geq R$ and $n \geq N$ we have a uniform estimate
$$ 1 - \operatorname{erf}(x \sqrt{\log n})^n
\leq n \operatorname{erf}(x \sqrt{\log n})
\leq \frac{C}{x \sqrt{\log n}} n^{1-x^2}
\leq \frac{C}{x\sqrt{\log n}} N^{1 - x^2} $$
for some constant $C = C(R) > 0$. Thus it follows that
$$ 0 \leq \int_{R}^{\infty} (1 - \operatorname{erf}(x \sqrt{\log n})^n) \, dx
\leq \frac{C}{\sqrt{\log n}} \int_{R}^{\infty} \frac{N^{1 - x^2}}{x} \, dx \xrightarrow{n\to\infty} 0. $$
On the other hand, for any fixed $x > 0$ we have
$$ \operatorname{erf}(x \sqrt{\log n})^n
= \left(1 - \frac{1+o(1)}{x\sqrt{\pi \log n}} n^{-x^2} \right)^n \xrightarrow{n\to\infty} \begin{cases}
0, & x < 1 \\
1, & x \geq 1.
\end{cases} $$
Thus by the bounded convergence theorem, we have
$$ \int_{0}^{R} (1 - \operatorname{erf}(x \sqrt{\log n})^n) \, dx \xrightarrow{n\to\infty} 1. $$
Therefore we have
$$ \lim_{n\to\infty} \frac{f_n}{\sqrt{\log n}} = 1. $$
A: Here is a partial answer: For $n=3$ and $n=4$, closed-form solutions exist, according to Ng and 
Geller (A Table of Integrals of the Error Function.  II. Additions and Corrections, Journal of Research of the National Bureau of Standards, Vol. 75B, 1971, pp. 149-163; 
see $\S3.7$, Eqs. 21 and 22, p. 158),
$$f_3={6\over\pi}\sqrt{2\over\pi}\tan^{-1}(2^{-1/2})$$ and $$f_4={12\over\pi}\sqrt{2\over\pi}\tan^{-1}(8^{-1/2})\,.$$
I verified Ng and Geller's expressions via Mathematica's numerical integration routine, NIntegrate.  I don't quite see the derivation yet, but I'll try to generalize to other values of $n$.
