<<

CHAPTER 8

THE FUNCTION ( FUNCTION)

The appears occasionally in physical problems such as the normalization of Coulomb wave functions and the computation of in statistical mechanics. In general, however, it has less direct physical application and interpretation than, say, the Legendre and Bessel functions of Chapters 11 and 12. Rather, its importance stems from its usefulness in developing other functions that have direct physical application. The gamma function, therefore, is included here.

8.1 DEFINITIONS,SIMPLE PROPERTIES

At least three different, convenient definitions of the gamma function are in common use. Our first task is to state these definitions, to develop some simple, direct consequences, and to show the equivalence of the three forms.

Infinite Limit (Euler)

The first definition, named after Euler, is

1 2 3 n Ŵ(z) lim · · ··· nz,z0, 1, 2, 3,.... (8.1) ≡ n z(z 1)(z 2) (z n) = − − − →∞ + + ··· + This definition of Ŵ(z) is useful in developing the Weierstrass infinite-product form of Ŵ(z), Eq. (8.16), and in obtaining the derivative of ln Ŵ(z) (Section 8.2). Here and else-

499 500 Chapter 8 Gamma–Factorial Function

where in this chapter z may be either real or complex. Replacing z with z 1, we have + 1 2 3 n z 1 Ŵ(z 1) lim · · ··· n + + = n (z 1)(z 2)(z 3) (z n 1) →∞ + + + ··· + + nz 1 2 3 n lim · · ··· nz = n z n 1 · z(z 1)(z 2) (z n) →∞ + + + + ··· + zŴ(z). (8.2) = This is the basic functional relation for the gamma function. It should be noted that it is a difference equation. It has been shown that the gamma function is one of a general class of functions that do not satisfy any with rational coefficients. Specifically, the gamma function is one of the very few functions of mathematical physics that does not satisfy either the hypergeometric differential equation (Section 13.4) or the confluent hypergeometric equation (Section 13.5). Also, from the definition, 1 2 3 n Ŵ(1) lim · · ··· n 1. (8.3) = n 1 2 3 n(n 1) = →∞ · · ··· + Now, application of Eq. (8.2) gives Ŵ(2) 1, = Ŵ(3) 2Ŵ(2) 2,... (8.4) = = Ŵ(n) 1 2 3 (n 1) (n 1) . = · · ··· − = − ! Definite (Euler)

A second definition, also frequently called the Euler integral, is

∞ t z 1 Ŵ(z) e− t − dt, (z) > 0. (8.5) ≡ ℜ 0 The restriction on z is necessary to avoid divergence of the integral. When the gamma function does appear in physical problems, it is often in this form or some variation, such as

∞ t2 2z 1 Ŵ(z) 2 e− t − dt, (z) > 0. (8.6) = ℜ 0 1 z 1 1 − Ŵ(z) ln dt, (z) > 0. (8.7) = t ℜ 0   When z 1 , Eq. (8.6) is just the Gauss error integral, and we have the interesting result = 2 Ŵ 1 √π. (8.8) 2 = Generalizations of Eq. (8.6), the Gaussian , are considered in Exercise 8.1.11. This definite integral form of Ŵ(z), Eq. (8.5), leads to the , Section 8.4. 8.1 Definitions, Simple Properties 501

To show the equivalence of these two definitions, Eqs. (8.1) and (8.5), consider the function of two variables n n t z 1 F(z,n) 1 t − dt, (z) > 0, (8.9) = − n ℜ 0   with n a positive integer.1 Since n t t lim 1 e− , (8.10) n − n ≡ →∞  from the definition of the exponential

∞ t z 1 lim F(z,n) F(z, ) e− t − dt Ŵ(z) (8.11) n = ∞ = ≡ →∞ 0 by Eq. (8.5). Returning to F(z,n), we evaluate it in successive integrations by parts. For convenience let u t/n. Then = 1 z n z 1 F(z,n) n (1 u) u − du. (8.12) = − 0 Integrating by parts, we obtain z 1 1 F(z,n) n u n n 1 z (1 u) (1 u) − u du. (8.13) nz = − z + z − 0 0  Repeating this with the integrated part vanishing at both endpoints each time, we finally  get 1 z n(n 1) 1 z n 1 F(z,n) n − ··· u + − du = z(z 1) (z n 1) + ··· + − 0 1 2 3 n · · ··· nz. (8.14) = z(z 1)(z 2) (z n) + + ··· + This is identical with the expression on the right side of Eq. (8.1). Hence lim F(z,n) F(z, ) Ŵ(z), (8.15) n →∞ = ∞ ≡ by Eq. (8.1), completing the proof.

Infinite Product (Weierstrass)

The third definition (Weierstrass’ form) is

1 γz ∞ z z/n ze 1 e− , (8.16) Ŵ(z) ≡ + n n 1  #=

1The form of F(z,n)is suggested by the beta function (compare Eq. (8.60)). 502 Chapter 8 Gamma–Factorial Function

where γ is the Euler–Mascheroni constant, γ 0.5772156619 .... (8.17) = This infinite-product form may be used to develop the reflection identity, Eq. (8.23), and applied in the exercises, such as Exercise 8.1.17. This form can be derived from the original definition (Eq. (8.1)) by rewriting it as n 1 1 2 3 n 1 z − Ŵ(z) lim · · ··· nz lim 1 nz. (8.18) = n z(z 1) (z n) = n z + m →∞ →∞ m 1  + ··· + #= Inverting Eq. (8.18) and using z ( ln n)z n− e − , (8.19) = we obtain n 1 ( ln n)z z z lim e − 1 . (8.20) Ŵ(z) = n + m →∞ m 1  #= Multiplying and dividing by 1 1 1 n exp 1 z ez/m, (8.21) + 2 + 3 +···+ n =    m 1 #= we get 1 1 1 1 z lim exp 1 ln n z Ŵ(z) = n + 2 + 3 +···+ n −  →∞    n z z/m lim 1 e− . (8.22) × n + m →∞ m 1   #= As shown in Section 5.2, the parenthesis in the exponent approaches a limit, namely γ ,the Euler–Mascheroni constant. Hence Eq. (8.16) follows. It was shown in Section 5.11 that the Weierstrass infinite-product definition of Ŵ(z) led directly to an important identity, π Ŵ(z)Ŵ(1 z) . (8.23) − = sin zπ Alternatively, we can start from the product of Euler integrals,

∞ z s ∞ z t Ŵ(z 1)Ŵ(1 z) s e− ds t− e− dt + − = 0 0 ∞ z dv ∞ u πz v e− udu , = (v 1)2 = sin πz 0 + 0 transforming from the variables s,t to u s t,v s/t, as suggested by combining the exponentials and the powers in the integrands.= + The Jacobian= is 11 s t (v 1)2 J , 1 s +2 + =− 2 = t = u  t − t        8.1 Definitions, Simple Properties 503

u where (v 1)t u. The integral 0∞ e− udu 1, while that over v may be derived by + = πz = , giving sin πz. This identity may also be derived by contour integration (Example 7.1.6 and Exer- 1 cises 7.1.18 and 7.1.19) and the beta function, Section 8.4. Setting z 2 in Eq. (8.23), we obtain = Ŵ 1 √π (8.24a) 2 = (taking the positive square root), in agreement  with Eq. (8.8). Similarly one can establish Legendre’s duplication formula, 1 2z Ŵ(1 z)Ŵ z 2− √πŴ(2z 1). (8.24b) + + 2 = + The Weierstrass definition shows immediately that Ŵ(z) has simple poles at z 1 = 0, 1, 2, 3,...and that Ŵ(z) − has no poles in the finite , which means that−Ŵ(z)− has− no zeros. This[ behavior] may also be seen in Eq. (8.23), in which we note that π/(sin πz) is never equal to zero. Actually the infinite-product definition of Ŵ(z) may be derived from the Weierstrass 1 factorization theorem with the specification that Ŵ(z) − have simple zeros at z 0, 1, 2, 3,.... The Euler–Mascheroni constant[ is fixed] by requiring Ŵ(1) 1. See= also− the− products− expansions of entire functions in Section 7.1. = In theory the (probability density) is given by

