Steve R. Dubar Departmet of Mathematics 23 Avery Hall Uiversity of Nebraska-Licol Licol, NE 68588-3 http://www.math.ul.edu Voice: 42-472-373 Fax: 42-472-8466 Topics i Probability Theory ad Stochastic Processes Steve R. Dubar Stirlig s Formula Derived from the Gamma Fuctio Ratig Mathematicias Oly: prologed scees of itese rigor.
Sectio Starter Questio Do you kow of a fuctio defied for, say the positive real umbers, which has the value! for positive itegers? Key Cocepts. Stirlig s Formula, also called Stirlig s Approximatio, is the asymptotic relatio! 2π +/2 e. 2. The formula is useful i estimatig large factorial values, but its mai mathematical value is i limits ivolvig factorials. 3. The Gamma fuctio is geerally defied as Γ(z) = For a iteger, Γ() = ( )!. x z e x dx. Vocabulary. Stirlig s Formula, also called Stirlig s Approximatio, is the asymptotic relatio! 2π +/2 e. 2
2. The Gamma fuctio is geerally defied as Γ(z) = For a iteger, Γ() = ( )!. x z e x dx. Mathematical Ideas Stirlig s Formula, also called Stirlig s Approximatio, is the asymptotic relatio! 2π +/2 e. The formula is useful i estimatig large factorial values, but its mai mathematical value is i limits ivolvig factorials. Aother attractive form of Stirlig s Formula is:! ( ) 2π. e A improved iequality versio of Stirlig s Formula is 2π +/2 e +/(2+) <! < 2π +/2 e +/(2). () See Stirlig s Formula i MathWorld.com. First we formally defie the Gamma fuctio ad its most importat property. The we give a heuristic argumet for Stirlig s formula for the Gamma fuctio usig asymptotics of itegrals, based o some otes by P. Garrett, []. Here we rigorously derive Stirlig s Formula usig the Gamma fuctio ad estimates of the logarithm fuctio, based o the short ote by R. Michel, [2]. 3
Defiitio of the Gamma Fuctio Lemma (Gamma Fuctio).! = x e x dx. Proof. The proof is by iductio. Start with =, x e x dx = The i geeral, itegratig by parts e x dx = =!. Iductively, x e x dx =! = x e x dx. x e x dx. Remark. The Gamma fuctio is geerally defied as Γ(z) = x z e x dx. The the same itegratio by parts shows Γ(z) = (z )Γ(z ). For a iteger, Γ() = ( )!. Heuristic Derivatio of Stirlig s Formula from Asymptotics of Itegrals Observe that Γ(z + ) = x z e x dx = e x+z log x dx. Note that x + z log x has a uique critical poit at x = z. The critical poit is a maximum sice the secod derivative has value /z < there. The idea is to replace x + z log x by its secod degree Taylor polyomial 4
based at z, the evaluate the resultig itegral. Note that the secod degree Taylor polyomial is the quadratic polyomial best approximatig a fuctio. The idea is that most of the cotributio to the itegral comes from the maximum, ad because of the egative expoetial, cotributio away from the maximum is slight. So expad x+z log x i a secod-degree Taylor polyomial at the critical poit z: x + z log x z + z log z 2!z (x z)2. Thus we ca approximate the Gamma fuctio with Γ(z + ) = zγ(z) = e x+z log x dx (2) z+z log z e 2!z (x z)2 dx = e z z z e (x z)2 /2z dx e z z z e (x z)2 /2z dx. Note that last evaluatio of the itegral is over the whole real lie. By Lemma 4 of DeMoivre-Laplace Cetral Limit Theorem e (x z)2 /2z dx 2z e z/4. This is very small for large z, so heuristically the asymptotics of the itegral over the whole lie is of the same order as the itegral over [, ). To simplify the itegral, replace x by zu. Notice that a factor of z cacels from both sides Γ(z) = e z z z e z(u )2 /2 du. Make aother chage of variables x = z(u ) so that e z z z e z(u )2 /2 du = e z z z z e x2 2 dx = e z z z 2π z. The last equality is derived i Evaluatio of the Gaussia Desity Itegral. 5
Simplifyig, Γ(s) 2πe z z z /2. As a alterative, oe ca apply Laplace s method (for asymptotics of itegrals) to the itegral i (2) ad derive the same coclusio somewhat more rigorously. Rigorous Derivatio of Stirlig s Formula Lemma 2. where g (y) =! = e g (y) dy ( + y ) e y (, ) (y). Proof. I Lemma make the substitutio x = y + (or equivaletly y = x ) with dx = dy to give x e x dx = (y + ) e (y +) dy = e (y/ + ) (y) e dy = e g (y) dy. Remark. This meas that what remais is to show the itegral g (y) dy approaches the asymptotic costat 2π. Lemma 3. For x <, log( + x) x + 2 x2 x 3 3 x. 6
Figure : A graph of the fuctios i Lemma 3 with log( + x) x + x2 i 2 red ad x 3 i blue. 3 x Remark. Note further that x 3 x x 2 (3) for x /2. This will be used later to simplify the expressio o the right side of the iequality i Lemma 3. Proof. Expadig log( + x) i a Taylor series ad applyig the triagle iequality log( + x) x + x 3 2 x2 k. Grossly overestimatig each term by usig the least deomiator ad summig as a geometric series k=3 k=3 x 3 k x 3 3 x. 7
Lemma 4. Proof. e a e b e b a b e a b. e a e b = e b e a b Notice that e x = x k k= = x x k k! k= x k! k= x k = x x k (k )! k= = k! xe x. Alteratively let f(x) = e x ad g(x) = xe x. The f() = = g(), ad f (x) = e x e x + xe x = g (x) for x >. Likewise f (x) = e x e x + xe x = g (x) for x <. Therefore e x = f(x) g(x) = xe x for all x. The e b e a b e b a b e a b. Lemma 5. For y 2 g (y) e y2 /2 y 3 e y2 /6. Proof. For y 2 ( g (y) e y2 /2 = + y ) e y (, ) (y) e y2 /2 = elog + y y (, ) (y) e y2 /2. Usig y 2 = elog + y y e y2 /2. Usig Lemma 4 (( e y2 /2 log + y ) ) y + y 2 /2 e log the with rules of logarithms ( = e y2 /2 log + y ) y + y2 2 e 8 + y y +y 2 /2 log + y y + y2 2,,
ad usig Lemma 3 e y2 /2 y 3 / 3/2 3 y / e Makig a coarse estimate o the fractio e y2 /2 3 = e y2 /2 2 y 3 3 Use the remark after Lemma 3 3 y 3 / 3/2 y /. y 3 / 3/2 ( /2)/ e 3 e /2 = e y2 /2 2 y 3 3 e /2 3 y 2 y 3 / 3/2 y /. y 3 / 3/2 3 y / Combie the expoets ad coarsely over-estimate the fractio y 3 e y2 /6. Lemma 6. lim g (y) = e y2 /2 where the limit is uiform o compact subsets of R. Proof. For y 2 use Lemma5 g (y) e y2 /2 y 3 e y2 /6. Note that y 3 e y2 /6 has a maximum value of 27e 3/2. Let K be a compact subset of R with M be a boud so that K {x : x < M}. Let ɛ > be give. Let be so large that M < /2 ad 27e 3/2 / < ɛ. The for all y K, g (y) e y2 /2 y 3 e y2 /6 27e 3/2 / < ɛ. 9
Figure 2: A graph of the fuctios i Lemma 7 with log( + x) i red ad x (5/6)(x 2 )/(2 + x) i blue. Lemma 7. For x > x 2 log( + x) x 5 6 2 + x. Proof. Cosider f(x) = x 5 log( + x), with f x (x) = x 2 x+4. 6 2+x 6(+x)(2+x) 2 The oly critical poit o the domai x > is x =, ad f (x) < for < x <, f (x) > for x >. The f(x) has a global miimum value of at x =. Hece log(x) x 5 x 2. 6 2+x x 2 Remark. Ufortuately, although the proof is straightforward the origi of the ratioal fuctio o the right is umotivated. Lemma 8. g (y) e y /6, y > 2
Proof. For y >, log(g (y)) = log( + y 2 5 6 2 + y/ y ) y usig Lemma 7. For y > 2 ad o the domai y >, < 2+y/ 2 + y /, so 5 y 2 + y/ 5 y 2 + y /. Now sice y > 2, it is true that 4 y > 2, so 5 y > 2 + y or 5 y 2+ y / >. Fially multiplyig through by y /6, 5 6 y 2 2 + y/ 5 y 2 6 2 + y / < y 6 < y 6. Theorem 9 (Stirlig s Formula). Proof. By Lemma 2 where g (y) =! 2π +/2 e.! = e g (y) dy ( + y ) e y (, ) (y). From Lemma 6 lim g (y) = e y2 /2 uiformly o compact sets ad g (y) is itegrable by Lemma 8. Hece by the Lebesgue Covergece Theorem ad sice /2 e y2 dy lim lim g (y) dy = = 2π it follows that! = lim 2π e y2 /2 e dy g (y) dy 2π =.
Figure 3: A graph of the fuctios i Lemma with + ( + x 2) log( + x) i red ad x 4 i blue. 2 Asymptotic Expasios Lemma. For x > < + 2 ( x 2 + x x + ) log( + x) x4 2 2. x 2 2 +x Remark. Ufortuately, although the proof is straightforward the origi of the fuctio o the left is umotivated. Proof. Let f(x) = 2x + (x + 2) log( + x) for x > so f (x) = 6 +x x 3 x 2 x+2 log( + x) + 2. The f() =, ad f () =. 6 (+x) 2 2 2(+x) x+ Further f (x) = x 3 ad f (x) > for x >. Therefore, f(x) > for 3 (+x) 3 x > ad dividig through by 2x yields the left iequality. For the right side, cosider h(x) = x5 f(x). Agai h() = 6 h () =. Further h (x) = x3 x 3 > for x >. The right side iequality 3 3 (+x) 3 follows immediately. x 3 2
Lemma. For x >, e x + x + 2 x2 + 6 x3 e x. Proof. For x >, expadig e x i a Taylor series e x = + x + x k 2 x2 + k! k=3 = + x + 2 x2 + 6 x3 k=3 = + x + 2 x2 + 6 x3 + x + 2 x2 + 6 x3 k= k= x k 3 k!/6 x k (k + 3)!/6 x k k! sice (k + 3)!/6 k!. Lemma 2. e /24 6 2 3 944 Remark. Numerically e /24.5542925 ad.5932234, 6 2 3 944 so the differece is about 5 6. Proof. I do t have a rigorous proof based o, say, elemetary comparisos i the ratioal umber system. I fact, it is ot clear how the deomiator 944 arises. However, as will be see i the proof of Theorem 3 what is really eeded is that e /24 is a fiite costat. Fidig a ratioal umber 6 2 3 with uit umerator ad 4-digit deomiator to boud the costat is simply a coveiece. Theorem 3. For 2,! 2π +/2 e 2 288 + 2 994. 3 3
! Proof. Let a = 2π. The a +/2 e a + = ( ) ( ) + +/2 e a ad log a + = (+/2) log(+/). Usig the left iequality i Lemma with x = / The log ( a a +r ) = +r k= log ( a a + ) ( ) ak log +r a k+ 2 k= 2( + ). k(k + ) = ( 2 ). + r Now let r, otig that lim r a +r =, so log(a ) 2 ad a e /(2). Now use Lemma ad Lemma 2 to yield The a + 2 + 2 (2) + 2 6 + 2 + 2 (2) + 2 6 + 2 + 2 (2) + 2 944. 3! 2π +/2 e 2 2 (2) 3 e/(2) (2) 3 e/(2 2) (2) + 2 944. 3 Likewise, usig the right iequality i Lemma with x = / ( ) a log 2(( + )) 2. 4 The ( ) +r a log = a +r k= a + ( ) ak log +r a k+ 2 k= = 2 k(k + ) 2 ) ( + r Agai let r, otig that lim r a +r = to obtai log(a ) 2 2 k= k = 4 2 2 4 4 k=+ +r k= k 4 +r 2 k 4 2 2 k= k 4. 4 36 3
because k=+. k 4 Let r = 2 2 e r + r. Therefore, Equivaletly, Sice x 4 4 dx usig right-box Riema sums with width 36 3. Hece a e r. By a well-kow estimate a + 2 2 4 36 3! 2π +/2 e 2 36 3 2 36 + 3 2 the two iequalities ca be summarized as! 2π +/2 e 2 2 4 2 (2) + 2 944 3. 4 (2) + 2 944. 3 Remark. The proof actually shows the slightly stroger bouds 36 3 2! 4 2π +/2 e 2 2 (2) + 2 944. 3 Remark. Usig similar reasoig, from the well-kow estimate e r + r + 2 r2, oe ca derive the estimate! 2π +/2 e 2 288 2 36 + 3 8 4 valid for 3. Remark. Note that for =, sice e 2π.844 ad 3 2! 2π +/2 e = e 3 2π 2 = + 2.8334. Similarly for = 2! 2π +/2 e = e 2 2π 2 3/2 25 24 = + 2 2 5
e sice 2 2π 2 3/2.4227 ad 25 24 3.4664. From the remark above, for! 2π +/2 e 2 288 2 36 3 8 4 >. The for all,! 2π +/2 e + 2 which is a better boud tha e /(2+) quoted i equatio (). I order to see this boud, cosider f(x) = log( + x) 2x, defied for x >. The 2+x f x (x) = 2 ad f() =, f (x) > for x >. The log( + ) > (+x)(2+x) 2 2 2 >. Hece + > 24+ 2+ 2 e/(2+). Alterate Derivatio of Stirlig s Asymptotic Formula Note that x t e x has its maximum value at x = t. That is, most of the value of the Gamma Fuctio comes from values of x ear t. Therefore use a partitio of the Gamma Fuctio with t >, f(x) = x t e x for x >, ad A = {x : x t t/2}. The Γ(t + ) = = 3t/2 t/2 x t e x dx f(x) dx + A (x)f(x) dx where A ( ) is the idicator fuctio (or characteristic fuctio) of A. For x A, 4(x t) 2 /t 2, so we have A (x) 4(x t) 2 /t 2. The 3t/2 x t e x dx Γ(t + ) 4(x t) 2 x t e x dx Γ(t + ) t 2 t/2 4 Γ(t + )t 2 {x: x t t/2} (x t) 2 x t e x dx Expadig (x t) 2 ad usig Γ(z + ) = zγ(z) from the remark followig Lemma yields (x t) 2 x t e x dx = (t + 2)(t + )Γ(t + ) 2t(t + )Γ(t + ) + t 2 Γ(t + ). 6
The simplifyig the right side Γ(t + ) 3t/2 t/2 x t e x dx 42 + t Makig the chage of variables x = y t + t ad settig g t (y) = ( + y/ t) t e yt for y > t just as i the proof of Lemma2, we get lim t t t t t/2 g Γ(t + )e t t (y) dy =. (4) t/2 Now usig x /2 ad Lemma3 log( + x) x + 2 x2 x 3 3 x 2 3 x 3. t 2 The usig Lemma5 g t (y) e y2 /2 y 3 e y2 /6 t for y t/2. The t/2 g t (y) dy e y2 /2 dy t t/2 t/2 t/2 = 3 te t/24 2 y 3 e y2 /6 dy + e y2 /2 dy y > t/2 36e t/24 t + 36 t + y > t/2 e y2 /2 dy Therefore, t/2 lim g t t (y) dy = e y2 /2 dy = 2π. t/2 Combiig this with the limit i equatio 4, we have Γ(t + )e t lim =. t 2πt t+/2 7
Sources The mai part of this sectio is adapted from the short ote by R. Michel, [2]. The alterate derivatio is adapted from the eve shorter ote by R. Michel, [3]. Problems to Work for Uderstadig. Show that e y2 /2 dy = 2π. Readig Suggestio: Refereces [] Paul Garrett. Asymptotics of itegrals. Olie, accessed November 22, July 2. [2] Reihard Michel. O Stirlig s formula. America Mathematical Mothly, 9(4):388 39, April 22. [3] Reihard Michel. The ( + )th proof of Stirlig s Formula. America Mathematical Mothly, 5(9):844 845, November 28. 8
Outside Readigs ad Liks:. 2. 3. 4. I check all the iformatio o each page for correctess ad typographical errors. Nevertheless, some errors may occur ad I would be grateful if you would alert me to such errors. I make every reasoable effort to preset curret ad accurate iformatio for public use, however I do ot guaratee the accuracy or timeliess of iformatio o this website. Your use of the iformatio from this website is strictly volutary ad at your risk. I have checked the liks to exteral sites for usefuless. Liks to exteral websites are provided as a coveiece. I do ot edorse, cotrol, moitor, or guaratee the iformatio cotaied i ay exteral website. I do t guaratee that the liks are active at all times. Use the liks here with the same cautio as you would all iformatio o the Iteret. This website reflects the thoughts, iterests ad opiios of its author. They do ot explicitly represet official positios or policies of my employer. Iformatio o this website is subject to chage without otice. Steve Dubar s Home Page, http://www.math.ul.edu/~sdubar Email to Steve Dubar, sdubar at ul dot edu Last modified: Processed from L A TEX source o November 26, 22 9