TOPICS
Search

Erf


Erf

erf(z) is the "error function" encountered in integrating the normal distribution (which is a normalized form of the Gaussian function). It is an entire function defined by

 erf(z)=2/(sqrt(pi))int_0^ze^(-t^2)dt.
(1)

Note that some authors (e.g., Whittaker and Watson 1990, p. 341) define erf(z) without the leading factor of 2/sqrt(pi).

Erf is implemented in the Wolfram Language as Erf[z]. A two-argument form giving erf(z_1)-erf(z_0) is also implemented as Erf[z0, z1].

Erf satisfies the identities

erf(z)=1-erfc(z)
(2)
=(2z)/(sqrt(pi))_1F_1(1/2;3/2;-z^2)
(3)
=(2ze^(-z^2))/(sqrt(pi))_1F_1(1;3/2;z^2),
(4)

where erfc(z) is the complementary error function, and _1F_1(a;b;z) is a confluent hypergeometric function of the first kind. For z>0,

 erf(z)=pi^(-1/2)gamma(1/2,z^2),
(5)

where gamma(a,x) is the incomplete gamma function.

Erf can also be defined as a Maclaurin series

erf(z)=2/(sqrt(pi))sum_(n=0)^(infty)((-1)^nz^(2n+1))/(n!(2n+1))
(6)
=2/(sqrt(pi))(z-1/3z^3+1/(10)z^5-1/(42)z^7+1/(216)z^9+...)
(7)

(OEIS A007680). Similarly,

 erf^2(z)=4/pi(z^2-2/3z^4+(14)/(45)z^6-4/(35)z^8+(166)/(4725)z^(10)+...)
(8)

(OEIS A103979 and A103980).

For x<<1, erf(x) may be computed from

erf(x)=1/(sqrt(pi))e^(-x^2)sum_(n=0)^(infty)(2^(n+1)x^(2n+1))/((2n+1)!!)
(9)
=2/(sqrt(pi))e^(-x^2)[x+(2x^3)/(1·3)+(4x^5)/(1·3·5)+...]
(10)

(OEIS A000079 and A001147; Acton 1990).

For x>>1,

erf(x)=2/(sqrt(pi))(int_0^inftye^(-t^2)dt-int_x^inftye^(-t^2)dt)
(11)
=1-2/(sqrt(pi))int_x^inftye^(-t^2)dt.
(12)

Using integration by parts gives

int_x^inftye^(-t^2)dt=-1/2int_x^infty1/td(e^(-t^2))
(13)
=-1/2[(e^(-t^2))/t]_x^infty-1/2int_x^infty(e^(-t^2)dt)/(t^2)
(14)
=(e^(-x^2))/(2x)+1/4int_x^infty1/(t^3)d(e^(-t^2))
(15)
∼(e^(-x^2))/(2x)-(e^(-x^2))/(4x^3)+...,
(16)

so

 erf(x)∼1-(e^(-x^2))/(sqrt(pi)x)(1-1/(2x^2)+...)
(17)

and continuing the procedure gives the asymptotic series

erf(x)∼1-(e^(-x^2))/(sqrt(pi))sum_(n=0)^(infty)((-1)^n(2n-1)!!)/(2^n)x^(-(2n+1))
(18)
∼1-(e^(-x^2))/(sqrt(pi))(x^(-1)-1/2x^(-3)+3/4x^(-5)-(15)/8x^(-7)
(19)
 +(105)/(16)x^(-9)+...)
(20)

(OEIS A001147 and A000079).

Erf has the values

erf(0)=0
(21)
erf(infty)=1.
(22)

It is an odd function

 erf(-z)=-erf(z),
(23)

and satisfies

 erf(z)+erfc(z)=1.
(24)

Erf may be expressed in terms of a confluent hypergeometric function of the first kind M as

erf(z)=(2z)/(sqrt(pi))M(1/2,3/2,-z^2)
(25)
=(2z)/(sqrt(pi))e^(-z^2)M(1,3/2,z^2).
(26)

For a positive integer n, its nth derivative is

 (d^n)/(dz^n)erf(z)=(-1)^(n-1)2/(sqrt(pi))H_(n-1)(z)e^(-z^2),
(27)

where H_n is a Hermite polynomial. The first derivative is

 d/(dz)erf(z)=2/(sqrt(pi))e^(-z^2),
(28)

and the integral is

 interf(z)dz=zerf(z)+(e^(-z^2))/(sqrt(pi)).
(29)
ErfReIm
ErfContours

Erf can also be extended to the complex plane, as illustrated above.

An integral involving erf is given by

 int_0^pe^(-x^2)erf(p-x)dx=1/2sqrt(pi)[erf(1/2sqrt(2)p)]^2
(30)