1 α 1 x/β x − e− ,x>0 f(x) βαŴ(α) (8.24c) =  0,x0.  ≤ α 1 The constant β Ŵ(α) − is chosen so that the total (integrated) probability will be unity. [ ] 3 For x E, kinetic energy, α 2 , and β kT , Eq. (8.24c) yields the classical Maxwell– Boltzmann→ . → →

Factorial Notation

So far this discussion has been presented in terms of the classical notation. As pointed out by Jeffreys and others, the 1ofthez 1 exponent in our second definition (Eq. (8.5)) is a continual nuisance. Accordingly,− Eq.− (8.5) is sometimes rewritten as

∞ t z e− t dt z , (z) > 1, (8.25) ≡ ! ℜ − 0 to define a factorial function z . Occasionally we may still encounter Gauss’ notation, (z), for the factorial function: !

& (z) z Ŵ(z 1). (8.26) = != + The Ŵ notation is due to Legendre.# The factorial function of Eq. (8.25) is related to the gamma function by Ŵ(z) (z 1) or Ŵ(z 1) z . (8.27) = − ! + = ! 504 Chapter 8 Gamma–Factorial Function

FIGURE 8.1 The factorial function — extension to negative arguments.

If z n, a positive integer (Eq. (8.4)) shows that = z n 1 2 3 n, (8.28) != != · · ··· the familiar factorial. However, it should be noted that since z is now defined by Eq. (8.25) (or equivalently by Eq. (8.27)) the factorial function is no longer! limited to positive integral values of the argument (Fig. 8.1). The difference relation (Eq. (8.2)) becomes z (z 1) !. (8.29) − != z This shows immediately that 0 1 (8.30) != and n for n, a negative integer. (8.31) !=±∞ In terms of the factorial, Eq. (8.23) becomes πz z ( z) . (8.32) ! − !=sin πz By restricting ourselves to the real values of the argument, we find that Ŵ(x 1) defines the shown in Figs. 8.1 and 8.2. The minimum of the is + Ŵ(x 1) x (0.46163 ...) 0.88560 .... (8.33a) + = != != 8.1 Definitions, Simple Properties 505

FIGURE 8.2 The factorial function and the first two derivatives of ln(Ŵ(x 1)). + Notation

In many problems of mathematical physics, particularly in connection with Legendre poly- nomials (Chapter 12), we encounter products of the odd positive integers and products of the even positive integers. For convenience these are given special labels as double facto- rials: 1 3 5 (2n 1) (2n 1) · · ··· + = + !! (8.33b) 2 4 6 (2n) (2n) . · · ··· = !! Clearly, these are related to the regular factorial functions by (2n 1) (2n) 2nn and (2n 1) + !. (8.33c) !! = ! + !! = 2nn ! We also define ( 1) 1, a special case that does not follow from Eq. (8.33c). − !! = Integral Representation

An integral representation that is useful in developing asymptotic series for the Bessel functions is

z ν 2πiν e− z dz e 1 Ŵ(ν 1), (8.34) = − + where C is the contour shown in Fig. 8.3. This contour integral representation is only useful when ν is not an integer, z 0 then being a . Equation (8.34) may be = 506 Chapter 8 Gamma–Factorial Function

FIGURE 8.3 Factorial function contour.

FIGURE 8.4 The contour of Fig. 8.3 deformed.

readily verified for ν> 1 by deforming the contour as shown in Fig. 8.4. The integral from into the origin yields− (ν ), placing the phase of z at 0. The integral out to (in the fourth∞ quadrant) then yields− e2!πiνν , the phase of z having increased to 2π. Since∞ the circle around the origin contributes nothing! when ν> 1, Eq. (8.34) follows. It is often convenient to cast this result into a more symmetrical− form:

z ν e− ( z) dz 2iŴ(ν 1) sin(νπ). (8.35) − = + C This analysis establishes Eqs. (8.34) and (8.35) for ν> 1. It is relatively simple to extend the range to include all nonintegral ν. First, we note− that the integral exists for ν< 1 as long as we stay away from the origin. Second, integrating by parts we find that Eq.− (8.35) yields the familiar difference relation (Eq. (8.29)). If we take the difference relation to define the factorial function of ν< 1, then Eqs. (8.34) and (8.35) are verified for all ν (except negative integers). −

Exercises

8.1.1 Derive the recurrence relations Ŵ(z 1) zŴ(z) + = from the Euler integral (Eq. (8.5)),

∞ t z 1 Ŵ(z) e− t − dt. = 0 8.1 Definitions, Simple Properties 507

8.1.2 In a power-series solution for the Legendre functions of the second kind we encounter the expression (n 1)(n 2)(n 3) (n 2s 1)(n 2s) + + + ··· + − + , 2 4 6 8 (2s 2)(2s) (2n 3)(2n 5)(2n 7) (2n 2s 1) · · · ··· − · + + + ··· + + in which s is a positive integer. Rewrite this expression in terms of . 8.1.3 Show that, as s n negative integer, − → (s n) ( 1)n s(2n 2s) − ! − − − !. (2s 2n) → (n s) − ! − ! Here s and n are integers with s

∞ t2 2z 1 Ŵ(z) 2 e− t − dt, (z) > 0, = ℜ 0 1 z 1 1 − Ŵ(z) ln dt, (z) > 0. = t ℜ 0   8.1.5 In a Maxwellian distribution the fraction of particles with speed between v and v dv is + dN m 3/2 mv2 4π exp v2 dv, N = 2πkT −2kT     N being the total number of particles. The average or expectation value of vn is defined as vn N 1 vn dN. Show that  = − n/2 n 3 2kT Ŵ + vn 2 . = m Ŵ(3/2)     8.1.6 By transforming the integral into  a gamma function, show that 1 1 xk ln xdx ,k>1. − = (k 1)2 − 0 + 8.1.7 Show that

∞ x4 5 e− dx Ŵ . = 4 0   8.1.8 Show that (ax 1) 1 lim − ! . x 0 (x 1) = a → − ! 8.1.9 Locate the poles of Ŵ(z). Show that they are simple poles and determine the residues. 8.1.10 Show that the equation x k, k 0, has an infinite number of real roots. != = 8.1.11 Show that 508 Chapter 8 Gamma–Factorial Function

∞ 2s 1 2 s (a) x + exp ax dx ! . − = 2as 1 0 +   (s 1 ) (2s 1) π (b) ∞ x2s exp ax2 dx − 2 ! − !! . − = 2as 1/2 = 2s 1as a 0 + + )   These Gaussian integrals are of major importance in statistical mechanics. 8.1.12 (a) Develop recurrence relations for (2n) and for (2n 1) . (b) Use these recurrence relations to calculate!! (or to define)+ !! 0 and ( 1) . !! − !! ANS. 0 1, ( 1) 1. !! = − !! = 8.1.13 For s a nonnegative integer, show that ( 1)s ( 1)s2ss ( 2s 1) − − !. − − !! = (2s 1) = (2s) − !! ! 8.1.14 Express the coefficient of the nth term of the expansion of (1 x)1/2 + (a) in terms of factorials of integers, (b) in terms of the double factorial ( ) functions. !!

n 1 (2n 3) n 1 (2n 3) ANS. an ( 1) + − ! ( 1) + − !! , n 2, 3,.... = − 22n 2n (n 2) = − (2n) = − ! − ! !! 8.1.15 Express the coefficient of the nth term of the expansion of (1 x) 1/2 + − (a) in terms of the factorials of integers, (b) in terms of the double factorial ( ) functions. !!

