Error and Complementary Error Functions

M.M. Yovanovich

ERFERFC.MWS

Error and complementary error functions.

These important special functions are defined as [Maple Math] and [Maple Math] .

Maple can handle these two special functions which appear in solutions of the one-dimensional diffusion equation [Maple Math] in a half-space [Maple Math] . These functions are solutions of the second-order ordinary differential equation [Maple Math] .

Some characteristics and properties are presented in this worksheet.

> restart:

Plots of erf(z) and erfc(z).

> plot({erf(z), erfc(z)}, z = 0..3);

[Maple Plot]

Some values of erf(z) and erfc(z) in the range z = 0 to 2.

> [seq(evalf(erf(z/10)), z = 0..20)];

[Maple Math]
[Maple Math]
[Maple Math]

> [seq(evalf(erfc(z/10)), z = 0..20)];

[Maple Math]
[Maple Math]
[Maple Math]

Relationship between erf(z) and erfc(z).

> simplify(erf(z) + erfc(z));

[Maple Math]

Derivatives of erf(z) and erfc(z).

> diff(erf(z), z);

[Maple Math]

> diff(erfc(z), z);

[Maple Math]

Integrals of erf(z) and erfc(z).

> int(erf(z), z);

[Maple Math]

> int(erfc(z), z);

[Maple Math]

Series expansions of erf(z) and erfc(z).

> series(erf(z), z, 9);

[Maple Math]

> series(erfc(z), z, 9);

[Maple Math]

Erf(z) and erfc(z) satisfy a second-order ODE.

> y1:= erf(z); y2:= erfc(z);

[Maple Math]

[Maple Math]

> diff(y1, z$2) + 2*z*diff(y1, z);

[Maple Math]

> diff(y2, z$2) + 2*z*diff(y2, z);

[Maple Math]

Solution of second-order ODE.

> ode:= diff(y(z), z$2) + 2*z*diff(y(z),z) = 0;

[Maple Math]

> solode:= dsolve(ode, y(z));

[Maple Math]

Complex argument.

> z1:= 2 + I*2: evalf([erf(z1), erfc(z1)]);

[Maple Math]

Polynomial approximation of erf(w) with maximum absolute error less than 2.5e-5.

> restart:

> erfapp:= 1-(t*(a1 + t*(a2 + a3*t)))*exp(-w^2);

[Maple Math]

> t:= 1/(1 + p*w);

[Maple Math]

> coefs:=
(p = 0.47047,
a1 = 0.3480242,
a2 = -0.0958798,
a3 = 0.7478556);

[Maple Math]

> erfapp:= subs(coefs, erfapp);

[Maple Math]

> evalf(subs(w = 0.5, erfapp)); erf(0.5);

[Maple Math]

[Maple Math]

The polynomial approximation provides acceptable accuracy for engineering applications.