2.3 The Error Function
The gamma and beta functions were reached by asking which integrals extend the factorial and the binomial coefficient. The error function arises from a different and more immediate question: the integral of the Gaussian has no elementary antiderivative, and yet it must be evaluated constantly.
Definition 2.3.1 (Error function). \[\operatorname {erf}(x) = \frac {2}{\sqrt {\pi }}\int ^{x}_{0}e^{-t^{2}}\,dt, \qquad \operatorname {erfc}(x) = 1-\operatorname {erf}(x) = \frac {2}{\sqrt {\pi }}\int ^{\infty }_{x}e^{-t^{2}}\,dt .\] The second is the complementary error function.
The normalising factor \(2/\sqrt {\pi }\) is chosen so that \(\operatorname {erf}(\infty )=1\), which is Theorem 2.1.4 — the evaluation \(\Gamma (1/2)=\sqrt {\pi }\) — in another guise.
Theorem 2.3.2 (Elementary properties).
- (i)
- \(\operatorname {erf}\) is odd: \(\operatorname {erf}(-x) = -\operatorname {erf}(x)\);
- (ii)
- \(\operatorname {erf}(0)=0\) and \(\operatorname {erf}(\pm \infty )=\pm 1\);
- (iii)
- \(\dfrac {d}{dx}\operatorname {erf}(x) = \dfrac {2}{\sqrt {\pi }}e^{-x^{2}}\);
- (iv)
- \(\displaystyle \operatorname {erf}(x) = \frac {2}{\sqrt {\pi }}\sum ^{\infty }_{n=0}\frac {(-1)^{n}x^{2n+1}}{n!\,(2n+1)}\), convergent for all \(x\).
Proof. (i) and (iii) are immediate from the definition, the integrand being even. For (ii), \(\operatorname {erf}(\infty )=\frac {2}{\sqrt {\pi }}\cdot \frac {\sqrt {\pi }}{2}=1\) using \(\int ^{\infty }_{0}e^{-t^{2}}dt=\tfrac 12\Gamma (1/2)\). For (iv), expand \(e^{-t^{2}}=\sum (-1)^{n}t^{2n}/n!\) and integrate term by term, which is permitted because the series converges uniformly on any bounded interval. □
Note 2.3.3. The relation to the normal distribution is the reason this function matters here. If \(Z\sim N(0,1)\) then \[P(Z\leq z) = \Phi (z) = \frac {1}{2}\left [1+\operatorname {erf}\!\left (\frac {z}{\sqrt 2}\right )\right ],\] so every normal probability is an error function value and conversely. The factor \(\sqrt 2\) is the only thing separating the two, and it exists because \(\operatorname {erf}\) is defined with \(e^{-t^{2}}\) while the standard normal density carries \(e^{-t^{2}/2}\). This is the same split of convention met in the probabilists’ and physicists’ Hermite polynomials of Section 3.6, and for the same reason.
Theorem 2.3.4 (Relation to the incomplete gamma function). \[\operatorname {erf}(x) = \frac {1}{\sqrt {\pi }}\,\gamma \!\left (\tfrac 12,\,x^{2}\right ),\] where \(\gamma \) is the lower incomplete gamma function of Section 2.4.
Proof. Substitute \(u=t^{2}\) in the defining integral, so \(dt = \tfrac 12 u^{-1/2}du\) and \[\operatorname {erf}(x)=\frac {2}{\sqrt \pi }\int ^{x^{2}}_{0}e^{-u}\,\tfrac 12 u^{-1/2}\,du =\frac {1}{\sqrt \pi }\int ^{x^{2}}_{0}u^{-1/2}e^{-u}\,du,\] which is the definition of \(\gamma \left (\tfrac 12,x^{2}\right )\) divided by \(\sqrt {\pi }\). □
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.