n (2n) n (2n 1) ANS. an ( 1) ! ( 1) − !!,n1, 2, 3,.... = − 22n(n )2 = − (2n) = ! !! 8.1.16 The Legendre polynomial may be written as (2n 1) 1 n Pn(cos θ) 2 − !! cos nθ cos(n 2)θ = (2n) + 1 · 2n 1 − !!  − 1 3 n(n 1) · − cos(n 4)θ + 1 2 (2n 1)(2n 3) − · − − 1 3 5 n(n 1)(n 2) · · − − cos(n 6)θ . + 1 2 3 (2n 1)(2n 3)(2n 5) − +··· · · − − −  Let n 2s 1. Then = + s Pn(cos θ) P2s 1(cos θ) am cos(2m 1)θ. = + = + m 0 = Find am in terms of factorials and double factorials. 8.1 Definitions, Simple Properties 509

8.1.17 (a) Show that Ŵ 1 n Ŵ 1 n ( 1)nπ, 2 − 2 + = − where n is an integer.     (b) Express Ŵ(1 n) and Ŵ(1 n) separately in terms of π 1/2 and a function. 2 + 2 − !! (2n 1) ANS. Ŵ(1 n) − !!π 1/2. 2 + = 2n 8.1.18 From one of the definitions of the factorial or gamma function, show that πx (ix) 2 . ! = sinh πx   8.1.19 Prove that   2 1/2 ∞ β − Ŵ(α iβ) Ŵ(α) 1 . + = + (α n)2 n 0      #= + This equation has been useful in calculations  of beta decay theory. 8.1.20 Show that πb 1/2 n (n ib) s2 b2 1/2 + ! = sinh πb +   s 1   #=   for n, a positive integer.  8.1.21 Show that x (x iy) | !| ≥ + ! for all x. The variables x and y are real.     8.1.22 Show that π Ŵ 1 iy 2 . 2 + = cosh πy    8.1.23 The probability density associated with the of statistics is given by 1 (x µ)2 f(x) exp − , = σ(2π)1/2 − 2σ 2  with ( , ) for the range of x. Show that −∞ ∞ (a) the mean value of x, x is equal to µ, (b) the  (x2 x 2)1/2 is given by σ .  −  8.1.24 From the gamma distribution

1 α 1 x/β x − e− ,x>0, f(x) βαŴ(α) =  0,x0,  ≤ show that  (a) x (mean) αβ,(b)σ 2 (variance) x2 x 2 αβ 2.   = ≡ −  = 510 Chapter 8 Gamma–Factorial Function

8.1.25 The wave function of a particle scattered by a Coulomb potential is ψ(r,θ).Atthe origin the wave function becomes πγ/2 ψ(0) e− Ŵ(1 iγ), = + 2 where γ Z1Z2e /hv. Show that = ¯ 2πγ ψ(0) 2 . = e2πγ 1   − 8.1.26 Derive the contour integral representation  of Eq. (8.34),

z ν 2iν sin νπ e− ( z) dz. ! = − C 8.1.27 Write a function subprogram FACT (N) (fixed-point independent variable) that will cal- culate N . Include provision for rejection and appropriate error message if N is nega- tive. ! Note. For small integer N, direct multiplication is simplest. For large N, Eq. (8.55), Stirling’s series would be appropriate. 8.1.28 (a) Write a function subprogram to calculate the double factorial ratio (2N 1) / (2N) . Include provision for N 0 and for rejection and an error message− if N!!is negative.!! Calculate and tabulate= this ratio for N 1(1)100. (b) Check your function subprogram calculation of= 199 /200 against the value ob- tained from Stirling’s series (Section 8.3). !! !! 199 ANS. !! 0.056348. 200 = !! 8.1.29 Using either the FORTRAN-supplied GAMMA or a library-supplied subroutine for x or Ŵ(x), determine the value of x for which Ŵ(x) is a minimum (1 x 2) and this! minimum value of Ŵ(x). Notice that although the minimum value of≤Ŵ(x)≤may be obtained to about six significant figures (single precision), the corresponding value of x is much less accurate. Why this relatively low accuracy? 8.1.30 The factorial function expressed in integral form can be evaluated by the Gauss– Laguerre quadrature. For a 10-point formula the resultant x is theoretically exact for x an integer, 0 up through 19. What happens if x is not an! integer? Use the Gauss– Laguerre quadrature to evaluate x , x 0.0(0.1)2.0. Tabulate the absolute error as a function of x. ! =

Check value. x exact x quadrature 0.00034 for x 1.3. ! − ! = =

8.2 DIGAMMA AND POLYGAMMA FUNCTIONS

Digamma Functions

As may be noted from the three definitions in Section 8.1, it is inconvenient to deal with the derivatives of the gamma or factorial function directly. Instead, it is customary to take 8.2 Digamma and Polygamma Functions 511

the natural of the factorial function (Eq. (8.1)), convert the product to a sum, and then differentiate; that is, n Ŵ(z 1) zŴ(z) lim ! nz (8.36) + = = n (z 1)(z 2) (z n) →∞ + + ··· + and

ln Ŵ(z 1) lim ln(n ) z ln n ln(z 1) n + = →∞ ! + − + ln(z 2) ln(z n) , (8.37) − + −···− + in which the logarithm of the limit is equal to the limit of the logarithm. Differentiating with respect to z, we obtain d 1 1 1 ln Ŵ(z 1) ψ(z 1) lim ln n , (8.38) dz + ≡ + = n − z 1 − z 2 −···− z n →∞ + + +  which defines ψ(z 1), the . From the definition of the Euler– Mascheroni constant,+2 Eq. (8.38) may be rewritten as

∞ 1 1 ψ(z 1) γ + =− − z n − n n 1  = + ∞ z γ . (8.39) =− + n(n z) n 1 = + One application of Eq. (8.39) is in the derivation of the series form of the Neumann function (Section 11.3). Clearly,

ψ(1) γ 0.577 215 664 901 ....3 (8.40) =− =− Another, perhaps more useful, expression for ψ(z) is derived in Section 8.3.

Polygamma Function

The digamma function may be differentiated repeatedly, giving rise to the : dm 1 ψ(m)(z ) + (z ) 1 m 1 ln + ≡ dz + !

m 1 ∞ 1 ( 1) + m ,m1, 2, 3,.... (8.41) = − ! (z n)m 1 = n 1 + = +

2 n 1 Compare Sections 5.2 and 5.9. We add and substract s 1 s− . 3γ has been computed to 1271 places by D. E. Knuth,= Math. Comput. 16: 275 (1962), and to 3566 decimal places by  D. W. Sweeney, ibid. 17: 170 (1963). It may be of interest that the fraction 228/395 gives γ accurate to six places. 512 Chapter 8 Gamma–Factorial Function

Aplotofψ(x 1) and ψ (x 1) is included in Fig. 8.2. Since the series in Eq. (8.41) + ′ + defines the Riemann zeta function4 (with z 0), = ∞ 1 ζ(m) , (8.42) ≡ nm n 1 = we have

(m) m 1 ψ (1) ( 1) + m ζ(m 1), m 1, 2, 3,.... (8.43) = − ! + = The values of the polygamma functions of positive integral argument, ψ(m)(n 1),may + be calculated by using Exercise 8.2.6. In terms of the perhaps more common Ŵ notation,

dn 1 dn + Ŵ(z) ψ(z) ψ(n)(z). n 1 ln n (8.44a) dz + = dz =

Maclaurin Expansion, Computation

It is now possible to write a Maclaurin expansion for ln Ŵ(z 1): + n n ∞ z (n 1) ∞ n z ln Ŵ(z 1) ψ − (1) γz ( 1) ζ(n) (8.44b) + = n =− + − n n 1 n 2 = ! = convergent for z < 1; for z x, the range is 1

Series Summation

