COMPUTING THE EULER S CONSTANT: A HISTORICAL OVERVIEW OF ALGORITHMS AND RESULTS GONÇALO MORAIS Abstract. We preted to give a broad overview of the algorithms used to compute the Euler s costat. Four type of algorithms are usually cosidered, those derived from Euler s summatio formula, algorithms based o cotiued fractios ad expoetial itegral methods, i which we iclude the Gamma fuctio derivatio ad Bessel s fuctio methods. All these methods ad the respective aalytical results are treated i detail. Itroductio The existece of Euler s costat was stated by himself i [2], where he advaced the first 5 exact decimals of such umber. As is widely ow, origially Euler refer to this costat by the letter c ad ot by the more tradicioal γ itroduced later. Although the historic aspect of this paper, we use the traditioal otatio, which by some way emphasize the relatio betwee these costat ad the Euler s Γ fuctio. Before we proceed, cosider the harmoic umbers H = From these, we defie the Euler s costat γ as the limit ( γ = lim l = lim (H l. ( = At a first glace is ot that obvious that the harmoic umbers H may grow ulimited as or that the limit i ( exists. The first poit is very easy to otice by the rule (see [6], page 75 for further details =. H 2 + H 2 + 2 + 2. The same reasoig let us deduce also a upper boud to the growth of the harmoic umbers state by H 2 + H 2 + +. These relatios express that, although the harmoic umbers go ulimited, they also have a upper boud for their icreasig. Key words ad phrases. Euler s costat, algorithms. 2 l 2 H 2 + l 2 + l 2. (2
2 GONÇALO MORAIS The iequalities i (2 show that H2 ad l 2 have both a liear growth, as l 2 = O(. This observatio helps to realize why the limit i ( might exist. (For a review about the O-otatio see [6], pages 7. Ideed, cosider the equality = x t dt = = By the power series expasio of l( + x we get ( γ = lim O 2 <. = ( ( l +. (3 Later, usig the Euler s summatio formula we may also deduce the existece of the geeralized Euler s costats or Stirlig s costats ( l m γ m = lim lm+. m + = A more detailed wor is preseted related with the existece of what we called the Dirichelet umbers give by ( ( γ s = lim H s x s dx = lim H s ( s s, (4 where H, s with s (,, are the umbers give by the diverget Dirichelet series H s = s. = The existece of these umbers is also predictable from the Euler s summatio formula. From computatioal experimets, it seams clear that the covergece of these umbers by usual methods applied to the Euler s costat is very slow. So, altough they do ot represet some great advace from the theoretical poit of view, their computatio represet a challegig problem. 2. Basic Notios 2.. Euler s Γ fuctio. The usual defiitio of Euler s Γ fuctio i calculus boos is give by the itegral expressio Γ(x = t x e t dt. (5 Euler s origial idea was to geeralize the factorial to ay real umber. He came up with the expressio (see [6], page 49, for a detailed discussio m m!! = lim m ( + ( + 2... ( + m. This formula is valid oly for positive itegers. Legedre itroduced a more usual otatio Γ(x to the geeralized factorials, which is easily deduced
from the previous expressio COMPUTING THE EULER S CONSTANT 3 Γ(x = lim m m x m! x(x + (x + 2... (x + m m x = lim m x( + x ( + x ( 2... + x, m valid for all real or complex umbers except for egative itegers. The relatio betwee the expressios (5 ad (6 is clear by establishig the equality Γ m (x = m x m! (x + (x + 2... (x + m = m ( t m m t x dt. Lettig m we get the desired relatio. I [], page 6, is preseted a differet proof of the equality betwee the two defiitios of Γ, based o its relatio with the beta fuctio. However, the relatio preseted i here is more costructive ad self cotaied, without the ecessity of the itroductio of other defiitios. We itroduced the Γ fuctio. As we will see, this fuctio has very importat role i the calculatio of γ. Perhaps the simplest relatio derives from the simple fact m x = e x l m = e x(l(m /2... /m e x+x/2+...+x/m. From this poit, we are able to obtai the Weirstrass formula, valid for x > ( Γ(x = xeγx + x e x/. (7 = I order to get a similar formula for the Stirlig s umbers, cosider the expressio ( m + lm+ Γ p (x = m + lm+ x( + x... + x p p x = = m + logm+ x( + x... ( + x/p m + lm+ p x. From the previous expressio, cosider oly the last portio. From it we get ( l m + lm+ p x = x m+ m+ p m + lm... lm p p ( l + x m+ m (8 +... + lm p. p So fially, lettig p, we get a geeral expressio for the relatio betwee the Stirlig s umbers ad the Euler s Γ fuctio by lm+ Γ(x = m + m + lm+ x + l m+ ( + x/ m + + x m+ γ m x m+ = = l m. (6 (9
4 GONÇALO MORAIS Notice that whe m =, with γ = γ, from (9 we get the equivalet expressio to the Weirstrass formula i (7 l Γ(x = l x + xγ + [ ( l + x x ]. ( = It would be atural to as if we ca get also a relatio betwee the Euler s Γ fuctio ad the Dirichelet s umber s defied i (4. Such relatio exist ad is valid for the more geeral Riema s Zeta fuctio defied by ζ(x = = x. The followig theorem give the exact terms of the relatio betwee these two fuctios. Theorem. Let ζ(x represets the Riema s Zeta Fuctio. The ζ(x is related with Γ(x by the equality ζ(x = Γ(x t x e t dt. Proof. The proof of this result is elemetary ad we just preset the its highlights. Cosider the itegral defiitio of Γ(x give i (5. Chagig the variable to t = u, with N, we will get Summig over we will get x = Γ(x ζ(x = Γ(x u x e u du. ( u x e u du. Simplifyig the fractio withi the itegral, we get the desired result. 2.2. Beroulli s umbers ad Polyomials. The Beroulli umbers ad respective polyomials are a fudametal tool i the Euler s summatio formula. To get a full overview, see for example [4], pages 283 29. They arise as the ceofficiets of the power series of x e x = x B!. = Simple calculatios allow us to coclude that for we have B 2+ =. These are based o the eveess of the fuctio x e x + x 2 = x e x + 2 e x = x e x + 2 e x. The Beroulli umbers pocess a importat property (see [6], page 3 for details, expressed by m ( m B = B m + δ m, ( = where δ ij is the Kroecer delta. This property is very importat to establish the cotiuity of the Beroulli polyomials, defied i the followig way.
COMPUTING THE EULER S CONSTANT 5 Defitio. The m-th Beroulli polyomial, deoted by B m (x is the polyomial defied by the expressio m ( m B m (x = B x m. = By ( we get immediately B m ( = B m ( = B m for m >. Cosider {x} = x (mod. The previous equality show that the Beroulli polyomials B M ({x} are cotiuous. Aother importat property of Beroulli polyomials, related with this result, is obtaied by the derivative B m(x = mb m (x B m (x dx = m B m(x. So give a fuctio f with eough smoothess, from the previous observatios, itegratig by parts, we get B m ({x}f (m (x dx = B [ ] m+ f (m ( f (m ( m! (m +! (2 B m+ ({x}f (m+ (x dx. (m +! This formula will be of great importace i the deductio of a algorithm to compute γ i sectio 3.3. 3. Euler s summatio Formula 3.. Euler s summatio formula. We ca use itegrals to get a approximatio of the value of a umerical series. I the case where the series has a quite simple expressio, as i the case of Dirichelet series, is very easy to deduce a expressio to evaluate it. Although we ca deduce a symbolic expressio to the sum of the Dirichelet s series with eve expoet (see [4], page 286, we may also fid out easily a umeric approximatio to this value. Propositio. Cosider a series of Dirichelet with expoet α >. The there are a lower-boud m ad a upper-boud M for the rest of order give by M = α α ad m = α ( + α. Proof. The proof is trivial from some cosideratios about the sum of the series ad the use of improper itegrals. It is very easy to verify the validity of the iequality + (x + α dx = α + dx. (3 xα Maig the calculatios of the itegrals we get the values for a upper-boud ad a lower-boud of the error of trucatio α ( + α α α α = from where we ca fid the desirable values for the upper-boud ad lowerboud of the error of trucatio i the sum of Dirichelet series.
6 GONÇALO MORAIS From Propositio we are able to fid a iterval where is the sum of a Dirichelet series. This is easily deduced usig the iequality (3 because + α + (x + α dx α + α + x α dx. = = This expressio is quite useful because from it we may deduce the formula for the evaluatio of the sum of a Dirichelet series with expoet α α α + α ( + α. = = Usig this formula we are able to mae the coclusio about the value of the error of trucatio i the sum of the Dirichelet series. I fact, this error will be bouded by ε ( α α ( + α. We may trasform this formula for the error ito exact decimals by doig the simple logarithm trasformatio ( [ ] l α α ( + ( α = l(α l α ( + α. Now that we dealt with the rest of a certai order of a coverget series, we wat to ow how to evaluate, as fast as possible, the sum of the first terms of the same series. We itroduce oe fudametal result to evaluate the partial sum of a series, the so called Euler s summatio formula. Theorem 2 (Euler s summatio formula. Give a fuctio f, the we may evaluate the -partial sum of the series f( by f( = = = = f(x dx 2 (f( f( + B ({x}f (x dx, (4 where {x} = x mod ad B (x = x 2. Proof. We preset just the fudametal step of the proof (for further details see [6], pages -2. Cosider the itegral + ( {x} f (x dx = 2 + 2 (f( + + f( f(x dx. If we sum over we will get the desired form of the Euler s summatio stated above. 3.2. Cosequeces of Euler s summatio formula. Although the method preset i propositio is very good to fid a upper value for the rest of a covergete series, it is quite uappropriate to deal with series with more geeral term or with certai aspects related with diverget series. With Euler s summatio formula we are able to formulate a more geeral problem about the existece of certai costats related by the limit of the differece of two diverget sequeces. Ideed, by Euler s summatio formula, if oe of
COMPUTING THE EULER S CONSTANT 7 the sequeces is a diverget series, it gives a straight formula for the secod sequece ad a polyomial based o the Beroulli s umbers to fast evaluate it. Applyig the Euler s summatio formula to the harmoic umbers we get the expressio = l ( 2 + B ({x} x 2 dx, (5 = where B (x = x /2 (this otatio will be clear soo. From equatio (5 we may speculate the existece of a costat γ give as the limit ( γ = lim l = lim (H l. = Evaluatig the itegral i equatio (5 we fid aother expressio for the Euler s costat give by γ = 2 2 2 = ( l + ( + ( 2. (6 We have a sesible problem i here, because from equatio (6 is ot obvious the existece of the series ivolved. The proof of the covergece, ad thus of the existece of the Euler s costat, will be give i sectio 3.3. Ideed, equatio (5 does ot oly gives the sequeces but will also give a very good method to evaluate it. It is atural to as if to ay diverget sequece there is aother oe such that its differece remais fiite ad strictly positive. Cojecture. Let a be a strictly positive sequece such that a +. Cosider also the strictly positive sequeces b ad c with b = O(c, verifyig b < a < c. The there is a costat α (, ] such that lim (a b = α. 3.3. Kuth s Computatio. Cosider ow the Beroulli umbers ad respectives polyomials, very useful to evaluate the Euler s summatio formula. Usig the property of the Beroulli s polyomials B m(x = mb m (x ad itegratig by parts the Euler s formula i (4, we deduce that f( = = where f(x dx + m = R m = ( (m+ m! B! (f ( ( f ( ( + R m, (7 B m ({x}f (m (x dx. It is possible to show that R m is very small whe m is very large, due to the fact that (see [4], pages 473 475, for a detailed discussio B m ({x} m! B m 4 m! (2π m.
8 GONÇALO MORAIS From this poit is very easy to deduce a formula for the calculatio of γ with a error of the order of O(/ m+ by the simple expressio H = l + m + γ + ( ( B + O m+. (8 = By the fact that all the odd Beroulli umbers are ull, we may deduce that for m = 6, the equatio (8 is equivalet to with < ε < /252 6. H = l + γ + 2 2 2 + ε, (9 24 3.4. Existece of other costats. From equatio (7 we may speculate the existece of other costats arisig from the sum of divergete series lie H s = s, = with s (,. I fact, equatio (7 states the possibility of the existece of a costat γ s for each s (, from the limit ( ( γ s = lim H s x s dx = lim H s ( s s. (2 For example, for s = /2, the equatio (2 is equivalet to ( γ = lim 2(. 2 = To prove the existece of the geeral costats γ s, we eed to prove the existece of the limit lim R m, which is equivalet to say that + B m ({x} f (m (x dx < +. Whe f(x = x s, the last expressio is equivalet to + Γ(s + mb m ({x} Γ(sx s+m dx < +. 4. Expoetial Itegral Methods As we saw i the itroductio to this paper, there are several possible approachs to the defiitio of Euler s Γ fuctio. As we saw before, a otrivial relatio betwee Euler s Γ fuctio ad Euler s γ costat is stated by the Weirstrass formula Γ(x = xeγx = (( + x e x/, (2 with x >. Taig the logarithms ad differetiatig the expressio (2, we obtai Γ (x Γ(x = x + γ + ( + x. =
COMPUTING THE EULER S CONSTANT 9 Give differet values for x we get differet expressios to evaluate the Euler s costat. If x N we have a formula for the value of Γ ( give by [( ] Γ ( = (! γ. (22 We saw i sectio 2. Γ( =. Usig this fact, from (22 we get the ice formula ( Γ ( = + γ + +. (23 = = The series i equatio (23 is telescopic whose sum is give by ( + =. = So we get the simple ad elegat expressio for the relatio betwee the Euler s costat ad the Euler s fuctio give by γ = Γ (. We reduced the problem of fidig the value of the Euler s costat to the problem of fid a fast coverget series that evaluates the itegral Γ ( = To compute the itegral i (24 we split it ito the sum e t l t dt e t l t dt. (24 e t l t dt + ( + e. (25 I the followig deductios we follow closely the reasoig of E. Karatsuba i [5]. For t ad m there is θ (, such that we get directly I = e t = e t l t dt = 2m = 2m = ( t! + θ t2m 2m!, t l t dt +! θ t2m l t dt. (26 (2m! If we deote the secod itegral by R(, because θ, we obtai R( t 2m l t dt (2m! t 2m = (2m! ( 2m+ = O (2m!. l t dt + t 2m l t dt (2m! (27 Deotig the secod itegral i (26 by I ad itegratig by parts, we get 2m ( 2m I = t ( [ ] + l t dt =!! + l + ( + 2 (28 = =
GONÇALO MORAIS We have completely determied a expressio to compute γ usig a expoetial itegral method. Combiig (25, (27 ad (28 we get the value for Γ ( such that allow us to mae the coclusio γ = 2m = (! [ + ( + 2 + + l ] ( 2m+ +O (2m! +O((+e. (29 I [5], Karatsuba computes a particular case for equatio (22 with = 2 ad got a alogous formula of (29 usig the relatio γ = Γ (2. Refereces [] George E. Adrews, Richard Asey ad Raja Roy, Special Fuctios, Ecyclopedia of Mathematics ad its Applicatios, Cambridge Uiversity Press, 999. [2] L. Euler, Methodus geeralis summadi progressioes, Origially published i Commetarii academiae scietiarum Petropolitaae 6, 738, pp. 68-97. [3] Do Redmod, Number Theory A Itroductio, Marcel Deer, Ic., 996 [4] Roald L. Graham, Doald E. Kuth ad Ore Patashi, Cocrete Mathematics, Secod Editio, Addiso-Wesley, 994. [5] E.A. Karatsuba, O the computatio of the Euler s costat γ, Numerical Algorithms 24 (2, pp 83-97. [6] Doald E. Kuth, The Art of Computer Programmig, Volume, Fudametal Algorithms, Third Editio, Addiso-Wesley, 997. [7] M. Ram Murty, Problems i Aalytic Number Theory, Graduated Texts i Mathemathics, vol. 26, Spriger, 2. [8] E.T. Whittaer ad G.N. Watso, A Course of Moder Aalysis, Cambridge Uiversity Press, Lodo, 958. Cetro de Matemática e Aplicaes E-mail address: grm@fct.ul.pt URL: http://gupost.com/gmorais