Error Function and Complementary Error Function: Properties, Integrals, and Approximations, Exercises of Mathematical Physics

An in-depth analysis of the error function and complementary error function, including their historical perspective, theoretical background, and various representations. It also covers the derivatives of these functions, their relations, and selected values. Furthermore, it discusses numerical computation methods and provides examples of integral evaluations using power series, asymptotic series, and polynomial approximations.

Typology: Exercises

2021/2022

Uploaded on 09/27/2022

danmarino
danmarino 🇺🇸

4.2

(11)

267 documents

1 / 44

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Error and Complementary Error Functions
Reading Problems
Outline
Background ................................................................... 2
Definitions .....................................................................4
Theory .........................................................................6
Gaussian function .......................................................6
Error function ...........................................................8
Complementary Error function .......................................10
Relations and Selected Values of Error Functions ........................12
Numerical Computation of Error Functions .............................. 19
Rationale Approximations of Error Functions ............................21
Assigned Problems .......................................................... 23
References ....................................................................27
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c

Partial preview of the text

Download Error Function and Complementary Error Function: Properties, Integrals, and Approximations and more Exercises Mathematical Physics in PDF only on Docsity!

Error and Complementary Error Functions

Reading Problems

  • Background Outline
  • Definitions
  • Theory
    • Gaussian function
    • Error function
    • Complementary Error function
  • Relations and Selected Values of Error Functions
  • Numerical Computation of Error Functions
  • Rationale Approximations of Error Functions
  • Assigned Problems
  • References

Background

The error function and the complementary error function are important special functions which appear in the solutions of diffusion problems in heat, mass and momentum transfer, probability theory, the theory of errors and various branches of mathematical physics. It is interesting to note that there is a direct connection between the error function and the Gaussian function and the normalized Gaussian function that we know as the “bell curve”. The Gaussian function is given as

G(x) = Ae−x

(^2) /(2σ (^2) )

where σ is the standard deviation and A is a constant.

The Gaussian function can be normalized so that the accumulated area under the curve is unity, i.e. the integral from −∞ to +∞ equals 1. If we note that the definite integral

−∞

e−ax

2 dx =

π a

then the normalized Gaussian function takes the form

G(x) =

2 πσ

e−x^2 /(2σ^2 )

If we let

t^2 =

x^2 2 σ^2

and dt =

2 σ

dx

then the normalized Gaussian integrated between −x and +x can be written as

∫ (^) x

−x

G(x) dx =

π

∫ (^) x

−x

e−t^2 dt

or recognizing that the normalized Gaussian is symmetric about the y−axis, we can write

Definitions

1. Gaussian Function

The normalized Gaussian curve represents the probability distribution with standard distribution σ and mean μ relative to the average of a random distribution.

G(x) =

2 πσ

e−(x−μ)^2 /(2σ^2 )

This is the curve we typically refer to as the “bell curve” where the mean is zero and the standard distribution is unity.

2. Error Function

The error function equals twice the integral of a normalized Gaussian function between 0 and x/σ

y = erf x =

π

∫ (^) x

0

e−t

2 dt for x ≥ 0 , y [0, 1]

where

t =

x √ 2 σ

3. Complementary Error Function

The complementary error function equals one minus the error function

1 − y = erfc x = 1 − erf x =

π

x

e−t

2 dt for x ≥ 0 , y [0, 1]

4. Inverse Error Function

x = inerf y

inerf y exists for y in the range − 1 < y < 1 and is an odd function of y with a Maclaurin expansion of the form

inverf y =

∑^ ∞

n=

cn y^2 n−^1

5. Inverse Complementary Error Function

x = inerfc (1 − y)

x

NHxL

Figure 2.2: Plot of the Normalized Gaussian Function

Gaussian distributions have many convenient properties, so random variates with unknown distributions are often assumed to be Gaussian, especially in physics, astronomy and various aspects of engineering. Many common attributes such as test scores, height, etc., follow roughly Gaussian distributions, with few members at the high and low ends and many in the middle.

Computer Algebra Systems

Function Maple Mathematica

Probability Density Function statevalfpdf,dist PDF[dist, x ]

  • frequency of occurrence at x