The digamma and polygamma functions may also be used in summing series. If the general term of the series has the form of a rational fraction (with the highest power of the index in the numerator at least two less than the highest power of the index in the denominator), it may be transformed by the method of partial fractions (compare Section 15.8). The infinite series may then be expressed as a finite sum of digamma and polygamma functions. The usefulness of this method depends on the availability of tables of digamma and polygamma functions. Such tables and examples of series summation are given in AMS-55, Chapter 6 (see Additional Readings for the reference).

4See Section 5.9. For z 0 this series may be used to define a generalized zeta function. = 5Table of the Gamma Function for Complex Arguments, Applied Series No. 34. Washington, DC: National Bureau of Standards (1954). 8.2 Digamma and Polygamma Functions 513

Example 8.2.1 CATALAN’S CONSTANT

Catalan’s constant, Exercise 5.2.22, or β(2) of Section 5.9 is given by

∞ ( 1)k K β(2) − . (8.44c) = = (2k 1)2 k 0 = + Grouping the positive and negative terms separately and starting with unit index (to match the form of ψ(1), Eq. (8.41)), we obtain

∞ 1 1 ∞ 1 K 1 . = + (4n 1)2 − 9 − (4n 3)2 n 1 n 1 = + = + Now, quoting Eq. (8.41), we get K 8 1 ψ(1) 1 1 1 ψ(1) 1 3 . (8.44d) = 9 + 16 + 4 − 16 + 4 Using the values of ψ(1) from Table 6.1 of AMS-55 (see Additional Readings for the reference), we obtain K 0.91596559 .... = Compare this calculation of Catalan’s constant with the calculations of Chapter 5, either direct summation or a modification using values. 

Exercises

8.2.1 Verify that the following two forms of the digamma function,

x 1 ψ(x 1) γ + = r − r 1 = and

∞ x ψ(x 1) γ, + = r(r x) − r 1 = + are equal to each other (for x a positive integer). 8.2.2 Show that ψ(z 1) has the series expansion +

∞ n n 1 ψ(z 1) γ ( 1) ζ(n)z − . + =− + − n 2 = 8.2.3 For a power-series expansion of ln(z ), AMS-55 (see Additional Readings for reference) lists !

∞ ζ(n) 1 zn ln(z ) ln(1 z) z(1 γ) ( 1)n [ − ] . ! =− + + − + − n n 2 = 514 Chapter 8 Gamma–Factorial Function

(a) Show that this agrees with Eq. (8.44b) for z < 1. (b) What is the range of convergence of this new| | expression?

8.2.4 Show that

1 πz ∞ ζ(2n) ln z2n, z < 1. 2 sin πz = 2n | |   n 1 = Hint. Try Eq. (8.32). 8.2.5 Write out a Weierstrass infinite-product definition of ln(z ). Without differentiating, show that this leads directly to the Maclaurin expansion of ln! (z ), Eq. (8.44b). ! 8.2.6 Derive the difference relation for the polygamma function m ψ(m)(z 2) ψ(m)(z 1) ( 1)m ! ,m0, 1, 2,.... + = + + − (z 1)m 1 = + + 8.2.7 Show that if Ŵ(x iy) u iv, + = + then Ŵ(x iy) u iv. − = − This is a special case of the Schwarz reflection principle, Section 6.5.

8.2.8 The Pochhammer symbol (a)n is defined as

(a)n a(a 1) (a n 1), (a)0 1 = + ··· + − = (for integral n).

(a) Express (a)n in terms of factorials. (b) Find (d/da)(a)n in terms of (a)n and digamma functions.

d ANS. (a)n (a)n ψ(a n) ψ(a) . da = + −  (c) Show that

(a)n k (a n)k (a)n. + = + · 8.2.9 Verify the following special values of the ψ form of the di- and polygamma functions: ψ(1) γ, ψ(1)(1) ζ(2), ψ(2)(1) 2ζ(3). =− = =− 8.2.10 Derive the polygamma function recurrence relation (m) (m) m m 1 ψ (1 z) ψ (z) ( 1) m /z + ,m0, 1, 2,.... + = + − ! = 8.2.11 Verify

∞ r (a) e− ln rdr γ . =− 0 8.2 Digamma and Polygamma Functions 515

∞ r (b) re− ln rdr 1 γ . = − 0 ∞ n r ∞ n 1 r (c) r e− ln rdr (n 1) n r − e− ln rdr, n 1, 2, 3,.... = − !+ = 0 0 Hint. These may be verified by , three parts, or differentiating the integral form of n with respect to n. ! 8.2.12 Dirac relativistic wave functions for hydrogen involve factors such as 2(1 α2Z2)1/2 1 [ − ]! where α, the fine structure constant, is 137 and Z is the atomic number. Expand 2(1 α2Z2)1/2 in a series of powers of α2Z2. [ − ]! 8.2.13 The quantum mechanical description of a particle in a Coulomb field requires a knowl- edge of the phase of the complex factorial function. Determine the phase of (1 ib) for small b. + ! 8.2.14 The total energy radiated by a blackbody is given by

8πk4T 4 x3 u ∞ dx. = c3h3 ex 1 0 − Show that the integral in this expression is equal to 3 ζ(4). ζ(4) π 4/90 1.0823 ... The final result is the Stefan–Boltzmann! law. [ = = ] 8.2.15 As a generalization of the result in Exercise 8.2.14, show that xs dx ∞ s ζ(s 1), (s) > 0. ex 1 = ! + ℜ 0 − 8.2.16 The neutrino energy density (Fermi distribution) in the early history of the universe is given by

3 4π ∞ x ρν dx. = h3 exp(x/kT ) 1 0 + Show that 5 7π 4 ρν (kT ) . = 30h3 8.2.17 Prove that s ∞ x dx s s 1 2− ζ(s 1), (s) > 0. ex 1 = ! − + ℜ 0 +   Exercises 8.2.15 and 8.2.17 actually constitute Mellin integral transforms (compare Sec- tion 15.1). 8.2.18 Prove that n zt (n) n 1 ∞ t e− ψ (z) ( 1) + dt, (z) > 0. = − 1 e t ℜ 0 − − 516 Chapter 8 Gamma–Factorial Function

8.2.19 Using di- and polygamma functions, sum the series

∞ 1 ∞ 1 (a) ,(b) . n(n 1) n2 1 n 1 n 2 = + = − Note. You can use Exercise 8.2.6 to calculate the needed digamma functions.

8.2.20 Show that

∞ 1 1 ψ(1 b) ψ(1 a) , (n a)(n b) = (b a) + − + n 1 + + − = ' ( where a b and neither a nor b is a negative integer. It is of some interest to compare = this summation with the corresponding integral,

dx 1 ∞ ln(1 b) ln(1 a) . (x a)(x b) = b a + − + 1 + + − ' ( The relation between ψ(x) and ln x is made explicit in Eq. (8.51) in the next section.

8.2.21 Verify the contour integral representation of ζ(s),

( s) ( z)s 1 ζ(s) − ! − − dz. =− 2πi ez 1 C − The contour C is the same as that for Eq. (8.35). The points z 2nπi, n 1, 2, 3,..., =± = are all excluded.

8.2.22 Show that ζ(s) is analytic in the entire finite complex plane except at s 1, where it = has a simple pole with a residue of 1. + Hint. The contour integral representation will be useful.

8.2.23 Using the complex variable capability of FORTRAN calculate (1 ib) , (1 ib) , ℜ + ! ℑ + ! (1 ib) and phase (1 ib) for b 0.0(0.1)1.0. Plot the phase of (1 ib) versus b. | + !| + ! = + ! Hint. Exercise 8.2.3 offers a convenient approach. You will need to calculate ζ(n).

8.3 STIRLING’S SERIES