(M. R. D'Orsogna, pers. comm., May 9, 2004). More complicated integrals, for real a and p,y>0, include

int_0^infty(e^(-(p+x)y))/(pi(p+x))sin(asqrt(x))dx=-sinh(asqrt(p))+(e^(-asqrt(p)))/2erf(a/(2sqrt(y))-sqrt(py))+(e^(asqrt(p)))/2erf(a/(2sqrt(y))+sqrt(py))
(31)
int_0^infty(sqrt(x)e^(-(p+x)y))/(pi(p+x))cos(asqrt(x))dx=(e^(-[py+a^2/(4y)]))/(sqrt(piy))+sqrt(p)[-cosh(asqrt(p))-(e^(-asqrt(p)))/2erf(a/(2sqrt(y))-sqrt(py))+(e^(asqrt(p)))/2erf(a/(2sqrt(y))+sqrt(py))]
(32)

(M. R. D'Orsogna, pers. comm., Dec. 15, 2005).

For x>0, erf has the continued fraction

int_0^xe^(-t^2)dt=1/2sqrt(pi)erf(x)
(33)
=1/2sqrt(pi)-(1/2e^(-x^2))/(x+1/(2x+2/(x+3/(2x+4/(x+...)))))
(34)

(Wall 1948, p. 357), first stated by Laplace in 1805 and Legendre in 1826 (Olds 1963, p. 139), proved by Jacobi, and rediscovered by Ramanujan (Watson 1928; Hardy 1999, pp. 8-9).

Definite integrals involving erf(x) include

int_0^inftye^(-px^2)erf(ax)erf(bx)dx=1/(sqrt(pip))tan^(-1)((ab)/(sqrt(p(a^2+b^2+p))))
(35)
int_0^inftyxe^(-px^2)erf(ax)erf(bx)erf(cx)dx=1/(pip)[a/(sqrt(a^2+p))tan^(-1)((bc)/(sqrt((a^2+b^2+c^2+p)(a^2+p))))+b/(sqrt(b^2+p))tan^(-1)((ac)/(sqrt((a^2+b^2+c^2+p)(b^2+p))))+c/(sqrt(c^2+p))tan^(-1)((ab)/(sqrt((a^2+b^2+c^2+p)(c^2+p))))]
(36)
int_0^inftye^(-x)erf(sqrt(x))dx=1/2sqrt(2)
(37)
int_0^inftye^(-x)erf^2(sqrt(x))dx=(2sqrt(2)cot^(-1)(sqrt(2)))/pi
(38)
int_0^inftye^(-x)erf^3(sqrt(x))dx=(3sqrt(2)cot^(-1)(2sqrt(2)))/pi.
(39)

The first two of these appear in Prudnikov et al. (1990, p. 123, eqns. 2.8.19.8 and 2.8.19.11), with Re[p]>0, |arg(a)|,|argb|,|argc|<pi/4.

A complex generalization of erf(x) is defined as

w(z)=e^(-z^2)erfc(-iz)
(40)
=e^(-z^2)(1+(2i)/(sqrt(pi))int_0^ze^(t^2)dt).
(41)

Integral representations valid only in the upper half-plane Im[z]>0 are given by

w(z)=i/piint_(-infty)^infty(e^(-t^2))/(z-t)dt
(42)
=(2iz)/piint_0^infty(e^(-t^2))/(z^2-t^2)dt.
(43)

See also

Dawson's Integral, Erfc, Erfi, Error Function, Fresnel Integrals, Gaussian Function, Gaussian Integral, Inverse Erf, Normal Distribution Function, Probability Integral Explore this topic in the MathWorld classroom

Related Wolfram sites

https://functions.wolfram.com/GammaBetaErf/Erf/, https://functions.wolfram.com/GammaBetaErf/Erf2/

Explore with Wolfram|Alpha

References

Abramowitz, M. and Stegun, I. A. (Eds.). "Error Function and Fresnel Integrals." Ch. 7 in Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 297-309, 1972.Acton, F. S. Numerical Methods That Work, 2nd printing. Washington, DC: Math. Assoc. Amer., p. 16, 1990.Arfken, G. Mathematical Methods for Physicists, 3rd ed. Orlando, FL: Academic Press, pp. 568-569, 1985.Hardy, G. H. Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work, 3rd ed. New York: Chelsea, 1999.Havil, J. Gamma: Exploring Euler's Constant. Princeton, NJ: Princeton University Press, p. 105, 2003.Olds, C. D. Continued Fractions. New York: Random House, 1963.Prudnikov, A. P.; Brychkov, Yu. A.; and Marichev, O. I. Integrals and Series, Vol. 2: Special Functions. New York: Gordon and Breach, 1990.Sloane, N. J. A. Sequences A000079/M1129, A001147/M3002, A007680/M2861, A103979, A103980 in "The On-Line Encyclopedia of Integer Sequences."Spanier, J. and Oldham, K. B. "The Error Function erf(x) and Its Complement erfc(x)." Ch. 40 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 385-393, 1987.Wall, H. S. Analytic Theory of Continued Fractions. New York: Chelsea, 1948.Watson, G. N. "Theorems Stated by Ramanujan (IV): Theorems on Approximate Integration and Summation of Series." J. London Math. Soc. 3, 282-289, 1928.Whittaker, E. T. and Robinson, G. "The Error Function." §92 in The Calculus of Observations: A Treatise on Numerical Mathematics, 4th ed. New York: Dover, pp. 179-182, 1967.Whittaker, E. T. and Watson, G. N. A Course in Modern Analysis, 4th ed. Cambridge, England: Cambridge University Press, 1990.

Referenced on Wolfram|Alpha

Erf

Cite this as:

Weisstein, Eric W. "Erf." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Erf.html

Subject classifications