Cumulative Distribution Function statevalfcdf,dist CDF[dist, x ]

  • integral of probability density function up to x dist = normald[μ, σ] dist = NormalDistribution[μ, σ] μ = 0 (mean) μ = 0 (mean) σ = 1 (std. dev.) σ = 1 (std. dev.)

Potential Applications

  1. Statistical Averaging:

Error Function

The error function is obtained by integrating the normalized Gaussian distribution.

erf x =

π

∫ (^) x

0

e−t

2 dt (1.4)

where the coefficient in front of the integral normalizes erf (∞) = 1. A plot of erf x over the range − 3 ≤ x ≤ 3 is shown as follows.

x

erf

Hx

L

Figure 2.3: Plot of the Error Function

The error function is defined for all values of x and is considered an odd function in x since erf x = −erf (−x).

The error function can be conveniently expressed in terms of other functions and series as follows:

erf x =

π

γ

, x^2

2 x √ π

M

, −x^2

2 x √ π

e−x

2 M

, x^2

π

∑^ ∞

n=

(−1)nx^2 n+ n!(2n + 1)

where γ(·) is the incomplete gamma function, M(·) is the confluent hypergeometric function of the first kind and the series solution is a Maclaurin series.

complementary Error Function

The complementary error function is defined as

erfc x = 1 − erf x

π

x

e−t

2 dt (1.8)

x

erf

Hx

L

Figure 2.4: Plot of the complementary Error Function

and similar to the error function, the complementary error function can be written in terms of the incomplete gamma functions as follows:

erfc x =

π

, x^2

As shown in Figure 2.5, the superposition of the error function and the complementary error function when the argument is greater than zero produces a constant value of unity.

Potential Applications

  1. Diffusion: In a similar manner to the transient conduction problem described for the error function, the complementary error function is used in the solution of the diffusion equation when the boundary conditions are constant surface heat flux, where qs = q 0

T (x, t) − Ti =

2 q 0 (αt/π)^1 /^2 k

exp

−x^2 4 αt

q 0 x k

erfc

x 2

αt

0 0.5 1 1.5 2 2.5 3 x

0.

0.

0.

0.

1

erf

Hx

L

Erf x + Erfc x

Erf x

Erfc x

Figure 2.5: Superposition of the Error and complementary Error Functions

and surface convection, where −k

∂T

∂x

x=

= h[T∞ − T (0, t)]

T (x, t) − Ti

T∞ − Ti

= erfc

x 2

αt

[

exp

hx k

h^2 αt k^2

)] [

erfc

x 2

αt

h

αt k

)]

Approximations

Power Series for Small x (x < 2)

Since

erf x =

π

∫ (^) x

0

e−t^2 dt =

π

∫ (^) x

0

∑^ ∞

n=

(−1)nt^2 n n!

dt (1.10)

and the series is uniformly convergent, it may be integrated term by term. Therefore

erf x =

π

∑^ ∞

n=

(−1)nx^2 n+ (2n + 1)n!

π

x 1 · 0!

x^3 3 · 1!

x^5 5 · 2!

x^7 7 · 3!

x^9 9 · 4!

Asymptotic Expansion for Large x (x > 2)

Since

erfc x =

π

x

e−t

2 dt =

π

x

t

e−t

2 t dt

we can integrate by parts by letting

u =

t

dv = e−t^2 d dt

du = −t−^2 dt v = −

e−t^2

therefore

x

t

e−t

2 t dt =

[

uv

]∞

x

x

v du =

[

2 t

e−t

2

]∞

x

x

e−t^2 t^2

dt

Thus

erfc x =

π

2 x

e−x

2 −

x

e−t^2 t^2

dt

Repeating the process n times yields

√ π 2

erfc x =

e−x

2

x

2 x^3

22 x^5

− · · · + (−1)n−^1

1 · 3 · · · (2n − 3) 2 n−^1 x^2 n−^1

+(−1)n^

1 · 3 · · · (2n − 1) 2 n

x

e−t^2 t^2 n^

dt (1.14)

Finally we can write

πxex

2 erfc x = 1 +

∑^ ∞

n=

(−1)n^

1 · 3 · 5 · · · (2n − 1) (2x^2 )n^

This series does not converge, since the ratio of the nth^ term to the (n−1)th^ does not remain less than unity as n increases. However, if we take n terms of the series, the remainder,