For computation of ln(z ) for very large z (statistical mechanics) and for numerical com- ! putations at nonintegral values of z, a series expansion of ln(z ) in negative powers of z is ! desirable. Perhaps the most elegant way of deriving such an expansion is by the method of steepest descents (Section 7.3). The following method, starting with a numerical integra- tion formula, does not require knowledge of contour integration and is particularly direct. 8.3 Stirling’s Series 517 Derivation from Euler–Maclaurin Integration Formula

The Euler–Maclaurin formula for evaluating a definite integral6 is n f(x)dx 1 f(0) f(1) f(2) 1 f(n) = 2 + + +···+ 2 0 b2 f ′(n) f ′(0) b4 f ′′′(n) f ′′′(0) , (8.45) − − − − −··· in which the b2n are related to the Bernoulli numbers B2n (compare Section 5.9) by

(2n) b2n B2n, (8.46) ! = 1 B0 1,B6 , = = 42 1 1 B2 ,B8 , (8.47) = 6 =−30 1 5 B4 ,B10 , and so on. =−30 = 66 By applying Eq. (8.45) to the definite integral dx 1 ∞ (8.48) (z x)2 = z 0 + (for z not on the negative real axis), we obtain

1 1 2 b2 4 b4 ψ(1)(z 1) ! ! . (8.49) z = 2z2 + + − z3 − z5 −··· This is the reason for using Eq. (8.48). The Euler–Maclaurin evaluation yields ψ(1)(z 1), which is d2 ln Ŵ(z 1)/dz2. + Using Eq. (8.46)+ and solving for ψ(1)(z 1),wehave + d 1 1 B B ψ(1)(z 1) ψ(z 1) 2 4 + = dz + = z − 2z2 + z3 + z5 +···

1 1 ∞ B 2n . (8.50) = z − 2z2 + z2n 1 n 1 + = Since the Bernoulli numbers diverge strongly, this series does not converge. It is a semi- convergent, or asymptotic, series, useful if one retains a small enough number of terms (compare Section 5.10). Integrating once, we get the digamma function

1 B2 B4 ψ(z 1) C1 ln z + = + + 2z − 2z2 − 4z4 −···

1 ∞ B2n C1 ln z . (8.51) = + + 2z − 2nz2n n 1 = Integrating Eq. (8.51) with respect to z from z 1toz and then letting z approach infinity, − C1, the constant of integration, may be shown to vanish. This gives us a second expression for the digamma function, often more useful than Eq. (8.38) or (8.44b).

6This is obtained by repeated integration by parts, Section 5.9. 518 Chapter 8 Gamma–Factorial Function Stirling’s Series

The indefinite integral of the digamma function (Eq. (8.51)) is

1 B2 B2n ln Ŵ(z 1) C2 z ln z z , (8.52) + = + + 2 − + 2z +···+ 2n(2n 1)z2n 1 +···   − − in which C2 is another constant of integration. To fix C2 we find it convenient to use the doubling, or Legendre duplication, formula derived in Section 8.4, 1 2z 1/2 Ŵ(z 1)Ŵ z 2− π Ŵ(2z 1). (8.53) + + 2 = + This may be proved directly when z is a positive integer by writing Ŵ(2z 1) as a product of even terms times a product of odd terms and extracting a factor of 2+ from each term (Exercise 8.3.5). Substituting Eq. (8.52) into the logarithm of the doubling formula, we find that C2 is 1 C2 ln 2π, (8.54) = 2 giving

1 1 1 1 1 ln Ŵ(z 1) ln 2π z ln z z . (8.55) + = 2 + + 2 − + 12z − 360z3 + 1260z5 −···   This is Stirling’s series, an . The absolute value of the error is less than the absolute value of the first term omitted. The constants of integration C1 and C2 may also be evaluated by comparison with the first term of the series expansion obtained by the method of “steepest descent.” This is carried out in Section 7.3. To help convey a feeling of the remarkable precision of Stirling’s series for Ŵ(s 1), the ratio of the first term of Stirling’s approximation to Ŵ(s 1) is plotted in Fig.+ 8.5. A tabulation gives the ratio of the first term in the expansion to+ Ŵ(s 1) and the ratio of the first two terms in the expansion to Ŵ(s 1) (Table 8.1). The derivation+ of these forms is Exercise 8.3.1. +

Exercises

8.3.1 Rewrite Stirling’s series to give Ŵ(z 1) instead of ln Ŵ(z 1). + + z 1/2 z 1 1 139 ANS. Ŵ(z 1) √2πz + e− 1 . + = + 12z + 288z2 − 51,840z3 +···   8.3.2 Use Stirling’s formula to estimate 52 , the number of possible rearrangements of cards in a standard deck of playing cards. ! 8.3.3 By integrating Eq. (8.51) from z 1toz and then letting z , evaluate the constant − →∞ C1 in the asymptotic series for the digamma function ψ(z). 1 8.3.4 Show that the constant C2 in Stirling’s formula equals 2 ln 2π by using the logarithm of the doubling formula. 8.3 Stirling’s Series 519

FIGURE 8.5 Accuracy of Stirling’s formula.

Table 8.1

1 1 1 s √2πss 1/2e s √2πss 1/2e s 1 Ŵ(s 1) + − Ŵ(s 1) + − + 12s + +   1 0.92213 0.99898 2 0.95950 0.99949 3 0.97270 0.99972 4 0.97942 0.99983 5 0.98349 0.99988 6 0.98621 0.99992 7 0.98817 0.99994 8 0.98964 0.99995 9 0.99078 0.99996 10 0.99170 0.99998

8.3.5 By direct expansion, verify the doubling formula for z n 1 ; n is an integer. = + 2 8.3.6 Without using Stirling’s series show that

n 1 n (a) ln(n )< + ln xdx,(b)ln(n )> ln xdx; n is an integer 2. ! ! ≥ 1 1 Notice that the arithmetic mean of these two integrals gives a good approximation for Stirling’s series. 8.3.7 Test for convergence

1 2 ∞ (p ) 2p 1 ∞ (2p 1) (2p 1) − 2 ! + π − !! + !!. p × 2p 2 = (2p) (2p 2) p 0  p 0 = ! + = !! + !! 520 Chapter 8 Gamma–Factorial Function

This series arises in an attempt to describe the magnetic field created by and enclosed by a current loop. 8.3.8 Show that

b a (x a) lim x − + ! 1. x (x b) = →∞ + ! 8.3.9 Show that

(2n 1) 1/2 1/2 lim − !!n π − . n (2n) = →∞ !! 2n 8.3.10 Calculate the binomial coefficient n to six significant figures for n 10, 20, and 30. Check your values by =   1 (a) a Stirling series approximation through terms in n− , (b) a double precision calculation.

ANS. 20 1.84756 105, 40 1.37846 1011, 10 = × 20 = ×    60  1.18264 1017. 30 = × 8.3.11 Write a program (or subprogram) that will calculate log10(x )directly from Stirling’s series. Assume that x 10. (Smaller values could be calculated! via the factorial re- ≥ currence relation.) Tabulate log10(x ) versus x for x 10(10)300. Check your results against AMS-55 (see Additional Readings! for this reference)= or by direct multiplication (for n 10, 20, and 30). = Check value.log (100 ) 157.97. 10 ! = 8.3.12 Using the complex arithmetic capability of FORTRAN, write a subroutine that will cal- culate ln(z ) for complex z based on Stirling’s series. Include a test and an appropriate error message! if z is too close to a negative real integer. Check your subroutine against alternate calculations for z real, z pure imaginary, and z 1 ib (Exercise 8.2.23). = + Check values. (i0.5) 0.82618 phase| (i0.5)!| = 0.24406. !=− 8.4 THE BETA FUNCTION

Using the integral definition (Eq. (8.25)), we write the product of two factorials as the product of two integrals. To facilitate a change in variables, we take the integrals over a finite range:

a2 a2 u m v n (m) > 1, m n lim e− u du e− v dv, ℜ − (8.56a) ! !=a2 0 0 (n) > 1. →∞ ℜ − Replacing u with x2 and v with y2, we obtain a a x2 2m 1 y2 2n 1 m n lim 4 e− x + dx e− y + dy. (8.56b) ! !=a →∞ 0 0 8.4 The Beta Function 521

FIGURE 8.6 Transformation from Cartesian to polar coordinates.

Transforming to polar coordinates gives us

a π/2 r2 2m 2n 3 2m 1 2n 1 m n lim 4 e− r + + dr cos + θ sin + θdθ ! !=a →∞ 0 0 π/2 2m 1 2n 1 (m n 1) 2 cos + θ sin + θdθ. (8.57) = + + ! 0 Here the Cartesian area element dxdy has been replaced by rdrdθ (Fig. 8.6). The last equality in Eq. (8.57) follows from Exercise 8.1.11. The definite integral, together with the factor 2, has been named the beta function:

π/2 2m 1 2n 1 B(m 1,n 1) 2 cos + θ sin + θdθ + + ≡ 0 m n ! ! . (8.58a) = (m n 1) + + ! Equivalently, in terms of the gamma function and noting its symmetry, Ŵ(p)Ŵ(q) B(p,q) ,B(q,p)B(p,q). (8.58b) = Ŵ(p q) = + The only reason for choosing m 1 and n 1, rather than m and n, as the arguments of B is to be in agreement with the conventional,+ + historical beta function.

Definite Integrals, Alternate Forms

The beta function is useful in the evaluation of a wide variety of definite integrals. The substitution t cos2 θ converts Eq. (8.58a) to7 = m n 1 B(m 1,n 1) ! ! tm(1 t)n dt. (8.59a) + + = (m n 1) = − + + ! 0

7The convolution theorem provides an alternate derivation of Eq. (8.58a), compare Exercise 15.11.2. 522 Chapter 8 Gamma–Factorial Function

Replacing t by x2, we obtain 1 m n 2m 1 2 n ! ! x + 1 x dx. (8.59b) 2(m n 1) = − + + ! 0 The substitution t u/(1 u) in Eq. (8.59a) yields still another useful form, = + m n um ! ! ∞ du. (8.60) (m n 1) = (1 u)m n 2 + + ! 0 + + + The beta function as a definite integral is useful in establishing integral representations of the (Exercise 11.1.18) and the (Exercise 13.4.10).

Verification of πα/sin πα Relation

If we take m a, n a, 1

Derivation of Legendre Duplication Formula

The form of Eq. (8.58a) suggests that the beta function may be useful in deriving the doubling formula used in the preceding section. From Eq. (8.59a) with m n z and (z) > 1, = = ℜ − z z 1 ! ! tz(1 t)z dt. (8.62) (2z 1) = − + ! 0 By substituting t (1 s)/2, we have = + 1 1 z z 2z 1 2 z 2z 2 z ! ! 2− − 1 s ds 2− 1 s ds. (8.63) (2z 1) = 1 − = 0 − + ! − The last equality holds because the integrand  is even. Evaluating this integral as a beta function (Eq. (8.59b)), we obtain 1 z z 2z 1 z ( 2 ) ! ! 2− − ! − ! . (8.64) (2z 1) = (z 1 ) + ! + 2 ! 1 1/2 Rearranging terms and recalling that ( 2 ) π , we reduce this equation to one form of the Legendre duplication formula, − != 1 2z 1 1/2 z z 2− − π (2z 1) . (8.65a) ! + 2 != + ! Dividing by (z 1 ), we obtain an alternate form of the duplication formula: + 2 1 2z 1/2 z z 2− π (2z) . (8.65b) ! − 2 != !   8.4 The Beta Function 523

Although the integrals used in this derivation are defined only for (z) > 1, the results (Eqs. (8.65a) and (8.65b) hold for all regular points z by .ℜ − 8 Using the double factorial notation (Section 8.1), we may rewrite Eq. (8.65a) (with z n, an integer) as =

1 1/2 n 1 n π (2n 1) /2 + . (8.65c) + 2 != + !! This is often convenient for eliminating  factorials of fractions.

Incomplete Beta Function

Just as there is an incomplete gamma function (Section 8.5), there is also an incomplete beta function, x p 1 q 1 Bx(p, q) t − (1 t) − dt, 0 x 1,p>0,q>0 (if x 1). (8.66) = − ≤ ≤ = 0 Clearly, Bx 1(p, q) becomes the regular (complete) beta function, Eq. (8.59a). A power- = series expansion of Bx(p, q) is the subject of Exercises 5.2.18 and 5.7.8. The relation to hypergeometric functions appears in Section 13.4. The incomplete beta function makes an appearance in in calculating the probability of at most k successes in n independent trials.9

Exercises

2n 1 8.4.1 Derive the doubling formula for the factorial function by integrating (sin 2θ) + 2n 1 = (2sinθ cos θ) + (and using the beta function). 8.4.2 Verify the following beta function identities:

(a) B(a,b) B(a 1,b) B(a,b 1), = + + + a b (b) B(a,b) + B(a,b 1), = b + b 1 (c) B(a,b) − B(a 1,b 1), = a + − (d) B(a,b)B(a b,c) B(b,c)B(a,b c). + = + 8.4.3 (a) Show that

1 π/2,n0 1/2 = 1 x2 x2n dx (2n 1) 1 − = π − !!,n1, 2, 3,.... −  (2n 2) =   + !! 8If 2z is a negative integer, we get the valid but unilluminating result  . ∞=∞ 9W. Feller, An Introduction to Probability Theory and Its Applications, 3rd ed. New York: Wiley (1968), Section VI.10. 524 Chapter 8 Gamma–Factorial Function

(b) Show that

1 π, n 0 2 1/2 2n = 1 x − x dx (2n 1) 1 − = π − !!,n1, 2, 3,.... −  (2n) =   !! 8.4.4 Show that  2n 1 n n 1 2 + ! ! ,n>1 n (2n 1) − 1 x2 dx  + ! 1 − =  (2n) − 2 !! ,n0, 1, 2,....    (2n 1) = + !! 1 a b  8.4.5 Evaluate 1(1 x) (1 x) dxin terms of the beta function. − + − ANS. 2a b 1B(a 1,b 1). + + + + 8.4.6 Show, by means of the beta function, that z dx π , 0 <α<1. (z x)1 α(x t)α = sin πα t − − − 8.4.7 Show that the Dirichlet integral p q B(p 1,q 1) xpyq dxdy ! ! + + , = (p q 2) = p q 2 + + ! + + where the range of integration is the triangle bounded by the positive x- and y-axes and the line x y 1. + = 8.4.8 Show that

∞ ∞ (x2 y2 2xy cos θ) θ e− + + dxdy . = 2sinθ 0 0 What are the limits on θ? Hint. Consider oblique xy-coordinates. ANS. π<θ<π. − 8.4.9 Evaluate (using the beta function)

(a) π/2 (2π)3/2 cos1/2 θdθ , 1 2 0 = 16 ( ) [ 4 !] (b) π/2 π/2 √π (n 1)/2 cosn θdθ sinn θdθ [ − ]! = = 2(n/2) 0 0 ! (n 1) − !! for n odd, n  !! =  π (n 1)  − !! for n even. 2 · n !!   8.4 The Beta Function 525

8.4.10 Evaluate 1(1 x4) 1/2 dx as a beta function. 0 − − ( 1 ) 2 4 ANS. [ 4 !] · 1.311028777. (2π)1/2 = 8.4.11 Given 2 z ν π/2 J (z) 2ν θ (z θ)dθ, (ν) > 1 , ν 1 sin cos cos 2 = π 1/2(ν ) 2 0 ℜ − − 2 !  show, with the aid of beta functions, that this reduces to the Bessel series 2s ν ∞ s 1 z + Jν(z) ( 1) , = − s (s ν) 2 s 0   = ! + ! identifying the initial Jν as an integral representation of the Bessel function, Jν (Sec- tion 11.1). 8.4.12 Given the associated

P m(x) (2m 1) 1 x2 m/2, m = − !! − Section 12.5, show that  

1 2 (a) P m(x) 2 dx (2m) ,m0, 1, 2,..., m = 2m 1 ! = 1 −  + 1 dx (b) P m(x) 2 2 (2m 1) ,m1, 2, 3,.... m 1 x2 = · − ! = 1 −  − 8.4.13 Show that

1 2s 1 2 1/2 (2s) (a) x + 1 x − dx !! , − = (2s 1) 0   + !! 1 1 (p 1 ) q (b) x2p 1 x2 q dx − 2 ! ! . − = 2 (p q 1 ) 0 2   + + ! 8.4.14 A particle of mass m moving in a symmetric potential that is well described by V(x) n 1 2 = A x has a total energy 2 m(dx/dt) V(x) E. Solving for dx/dt and integrating we| find| that the period of motion is + = xmax dx τ 2√2m , = (E Axn)1/2 0 − n where xmax is a classical turning point given by Ax E. Show that max = 2 2πm E 1/n Ŵ(1/n) τ . = n E A Ŵ(1/n 1 ) )   + 2 8.4.15 Referring to Exercise 8.4.14, 526 Chapter 8 Gamma–Factorial Function

