THE ERROR FUNCTION

9. THE ERROR FUNCTION

You will meet this function in probability theory (Chapter 15, Section 8), and consequently in statistical mechanics and other applications of probability theory. You have probably heard of “grading on a curve.” The “curve” means the bell-

shaped graph of y = e −x 2 (see Problem 1); the error function is the area under part of this curve. We define the error function as

erf(x) = √

e −t 2 dt.

Although this is the usual definition of erf(x), there are other closely related inte- grals which are used and sometimes referred to as the error function. Consequently, you need to look carefully at the definition in the reference you are using (text, tables, computer). Here are some integrals you may find and their relation to (9.1) (see Problem 2).

The standard normal or Gaussian cumulative distribution function Φ(x) [see Chapter 15, equation (8.5)]:

√ (9.2a)

Φ(x) = √

e −t 2 /2 dt = 1 + 1 2 erf(x/

e −t 2 /2 dt = 1 erf(x/

The complementary error function:

(9.3a) 2 erfc(x) = √ e −t dt = 1 − erf(x),

(9.3b) 2 erfc √ = e −t /2 dt.

We can also use (9.2) to write erf(x) in terms of the standard normal cumulative distribution function [Chapter 15, equation (8.5)].

erf(x) = 2Φ(x

548 Special Functions Chapter 11

We next consider several useful facts about the error function. You can easily prove that the error function is odd; that is, erf(−x) = − erf(x) (Problem 3). We show that erf(∞) = 1 as follows:

by (5.2) and (5.3). For very small values of x, erf(x) can be approximated by ex- −t panding e 2 in a power series and integrating term by term. We get

e −t 2 2 dt = 2 √

erf(x) = √

3 5 · 2! [Use this when |x| ≪ 1. Compare (10.4).]

For large x, say x > 3, erf(x) differs from erf(∞) = 1 [see (9.5)] by less than

10 −4 (and of course even less for larger x). We are then usually interested in

1 − erf(x) = erfc(x). This is best approximated by an asymptotic series; we shall discuss such expansions in Section 10. The function erfi(x), called the imaginary error function, is similar to the error function but with a positive exponential. We define

erfi(x) = √

e t 2 dt.

You can show (Problem 5) that erf(ix) = i erfi(x). The Fresnel integrals (Chapter 1, Section 15) are related to the error function (Problem 6). Also see Section 10, Problem 3 for other relations involving error functions.

PROBLEMS, SECTION 9

1. Sketch or computer plot a graph of the function y = e −x 2 . 2. Verify equations (9.2), (9.3), and (9.4). Hint: In (9.2a), you want to write Φ(x) √

in terms of an error function. Make the change of variable t = u 2 in the Φ(x) √ integral. Warning: Don’t forget to adjust the limits; when t = x, u = x/ 2.

3. Prove that erf(x) is an odd function of x. Hint: Put t = −s in (9.1).

4. Show that

e −y /2 dy = 2π

(a) by using (9.5) and (9.2a); (b)

by reducing it to a Γ function and using (5.3). 5. Replace x by ix in (9.1) and let t = iu to show that erf(ix) = i erfi(x), where erfi(x)

is defined in (9.7).

Section 10 Asymptotic Series 549

6. Assuming that x is real, show the following relation between the error function and the Fresnel integrals.

= (1 − i) 2 (cos u + i sin u 2 ) du.

Hint: In (9.1), make the change of variables t = 1−i √ u.