1 · 3 · · · (2n − 1) 2 n

x

e−t^2 t^2 n^

dt

is less than the nth^ term because

x

e−t^2 t^2 n^

dt < e−x^2 <

0

dt t^2 n

We can therefore stop at any term taking the sum of the terms up to this term as an approximation of the function. The error will be less in absolute value than the last term retained in the sum. Thus for large x, erfc x may be computed numerically from the asymptotic expansion.

√ πxex

2 erfc x = 1 +

∑^ ∞

n=

(−1)n^

1 · 3 · 5 · · · (2n − 1) (2x^2 )n

2 x^2

(2x^2 )^2

(2x^2 )^3

Repeated Integrals of the Complementary Error Function

inerfc x =

x

in−^1 erfc t dt n = 0, 1 , 2 ,... (1.26)

where

i−^1 erfc x =

π

e−x^2 (1.27)

i^0 erfc x = erfc x (1.28)

i^1 erfc x = ierfc x =

x

erfc t dt

π

exp(−x^2 ) − x erfc x (1.29)

i^2 erfc x =

x

i erfc t dt

[

(1 + 2x^2 ) erfc x −

π

x exp(−x^2 )

]

[erfc x − 2 x · ierfc x] (1.30)

The general recurrence formula is

2 nin^ erfc x = in−^2 erfc x − 2 xin−^1 erfc x (n = 1, 2 , 3 ,.. .) (1.31)

Therefore the value at x = 0 is

inerfc 0 −

2 n^ Γ

n 2

) (^) (n = − 1 , 0 , 1 , 2 , 3 ,.. .) (1.32)

It can be shown that y = in^ erfc x is the solution of the differential equation

d^2 y dx^2

  • 2x

dy dx

− 2 ny = 0 (1.33)

The general solution of

y′′^ + 2xy′^ − 2 ny = 0 − ∞ ≤ x ≤ ∞ (1.34)

is of the form

y = Ainerfc x + Binerfc (−x) (1.35)

Derivatives of Repeated Integrals of the Complementary Error

Function

d dx

[inerfc x] = (−1)n−^1 erfc x (n = 0, 1 , 2 , 3.. .) (1.36)

dn dxn

[

ex

2 erfc x

]

= (−1)n 2 nn!ex

2 inerfc x (n = 0, 1 , 2 , 3.. .) (1.37)

Numerical Computation of Error Functions

The power series form of the error function is not recommended for numerical computations when the argument approaches and exceeds the value x = 2 because the large alternat- ing terms may cause cancellation, and because the general term is awkward to compute recursively. The function can, however, be expressed as a confluent hypergeometric series.

erf x =

π

x e−x

2 M

, x^2

in which all terms are positive, and no cancellation can occur. If we write

erf x = b

∑^ ∞

n=

an 0 ≤ x ≤ 2 (1.52)

with

b =

2 x √ π

e−x

2 a 0 = 1 an =

x^2 (2n + 1)/ 2

an− 1 n ≥ 1

then erf x can be computed very accurately (e.g. with an absolute error less that 10 −^9 ). Numerical experiments show that this series can be used to compute erf x up to x = 5 to the required accuracy; however, the time required for the computation of erf x is much greater due to the large number of terms which have to be summed. For x ≥ 2 an alternate method that is considerably faster is recommended which is based upon the asymptotic expansion of the complementary error function.

erfc x =

π

x

e−t

2 dt

e−x^2 √ πx

2 Fo

x^2

x → ∞ (1.53)

which cannot be used to obtain arbitrarily accurate values for any x. An expression that converges for all x > 0 is obtained by converting the asymptotic expansion into a continued fraction

πex^2 erfc x =

x +

x +

x +

x +

x +

x +...

x > 0 (1.54)

which for convenience will be written as

erfc x =

e−x^2 √ π

x+

x+

x+

x+

x+

x > 0 (1.55)

It can be demonstrated experimentally that for x ≥ 2 the 16th approximant gives erfc x with an absolute error less that 10 −^9. Thus we can write

erfc x =

e−x^2 √ π

x+

x+

x+

x+

x

x ≥ 2 (1.56)

Using a fixed number of approximants has the advantage that the continued fraction can be evaluated rapidly beginning with the last term and working upward to the first term.