(a) Determine the limit as n of →∞ 2 2πm E 1/n Ŵ(1/n) . n E A Ŵ(1/n 1 ) )   + 2 n 1/2 (b) Find lim τ from the behavior of the integrand (E Ax )− . n − (c) Investigate→∞ the behavior of the physical system (potential well) as n . Obtain →∞ the period from inspection of this limiting physical system.

8.4.16 Show that sinhα x 1 α 1 β α ∞ dx B + , − , 1 <α<β. coshβ x = 2 2 2 − 0   Hint. Let sinh2 x u. = 8.4.17 The of probability theory has a probability density

Ŵ(α β) α 1 β 1 f(x) + x − (1 x) − , = Ŵ(α)Ŵ(β) − with x restricted to the interval (0, 1). Show that

α (a) x (mean) .   = α β + αβ (b) σ 2(variance) x2 x 2 . ≡ −  = (α β)2(α β 1) + + + 8.4.18 From

π/2 sin2n θdθ lim 0 1 n π/2 2n 1 = →∞ 0 sin + θdθ derive the Wallis formula for π: π 2 2 4 4 6 6 · · · . 2 = 1 3 · 3 5 · 5 7 ··· · · · 8.4.19 Tabulate the beta function B(p,q) for p and q 1.0(0.1)2.0 independently. = Check value. B(1.3, 1.7) 0.40774. = 8.4.20 (a) Write a subroutine that will calculate the incomplete beta function Bx(p, q).For 0.5

Bx(p, q) B(p,q) B1 x (q, p). = − − 3 3 (b) Tabulate Bx( 2 , 2 ). Spot check your results by using the Gauss–Legendre quadra- ture. 8.5 Incomplete Gamma Function 527 8.5 THE INCOMPLETE GAMMA FUNCTIONS AND RELATED FUNCTIONS

Generalizing the Euler definition of the gamma function (Eq. (8.5)), we define the incom- plete gamma functions by the variable limit integrals x t a 1 γ(a,x) e− t − dt, (a) > 0 = ℜ 0 and

∞ t a 1 Ŵ(a,x) e− t − dt. (8.67) = x Clearly, the two functions are related, for

γ(a,x) Ŵ(a,x) Ŵ(a). (8.68) + = The choice of employing γ(a,x)or Ŵ(a,x) is purely a matter of convenience. If the para- meter a is a positive integer, Eq. (8.67) may be integrated completely to yield

n 1 s x − x γ(n,x) (n 1) 1 e− = − ! − s  s 0 !  = (8.69) n 1 s x − x Ŵ(n,x) (n 1) e− ,n1, 2,.... = − ! s = s 0 = ! For nonintegral a, a power-series expansion of γ(a,x)for small x and an asymptotic ex- pansion of Ŵ(a,x) (denoted as I(x,p)) are developed in Exercise 5.7.7 and Section 5.10:

∞ xn γ(a,x) xa ( 1)n , x 1 (small x), = − n (a n) | |∼ n 0 = ! +

a 1 x ∞ (a 1) 1 Ŵ(a,x) x − e− − ! (8.70) = (a 1 n) · xn n 0 = − − !

a 1 x ∞ n (n a) 1 x − e− ( 1) − ! ,x1 (large x). = − ( a) · xn ≫ n 0 = − ! These incomplete gamma functions may also be expressed quite elegantly in terms of con- fluent hypergeometric functions (compare Section 13.5).

Exponential Integral

Although the incomplete gamma function Ŵ(a,x) in its general form (Eq. (8.67)) is only infrequently encountered in physical problems, a special case is quite common and very 528 Chapter 8 Gamma–Factorial Function

FIGURE 8.7 The exponential integral, E1(x) Ei( x). =− −

useful. We define the exponential integral by10

t ∞ e− Ei( x) dt E1(x). (8.71) − − ≡ t = x (See Fig. 8.7.) Caution is needed here, for the integral in Eq. (8.71) diverges logarithmically as x 0. To obtain a series expansion for small x, we start from →

E1(x) Ŵ(0,x) lim Ŵ(a) γ(a,x) . (8.72) = = a 0 − →  We may split the divergent term in the series expansion for γ(a,x),

aŴ(a) xa ∞ ( 1)nxn E1(x) lim − − . (8.73) = a 0 a − n n →  n 1 = · ! Using l’Hôpital’s rule (Exercise 5.6.8) and

d d d ln(a ) aŴ(a) a e ! a ψ(a 1), (8.74) da = da !=da = ! + ' ( and then Eq. (8.40),11 we obtain the rapidly converging series

∞ ( 1)nxn E1(x) γ ln x − . (8.75) =− − − n n n 1 = · ! An asymptotic expansion E (x) e x 1 1 for x is developed in Sec- 1 − x x2! tion 5.10. ≈ [ − +···] →∞

10The appearance of the two minus signs in Ei( x) is a historical monstrosity. AMS-55, Chapter 5, denotes this integral as − − E1(x). See Additional Readings for the reference. 11dxa/da xa ln x. = 8.5 Incomplete Gamma Function 529

FIGURE 8.8 and cosine integrals.

Further special forms related to the exponential integral are the sine integral, cosine integral (Fig. 8.8), and logarithmic integral, defined by12 sin t si(x) ∞ dt =− t x cos t Ci(x) ∞ dt (8.76) =− t x x du li(x) Ei(ln x) = ln u = 0 for their principal branch, with the branch cut conventionally chosen to be along the nega- tive real axis from the branch point at zero. By transforming from real to imaginary argu- ment, we can show that 1 1 si(x) Ei(ix) Ei( ix) E1(ix) E1( ix) , (8.77) = 2i − − = 2i − − whereas   1 1 π Ci(x) Ei(ix) Ei( ix) E1(ix) E1( ix) , arg x < . (8.78) = 2 + − =−2 + − | | 2 Adding these two relations, we obtain  Ei(ix) Ci(x) isi(x), (8.79) = + to show that the relation among these integrals is exactly analogous to that among eix, cos x, and sin x. Reference to Eqs. (8.71) and (8.78) shows that Ci(x) agrees with the definitions of AMS-55 (see Additional Readings for the reference). In terms of E1,

E1(ix) Ci(x) isi(x). =− + Asymptotic expansions of Ci(x) and si(x) are developed in Section 5.10. Power-series expansions about the origin for Ci(x),si(x), and li(x) may be obtained from those for

