Erf

Author

Eric W. Weisstein
August 25, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/SpecialFunctions/Erf.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Erf.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

Plots

<<Utilities`Plot`

Real Axis

PlotDiscontinuous[Erf[x],{x,-5,5},
HorizontalAsymptotes->{-1,1},
AxesLabel->TraditionalForm/@{x,Erf[x]}
]

Complex Plane

ComplexPlot3D[Erf[z],{z,-2,2}]//Timing

ComplexContourPlot[Erf[z],{z,-2,2}]//Timing

Continued Fraction

Integrate[Exp[-t^2],{t,0,a}]

cf=1;
Do[
cf=a (Mod[i,2]+1)+i/cf,
{i,22,2,-1}];
cf=1/(2a+ 1/cf)

Table[(Sqrt[Pi]/2-Exp[-a^2] cf /.a->#)/(Erf[#]Sqrt[Pi]/2) &[t],{t,1.,2,.1}]

ContinuedFractionK[n,If[Mod[n,2]==1,2,1]x,{n,2}]

(1/(2x+(2/(x+(3/(2x+4))))))

(1/2)(Sqrt[π])-(((1/2)Exp[-x^2])/(x+(1/(2x+(2/(x+(3/(2x+(4/(x+(5/(2x+6))))))))))))/.x->.5

With[{x=.5},1-Exp[-x^2](π^(-1/2))/(x+ContinuedFractionK[n,If[Mod[n,2]==1,2,1]x,{n,60}])]

Erf[1/2.]

1-Exp[-x^2](π^(-1/2))/(x+ContinuedFractionK[n,If[Mod[n,2]==1,2,1]x,{n,∞}])

Erfc

FullSimplify[Erf[x]+Erfc[x]]

Special Values

Erf[0]

Erf[1/2]

With[{x=1/2},(2/(Sqrt[π]))Sum[(((((-1))^n)(x^(2n+1)))/(n!(2n+1))),{n,0,∞}]]

With[{x=1/2},(2/(Sqrt[π]))Exp[-(x^2)]x Sum[((2^n)/((2n+1)!!))(x^(2n)),{n,0,∞}]]

With[{x=1/2},Sum[((2 Sin[((n π)/2)])/(n (Sqrt[π]) Gamma[((1+n)/2)]))(x^n),{n,1,∞,2}]]

With[{x=1/2},(π^(-1/2))Gamma[1/2,0,x^2]]

FunctionExpand[%]//Simplify

(π^(-1/2))(Gamma[1/2]-Gamma[1/2,1/4])

FullSimplify[%]

With[{z=1/2},((2z)/(Sqrt[π]))Hypergeometric1F1[1/2,3/2,-z^2]]

Erf[1]

Erf[∞]

Series

erf(x) about 0

Series[Erf[x],{x,0,20}]Sqrt[π]/2

Series[Erf[x]((Sqrt[π])/2)Exp[(x^2)]x,{x,0,20}]

V5

<<DiscreteMath`RSolve`

SeriesTerm[Erf[x]((Sqrt[π])/2)Exp[(x^2)]x,{x,0,n}]

V7

SeriesCoefficient[Erf[x],{x,0,n}]

FullSimplify[%,Mod[n,2]==1]

((erf(x))^2) about 0

Series[Erf[x]^2,{x,0,10}]π/4

erf(x) about ∞

ser=Series[Exp[x^2](Sqrt[π])x(1-Erf[x]),{x,∞,20}]

Normal[CoefficientList[ser,(1/x)^2]]

Through[{Numerator,Denominator}[%]]

Table[(((((-1))^n)(2n-1)!!)/(2^n)),{n,0,5}]

1-((Exp[-x^2])/((Sqrt[π])x))Sum[(((((-1))^n)(2n-1)!!)/(2^n))((((1/x)))^(2n)),{n,0,∞}]

Sums

(2/(Sqrt[π])) (∑_(n=0)^∞)(((((-1))^n) (z^(2 n+1)))/((2 n+1) n!))==erf(x)

(2/(Sqrt[π]))Sum[(((((-1))^n)(z^(2n+1)))/(n!(2n+1))),{n,0,∞}]

(2/(Sqrt[π])) x exp(-(x^2)) (∑_(n=0)^∞)(((2^n) (x^(2 n)))/((2 n+1)!!))==erf(x)

V6

(2/(Sqrt[π]))Exp[-(x^2)]x Sum[((2^n)/((2n+1)!!))(x^(2n)),{n,0,∞}]

V7

(2/(Sqrt[π]))Exp[-(x^2)]x Sum[((2^n)/((2n+1)!!))(x^(2n)),{n,0,∞}]

With[{x=.1},(2/(Sqrt[π]))Exp[-(x^2)]x NSum[((2^n)/((2n+1)!!))(x^(2n)),{n,0,∞}]]

Erf[.1]

(x/2)Table[((2^(n+1))/((2n+1)!!))(x^(2n)),{n,0,4}]

Series[((Erf[x])/((2/(Sqrt[π]))Exp[-(x^2)])),{x,0,7}]

(Sqrt[(2/π)]) exp(-(x^2)) (∑_(n=0)^∞)(((((Sqrt[2]) x))^(2 n+1))/((2 n+1)!!))==erf(x)

(Sqrt[(2/π)])Exp[-(x^2)] Sum[(((((Sqrt[2])x))^(2n+1))/((2n+1)!!)),{n,0,∞}]

((Exp[-x^2])/(Sqrt[π]))Sum[((((2x))^(2n+1))/((2n+1)!)),{n,0,∞}]

((Exp[-x^2])/(Sqrt[π]))Sum[((((2x))^(2n+1))/((2n+1)!!)),{n,0,∞}]

Sum[(((2 (i^(n-1))) (x^n))/((Sqrt[π]) n ((n-1)/2)!)),{n,1,∞,2}]==erf(x)

Sum[((2 (I^(-1+n)))/(n (Sqrt[π]) ((1/2) (-1+n))!))(x^n),{n,1,∞,2}]

Sum[(((x^n) (2 sin(((π n)/2))))/((Sqrt[π]) n Γ(((n+1)/2)))),{n,1,∞,2}]==erf(x)

Sum[((2 Sin[((n π)/2)])/(n (Sqrt[π]) Gamma[((1+n)/2)]))(x^n),{n,1,∞,2}]

1-((exp(-(x^2)))/((Sqrt[π]) x))(∑_(n=0)^∞)((((((-1))^n) (2 n-1)!!) ((((1/x)))^(2 n)))/(2^n))==?

SumConvergence[(((((-1))^n)(2n-1)!!)/(2^n))((((1/x)))^(2n)),n]

1-((Exp[-x^2])/((Sqrt[π])x))Sum[(((((-1))^n)(2n-1)!!)/(2^n))((((1/x)))^(2n)),{n,0,∞}]

With[{x=100.},1-((Exp[-x^2])/((Sqrt[π])x))Sum[(((((-1))^n)(2n-1)!!)/(2^n))((((1/x)))^(2n)),{n,0,1000}]]//N

With[{x=10.},Sum[(((((-1))^n)(2n-1)!!)/(2^n))((((1/x)))^(2n)),{n,0,1000}]]//N

Identities

((Γ((1/2),0,(z^2)))/(Sqrt[π]))

FullSimplify[FunctionExpand[Gamma[1/2,0,z^2]]/Sqrt[π]]

Simplify[%,z>0]

((2 z (Subscript[, 1])(Subscript[F, 1])((1/2);(3/2);-(z^2)))/(Sqrt[π]))

Simplify[2/Sqrt[π]z Hypergeometric1F1[1/2,3/2,-z^2]]

((2 z (e^(-(z^2))) (Subscript[, 1])(Subscript[F, 1])(1;(3/2);(z^2)))/(Sqrt[π]))

Simplify[2/Sqrt[π]z Exp[-z^2]Hypergeometric1F1[1,3/2,z^2]]

Integrals

Definite

(∫_0^∞)(e^(-p (x^2))) erf(b x) erf(c x)dx==(1/(Sqrt[π p]))(tan^(-1))(((b c)/(Sqrt[p ((b^2)+(c^2)+p)])))

Subtract@@@Table[
With[{
b=Random[Integer,{0,10}],c=Random[Integer,{0,10}],
p=Random[Integer,{1,10}]
},
{NIntegrate[Exp[-p x^2]Erf[b x]Erf[c x],{x,0,∞},WorkingPrecision->20],
(1/(Sqrt[π p]))ArcTan[((b c)/(Sqrt[p((b^2)+(c^2)+p)]))]//N
}
],{20}]//Chop//Union

(∫_0^∞)x (e^(-p (x^2))) erf(a x) erf(b x) erf(c x)dx==(1/(π p))((a/(Sqrt[(a^2)+p]))(tan^(-1))(((b c)/(Sqrt[((a^2)+(b^2)+(c^2)+p)((a^2)+p)])))+(b/(Sqrt[(b^2)+p]))(tan^(-1))(((c a)/(Sqrt[((a^2)+(b^2)+(c^2)+p)((b^2)+p)])))+(c/(Sqrt[(c^2)+p]))(tan^(-1))(((a b)/(Sqrt[((a^2)+(b^2)+(c^2)+p)((c^2)+p)]))))

Worth a shot... ;)

Subtract@@@Table[
With[{
a=Random[Integer,{0,10}],
b=Random[Integer,{0,10}],
c=Random[Integer,{0,10}],
p=Random[Integer,{1,10}]
},
{NIntegrate[x Exp[-p x^2]Erf[a x]Erf[b x]Erf[c x],{x,0,∞},WorkingPrecision->20],
(1/(π p))((a/(Sqrt[(a^2)+p]))ArcTan[((b c)/(Sqrt[((a^2)+(b^2)+(c^2)+p)((a^2)+p)]))]+(b/(Sqrt[(b^2)+p]))ArcTan[((c a)/(Sqrt[((a^2)+(b^2)+(c^2)+p)((b^2)+p)]))]+(c/(Sqrt[(c^2)+p]))ArcTan[((a b)/(Sqrt[((a^2)+(b^2)+(c^2)+p)((c^2)+p)]))])//N
}
],{5}]//Chop//Union//Timing

(∫_(-∞)^∞)(e^(-(x^2))) erf(a+b x)dx

v5.2

Integrate[Exp[-(x^2)]Erf[a+b x],{x,-∞,∞}]//Timing

v6

Integrate[Exp[-(x^2)]Erf[a+b x],{x,-∞,∞}]//Timing

(∫_(-∞)^∞)x (e^(-(x^2))) erf(a+b x)dx

v5.2

Integrate[x Exp[-(x^2)]Erf[a+b x],{x,-∞,∞}]//Timing

v6

Integrate[x Exp[-(x^2)]Erf[a+b x],{x,-∞,∞}]//Timing

(∫_(-∞)^∞)(x^(2n)) (e^(-(x^2))) erf(a+b x)dx

v5.2

Integrate[(x^(2n)) Exp[-(x^2)]Erf[a+b x],{x,-∞,∞}]//Timing

v6

Integrate[(x^(2n)) Exp[-(x^2)]Erf[a+b x],{x,-∞,∞}]//Timing

Half-Definite

(∫_0^p)(e^(-(x^2))) erf(p-x)dx==(1/2) (Sqrt[π]) ((erf((p/(Sqrt[2]))))^2)

Date: Sun, 9 May 2004 20:36:46 -0700 (PDT)
From: "Maria R. D'Orsogna"

Integrate[Exp[-x^2]Erf[p-x],{x,0,p}]//Timing

Integrate[Exp[-x^2]Erf[p-x],{x,0,p},GenerateConditions->False]//Timing

Subtract@@@Table[
With[{p=Random[Real,{-10,10}]},
{NIntegrate[Exp[-x^2]Erf[p-x],{x,0,p}],(1/2)(Sqrt[π])Erf[p/Sqrt[2]]^2}
],{20}]//Chop//Union

(∫_0^∞)(((e^(-(p+x) y)) sin(a (Sqrt[x])))/(π (p+x)))dx

Maria R. D'Orsogna, Dec. 15, 2005

Integrate[((Exp[-(p+x)y])/(Pi(p+x)))Sin[a(Sqrt[x])],{x,0,∞}]//Timing

Integrate[((Exp[-(p+x)y])/(Pi(p+x)))Sin[a(Sqrt[x])],{x,0,∞},GenerateConditions->False]//Timing

Subtract@@@Table[
With[{p=Random[Real,{0,10},20],y=Random[Real,{0,10},20],a=Random[Real,{-10,10},20]},
{NIntegrate[((Exp[-(p+x)y])/(Pi(p+x)))Sin[a(Sqrt[x])],{x,0,∞}],-Sinh[a(Sqrt[p])]+((Exp[-a(Sqrt[p])])/2)Erf[(a/(2(Sqrt[y])))-(Sqrt[p y])]+((Exp[a (Sqrt[p])])/2)Erf[(a/(2(Sqrt[y])))+(Sqrt[p y])]}
],{20}]//Chop//Union

(∫_0^∞)(((e^(-(p+x) y)) (Sqrt[x]) cos(a (Sqrt[x])))/(π (p+x)))dx

Integrate[((Exp[-(p+x)y])/(Pi(p+x)))(Sqrt[x])Cos[a(Sqrt[x])],{x,0,∞}]//Timing

Integrate[((Exp[-(p+x)y])/(Pi(p+x)))(Sqrt[x])Cos[a(Sqrt[x])],{x,0,∞},GenerateConditions->False]//Timing

Maria R. D'Orsogna, Dec. 15, 2005

Subtract@@@Table[
With[{p=Random[Real,{0,10},30],y=Random[Real,{0,10},30],a=Random[Real,{0,10},30]},
{NIntegrate[((Exp[-(p+x)y])/(Pi(p+x)))(Sqrt[x])Cos[a(Sqrt[x])],{x,0,∞}],((Exp[-(a^2/(4y)+p y)])/(Sqrt[π y]))+Sqrt[p](-Cosh[a(Sqrt[p])]-((Exp[-a(Sqrt[p])])/2)Erf[(a/(2(Sqrt[y])))-(Sqrt[p y])]+((Exp[a (Sqrt[p])])/2)Erf[(a/(2(Sqrt[y])))+(Sqrt[p y])])}
],{20}]//Chop//Union

Indefinite

Integrate[Erf[z],z]

Complex Generalization

w[z_]:=Exp[-(z^2)]Erfc[-I z]

FullSimplify[Subtract@@{w[z],Exp[-(z^2)](1+((2I)/(Sqrt[π]))Integrate[Exp[(t^2)],{t,0,z}])}]

v5.0

(I/π)Integrate[((Exp[-(t^2)])/(z-t)),{t,-∞,∞}]

(I/π)Integrate[((Exp[-(t^2)])/(z-t)),{t,-∞,∞},Assumptions->Im[z]>0]

((2I z)/π)Integrate[((Exp[-(t^2)])/((z^2)-(t^2))),{t,0,∞}]

((2I z)/π)Integrate[((Exp[-(t^2)])/((z^2)-(t^2))),{t,0,∞},Assumptions->Im[z]>0]

v5.1

i1=FullSimplify[(I/π)Integrate[((Exp[-(t^2)])/(z-t)),{t,-∞,∞},Assumptions->Im[z]>0],Im[z]>0]

FullSimplify[Subtract@@{w[z],i1},Im[z]>0]

Table[(π+I Log[-(1/z)]-I Log[(1/z)])/.z->Random[Complex,5{0,(I+1)}],{20}]//Chop//Union

i2=FullSimplify[((2I z)/π)Integrate[((Exp[-(t^2)])/((z^2)-(t^2))),{t,0,∞},Assumptions->Im[z]>0],Im[z]>0]

FullSimplify[Subtract@@{w[z],i2}]