y=erfxy = \operatorname{erf} x

The Error Function y=erfxy = \operatorname{erf} x

The error function erfx\operatorname{erf} x is a special function defined by integrating the Gaussian1.

erfx=2π0xet2dt\operatorname{erf} x = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\,dt

The factor 2π\dfrac{2}{\sqrt{\pi}} in front is a normalizing constant, chosen so that the value approaches exactly 11 as xx \to \infty. It is fixed by the Gaussian integral 0et2dt=π2\int_0^{\infty} e^{-t^2}\,dt = \dfrac{\sqrt{\pi}}{2}.

Domain and range

  • The domain is all real numbers
  • The range is the open interval (1,1)(-1, 1)
  • It increases monotonically
  • It is an odd function

The integrand et2e^{-t^2} is always positive, so the function increases monotonically.

Symmetry

The integrand is even, so the integral is odd. That is, erf(x)=erf(x)\operatorname{erf}(-x) = -\operatorname{erf}(x), and the graph has point symmetry about the origin.

Monotonicity and slope

By the fundamental theorem of calculus the derivative is the Gaussian itself.

ddxerfx=2πex2\frac{d}{dx}\operatorname{erf} x = \frac{2}{\sqrt{\pi}}\,e^{-x^2}

It is always positive, so the function increases over the whole line. The slope is steepest at the origin, where it is 2π1.128\dfrac{2}{\sqrt{\pi}} \approx 1.128.

How fast it converges

xxerfx\operatorname{erf} x
0.50.50.5205\approx 0.5205
110.8427\approx 0.8427
220.9953\approx 0.9953
330.99998\approx 0.99998

It has two horizontal asymptotes, y=±1y = \pm 1. The tails decay like ex2e^{-x^2}, so the convergence is very fast: by x=3x = 3 the gap to 11 is already below 10510^{-5}.

Inflection point

The second derivative is 4xπex2-\dfrac{4x}{\sqrt{\pi}}\,e^{-x^2}, whose sign changes at x=0x = 0, so the origin is the only inflection point. The curve turns there from concave up to concave down.

Relations to other functions

It is tied to the distribution function Φ(x)\Phi(x) of the standard normal by the following.

Φ(x)=12(1+erfx2)\Phi(x) = \frac{1}{2}\left(1 + \operatorname{erf}\frac{x}{\sqrt{2}}\right)

The 2\sqrt{2} appears because of a difference in the definitions: erf\operatorname{erf} uses et2e^{-t^2} while the normal distribution uses et2/2e^{-t^2/2}. The quantity 1erfx1 - \operatorname{erf} x is called the complementary error function erfcx\operatorname{erfc} x, used when the probability in a tail has to be handled accurately.

Series expansion

erfx=2π(xx33+x510)\operatorname{erf} x = \frac{2}{\sqrt{\pi}}\left(x - \frac{x^3}{3} + \frac{x^5}{10} - \cdots\right)

It converges for every real number, but for large xx the terms swell badly along the way, so practical computation uses an asymptotic expansion or a rational approximation2.

Applications and history

As the name suggests, it grew out of the theory of observational error. Having no expression in elementary functions, it is treated as a special function in its own right.

  • Probability calculations with the normal distribution
  • Solutions of the heat and diffusion equations
  • The evaluation of the error rate of a communication channel
  1. Error function, Wikipedia
  2. Error Functions, Dawson's and Fresnel Integrals, NIST Digital Library of Mathematical Functions