12Another sine integral is given by Si(x) si(x) π/2. = + 530 Chapter 8 Gamma–Factorial Function

FIGURE 8.9 , erf x.

the exponential integral, E1(x), or by direct integration, Exercise 8.5.10. The exponential, sine, and cosine integrals are tabulated in AMS-55, Chapter 5, (see Additional Readings for the reference) and can also be accessed by symbolic software such as Mathematica, , Mathcad, and Reduce.

Error Integrals

The error integrals

z 2 t2 2 ∞ t2 erf z e− dt, erfc z 1 erf z e− dt (8.80a) = √π = − = √π 0 z (normalized so that erf 1) are introduced in Exercise 5.10.4 (Fig. 8.9). Asymptotic forms are developed there.∞= From the general form of the integrands and Eq. (8.6) we ex- 1 pect that erf z and erfc z may be written as incomplete gamma functions with a 2 .The relations are = 1/2 1 2 1/2 1 2 erf z π − γ ,z , erfc z π − Ŵ ,z . (8.80b) = 2 = 2 The power-series expansion of erfz follows directly from Eq. (8.70). 

Exercises

8.5.1 Show that

x ∞ (a 1) a n γ(a,x) e− − ! x + = (a n) n 0 = + ! (a) by repeatedly integrating by parts. (b) Demonstrate this relation by transforming it into Eq. (8.70).

8.5.2 Show that

m d a m a m (a) x− γ(a,x) ( 1) x− − γ(a m, x), dxm = − +  8.5 Incomplete Gamma Function 531

dm Ŵ(a) (b) exγ(a,x) ex γ(a m, x). dxm = Ŵ(a m) −  − 8.5.3 Show that γ(a,x)and Ŵ(a,x) satisfy the recurrence relations

a x (a) γ(a 1,x) aγ(a,x) x e− , (b) Ŵ(a+ 1,x)= aŴ(a,x)− xae x . + = + − 8.5.4 The potential produced by a 1S hydrogen electron (Exercise 12.8.6) is given by q 1 V(r) γ(3, 2r) Ŵ(2, 2r) . = 4πε a 2r + 0 0   (a) For r 1, show that ≪ q 2 V(r) 1 r2 . = 4πε a − 3 +··· 0 0   (b) For r 1, show that ≫ q 1 V(r) . = 4πε0a0 · r

Here r is expressed in units of a0, the Bohr radius. Note. For computation at intermediate values of r, Eqs. (8.69) are convenient. 8.5.5 The potential of a 2P hydrogen electron is found to be (Exercise 12.8.7) 1 q 1 V(r) γ(5,r) Ŵ(4,r) = 4πε · 24a r + 0 0   1 q 1 2 γ(7,r) r Ŵ(2,r) P2(cos θ). − 4πε · 120a r3 + 0 0   Here r is expressed in units of a0, the Bohr radius. P2(cos θ) is a Legendre polynomial (Section 12.1).

(a) For r 1, show that ≪ 1 q 1 1 2 V(r) r P2(cos θ) . = 4πε · a 4 − 120 +··· 0 0   (b) For r 1, show that ≫ 1 q 6 V(r) 1 P2(cos θ) . = 4πε · a r − r2 +··· 0 0   8.5.6 Prove that the exponential integral has the expansion

e t ∞ ( 1)nxn ∞ − dt γ ln x − , t =− − − n n x n 1 = · ! where γ is the Euler–Mascheroni constant. 532 Chapter 8 Gamma–Factorial Function

8.5.7 Show that E1(z) may be written as zt z ∞ e− E1(z) e− dt. = 1 t 0 + Show also that we must impose the condition arg z π/2. | |≤ 8.5.8 Related to the exponential integral (Eq. (8.71)) by a simple change of variable is the function xt ∞ e− En(x) dt. = tn 1 Show that En(x) satisfies the recurrence relation

1 x x En 1(x) e− En(x), n 1, 2, 3,.... + = n − n = 8.5.9 With En(x) as defined in Exercise 8.5.8, show that En(0) 1/(n 1), n>1. = − 8.5.10 Develop the following power-series expansions:

π ∞ ( 1)nx2n 1 (a) si(x) − + , =−2 + (2n 1)(2n 1) n 0 = + + ! ∞ ( 1)nx2n (b) Ci(x) γ ln x − . = + + 2n(2n) n 1 = ! 8.5.11 An analysis of a center-fed linear antenna leads to the expression x 1 cos t − dt. t 0 Show that this is equal to γ ln x Ci(x). + − 8.5.12 Using the relation Ŵ(a) γ(a,x) Ŵ(a,x), = + show that if γ(a,x) satisfies the relations of Exercise 8.5.2, then Ŵ(a,x) must satisfy the same relations. 8.5.13 (a) Write a subroutine that will calculate the incomplete gamma functions γ(n,x)and Ŵ(n,x) for n a positive integer. Spot check Ŵ(n,x) by Gauss–Laguerre quadratures. (b) Tabulate γ(n,x)and Ŵ(n,x) for x 0.0(0.1)1.0 and n 1, 2, 3. = = 8.5.14 Calculate the potential produced by a 1S hydrogen electron (Exercise 8.5.4) (Fig. 8.10). Tabulate V(r)/(q/4πε0a0) for x 0.0(0.1)4.0. Check your calculations for r 1 and for r 1 by calculating the limiting= forms given in Exercise 8.5.4. ≪ ≫ 8.5.15 Using Eqs. (5.182) and (8.75), calculate the exponential integral E1(x) for (a) x 0.2(0.2)1.0, (b) x 6.0(2.0)10.0. = = Program your own calculation but check each value, using a library subroutine if avail- able. Also check your calculations at each point by a Gauss–Laguerre quadrature. 8.5 Additional Readings 533

FIGURE 8.10 Distributed charge potential produced by a 1S hydrogen electron, Exercise 8.5.14.

You’ll find that the power-series converges rapidly and yields high precision for small x. The asymptotic series, even for x 10, yields relatively poor accuracy. = Check values. E1(1.0) 0.219384 = 6 E1(10.0) 4.15697 10 . = × − 8.5.16 The two expressions for E1(x), (1) Eq. (5.182), an asymptotic series and (2) Eq. (8.75), a convergent , provide a means of calculating the Euler–Mascheroni con- stant γ to high accuracy. Using double precision, calculate γ from Eq. (8.75), with E1(x) evaluated by Eq. (5.182). Hint. As a convenient choice take x in the range 10 to 20. (Your choice of x will set a limit on the accuracy of your result.) To minimize errors in the of Eq. (8.75), accumulate the positive and negative terms separately. ANS. For x 10 and “double precision,” γ 0.57721566. = = Additional Readings

Abramowitz, M., and I. A. Stegun, eds., Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables (AMS-55). Washington, DC: National Bureau of Standards (1972), reprinted, Dover (1974). Contains a wealth of information about gamma functions, incomplete gamma functions, exponential integrals, error functions, and related functions — Chapters 4 to 6. Artin, E., The Gamma Function (translated by M. Butler). New York: Holt, Rinehart and Winston (1964). Demon- strates that if a function f(x) is smooth (log convex) and equal to (n 1) when x n integer, it is the − ! = = gamma function. Davis, H. T., Tables of the Higher Mathematical Functions. Bloomington, IN: Principia Press (1933). Volume I contains extensive information on the gamma function and the polygamma functions. Gradshteyn, I. S., and I. M. Ryzhik, Table of Integrals, Series, and Products. New York: Academic Press (1980). Luke,Y.L.,The Special Functions and Their Approximations, Vol. 1. New York: Academic Press (1969). Luke, Y. L., Mathematical Functions and Their Approximations. New York: Academic Press (1975). This is an updated supplement to Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables (AMS-55). Chapter 1 deals with the gamma function. Chapter 4 treats the incomplete gamma function and a host of related functions.