Evaluation of Generalized Error Function via Fast-Converging Power Series

Abstract

A generalized form of the error function, G p ( x )= p Γ( 1/p ) 0 x e t p dt , which is directly associated with the gamma function, is evaluated for arbitrary real values of p>1 and 0<x+ by employing a fast-converging power series expansion developed in resolving the so-called Grandi’s paradox. Comparisons with accurate tabulated values for well-known cases such as the error function are presented using the expansions truncated at various orders.

Share and Cite:

Beji, S. (2024) Evaluation of Generalized Error Function via Fast-Converging Power Series. Advances in Pure Mathematics, 14, 495-514. doi: 10.4236/apm.2024.146028.

1. Introduction

In the fourth volume of the Mécanique Céleste, Laplace (1749-1827), treating the refraction of light on the hypothesis of uniform temperature, makes use of the integral T e t 2 dt and, besides stating that 0 e t 2 dt= π /2 , develops a continued fraction solution to it ([1], pp. 485-493):

T e t 2 dt= e T 2 / 2T 1+ q 1+ 2q 1+ 3q 1+ (1)

where q=1/ 2 T 2 and q should not exceed 1/4 or equivalently T should be greater than 2 to get good results; otherwise, alternative series solutions are suggested. The most commonly used form of this particular integral is known as the error function:

erf( x )= 2 π 0 x e t 2 dt (2)

for which various series solutions and approximations are available. Two generalized forms of the error function are defined as ([2], p. 297):

y= e x p x e t p dt,y= e x p 0 x e t p dt. (3)

where p=2,3,4, . Euler’s integral for the gamma function ([3], p. 500) is

Γ( z )= 0 + e s s z1 ds,( z )>0. (4)

Let z=1/p where, like z, p may be complex although treated here as real, and introduce a change of variable such that s= t p so that ds=p t p1 dt . Noting that s z1 = s 1/p 1 = t p( 1/p 1 ) = t 1p and substituting the new variables into (4) give

( 1/p )Γ( 1/p )= 0 + e t p dt (5)

which is introduced here as a new definition of the gamma function. In accord with Equation (5), the present work goes a step further and considers the normalized integral function

G p ( x )= 1 G p ( + ) 0 x e t p dt= p Γ( 1/p ) 0 x e t p dt (6)

with real p>1 and 0<x+ . The normalized integral function is designated by G p ( x ) due to its close affinity with the gamma (factorial) function Γ( 1/p )=p G p ( + ) as can be seen from (5) and (6). Furthermore, for p=2 Equation (6) becomes identical with the error function given in (2). Here, a fast-converging power series solution valid for the entire range of 0<x+ is developed for G p ( x ) by making use of a consistent and convergence improved series expansion introduced in the resolution of Grandi’s paradox [4]. The same approach was previously used for obtaining a series solution to the exponential integral E 1 ( x )= x t 1 e t dt with very satisfactory results [5]. This particular integral, which is also related to the gamma function, was transformed to a form that required a fast-converging and accurate expansion of 1/ ( 1+u ) for its evaluation. Equation (6) is likewise elaborated into integrals containing 1/ ( 1+u ) β with β=11/p hence is evaluated with the aid of expansions introduced in Beji [4] for the resolution of Grandi’s paradox. In order to clarify the underlying methodology, a brief account of the Grandi’s paradox and its resolution is addressed next.

2. Grandi’s Paradox and Its Resolution

Grandi (1671-1742) is known by his book entitled briefly as Quadratura, which essentially lacks originality except for two particular items: construction of a curve later named as the Witch of Agnesi and statement of a paradox associated with the series expansion of 1/ ( 1+u ) within 0u1 . The paradox has become well-known and named after Grandi [6]. The series expansion of 1/ ( 1+u ) , either by simple division or Maclaurin series, can be easily established for 0u1 and a straightforward manipulation described in [4] (multiply both sides by u and redefine u1/u ) gives the corresponding convergent series for 1u+ :

1 1+u =1u+ u 2 u 3 + u 4 u 5 +for0u1 (7a)

1 1+u = 1 u 1 u 2 + 1 u 3 1 u 4 + 1 u 5 for1u+ (7b)

The paradox arises when u is set to unity, u=1 , which renders the left side 1/2 while the right side becomes either 0 or 1, depending on the number of terms kept in the expansion. Beji [4] introduced the consistent truncation and convergence improvement technique to resolve the paradox. Thus, instead of equations given in (7), the following series expansions were developed.

1 1+u =1+ 1 2 N m=1 N [ k=m N ( N k ) ] ( 1 ) m u m for0u1 (8a)

1 1+u = 1 u + 1 2 N m=1 N [ k=m N ( N k ) ] ( 1 ) m 1 u m+1 for1u+ (8b)

where N is the order of truncation. The new forms (8) give exactly 1/2 when u is set to unity for all the orders of expansion. A remarkable feature of the new series expansions is the change of coefficients depending on the order of truncation. Specifically, the coefficients are re-adjusted for each truncation order to give a highly accurate expansion of the generating function. Note also that the convergence of series (8a) (8b) are ensured since the positive powers for u1 and negative powers for u1 are used. As to the case u=1 , both expansions yield exactly 1/2 for any order of truncation N and terminate the inconsistency, which is the origin of the paradox. Applications of this technique to various Grandi-type functions with real and complex arguments can be found in [4] [7].

Figure 1 compares the third- and fourth-order series expansions of (7) and (8) against the exact expression 1/ ( 1+u ) . Smooth and accurate approximations obtained from (8), which are virtually inseparable from 1/ ( 1+u ) , are quite satisfactory when compared with (7).

3. Development of Series Solution

Integral stated in (4) is first split into two parts as

G p ( + ) G p ( x )= 0 x e t p dt= 0 1 e t p dt+ 1 x e t p dt= I 0 + I 1 (9)

where, by definition, I 0 = 0 1 e t p dt and I 1 = 1 x e t p dt . Integral I 0 , being in the range of 0 to 1, is fairly easily evaluated by employing a straightforward series expansion of e t p . On the other hand, integral I 1 , which implicitly assumes x>1 , requires some novelty for its evaluation.

3.1. Evaluation of I 0 = 0 1 e t p dt

Using the standard series expansion of exponential function gives

Figure 1. Function 1/ ( 1+u ) (black), third- and fourth-order series expansions according to (0) (blue, green) and (0) (red, orange).

I 0 = 0 1 e t p dt= 0 1 ( 1 t p 1! + t 2p 2! t 3p 3! + t 4p 4! t 5p 5! + )dt = t t p+1 ( p+1 )1! + t 2p+1 ( 2p+1 )2! t 3p+1 ( 3p+1 )3! +| 0 1 =1 1 ( p+1 )1! + 1 ( 2p+1 )2! 1 ( 3p+1 )3! + (10)

which is absolutely convergent as long as the upper limit of integration is equal to or less than one, as is the case here. A quite similar expression corresponding to the error function, p=2 , for an arbitrary upper limit can be found in ([2], p. 297).

3.2. Evaluation of I 1 = 1 x e t p dt

In order to evaluate I 1 some preliminary arrangements and splitting of it into separate integrals are necessary. First, introduce a change of variable t p =v hence dt= dv/ [ p v 11/p ] and define β=11/p for ease of notation so that

I 1 = 1 x e t p dt= 1 p 1 x p e v v β dv (11)

Note that 0<β<1 since p>1 and for the special case of the error function p=2 hence β=1/2 . Let v=u+1 ,

I 1 = 1 p 0 x p 1 e ( 1+u ) du ( 1+u ) β = 1 pe [ 0 1 e u du ( 1+u ) β + 1 x p 1 e u du ( 1+u ) β ] (12)

Define the first integral within the brackets as

I 10 = 0 1 e u du ( 1+u ) β (13)

Since 0u1 , I 10 is going to be treated by employing series expansion (8a). The second integral within the brackets is split into two parts as

1 x p 1 e u du ( 1+u ) β = 1 x p e u du ( 1+u ) β x p 1 x p e u du ( 1+u ) β = I 11 I 12 (14)

where, by definition,

I 11 = 1 x p e u du ( 1+u ) β , I 12 = x p 1 x p e u du ( 1+u ) β (15)

I 12 is elaborated further with two successive changes of variables; first u=y+ x p 1 then y= x p u ¯ , and finally u ¯ is renamed as u so that

I 12 = x p 1 x p e u du ( 1+u ) β =x e 1 x p 0 1/ x p e x p u du ( 1+u ) β (16)

Considering the entire I 1 ,

( pe ) I 1 = 0 1 e u du ( 1+u ) β + 1 x p e u du ( 1+u ) β x e 1 x p 0 1/ x p e x p u du ( 1+u ) β = I 10 + I 11 I 12 (17)

Integrals I 10 , I 11 , and I 12 are now evaluated in succession by employing the improved series expansions defined in (8) for 1/ ( 1+u ) .

3.2.1. Evaluation of I 10 = 0 1 [ e u / ( 1+u ) β ]du

In order to evaluate I 10 it is necessary to express 1/ ( 1+u ) β as a power series and to do so we first employ the improved series expansion of 1/ ( 1+u ) as given in Equation (8a) for the range 0u1 . Let g( u )=1/ ( 1+u ) so that

g( u )= 1 1+u =1+ 1 2 N m=1 N [ k=m N ( N k ) ] ( 1 ) m u m = C 0 + m=1 N C m u m (18)

where, by definition,

C 0 =1, C m = ( 1 ) m 2 N k=m N ( N k )form=1,2,,N (19)

We now establish f( u )= g β ( u )=1/ ( 1+u ) β = [ C 0 + m=1 N C m u m ] β as a Maclaurin series truncated at a definite order N:

f( u )=f( 0 )+ f ( 0 )u+ f ( 0 ) 2! u 2 + f ( 0 ) 3! u 3 ++ f ( N ) ( 0 ) N! u N (20)

As a demonstration, taking N=3 gives

f= g β =1, f =β g β1 g , f =β( β1 ) g β2 g 2 +β g β1 g , f =β( β1 )( β2 ) g β3 g 3 +3β( β1 ) g β2 g g +β g β1 g (21)

in which the functions are to be evaluated at u=0 . Use of g( u )= C 0 + m=1 N C m u m results in

f( 0 )= C ^ 0 =0! C 0 =1, f ( 0 )=β C ^ 0 C ^ 1 , f ( 0 )=β( β1 ) C ^ 0 C ^ 1 2 +β C ^ 0 C ^ 2 , f ( 0 )=β( β1 )( β2 ) C ^ 0 C ^ 1 3 +3β( β1 ) C ^ 0 C ^ 1 C ^ 2 +β C ^ 0 C ^ 3 (22)

where C ^ m =m! C m and C m ’s are as defined in Equation (19). m! multiplying C m arises from successive differentiations of the polynomial function g( u ) given in (18). A practical method of carrying out higher derivatives of f= g β evaluated at u=0 is developed in Appendix A. For ease of notation we define a set of new coefficients:

D 0 = f( 0 )/ 0! = C ^ 0 =1 D 1 = f ( 0 )/ 1! = β C ^ 0 C ^ 1 / 1! D 2 = f ( 0 )/ 2! = [ β( β1 ) C ^ 0 C ^ 1 2 +β C ^ 0 C ^ 2 ]/ 2! , D 3 = f ( 0 )/ 3! = [ β( β1 )( β2 ) C ^ 0 C ^ 1 3 +3β( β1 ) C ^ 0 C ^ 1 C ^ 2 +β C ^ 0 C ^ 3 ]/ 3! D N = f ( N ) ( 0 )/ N! = (23)

With the use of above coefficients in Equation (20) a power series for 1/ ( 1+u ) β for the range 0u1 is obtained. A simple manipulation, described for Equations (7b) and (8b), gives the corresponding expression for the range 1u+ . First, changing the variable by setting u=1/ u ¯ , then dividing both sides by u ¯ β and finally renaming u ¯ as u again, renders the series valid for 1u+ . Thus,

1 ( 1+u ) β = D 0 + D 1 u+ D 2 u 2 + D 3 u 3 ++ D N u N for0u1 (24a)

1 ( 1+u ) β = D 0 u β + D 1 u β+1 + D 2 u β+2 + D 3 u β+3 ++ D N u β+N for1u+ (24b)

The accuracy of equations given in (24) to represent 1/ ( 1+u ) β for various β=11/p values may be seen in Figure 2, where the exact expression 1/ ( 1+u ) β and Equation (24) are depicted for p=3/2 ,2,3 , and 10 which correspond to β=1/3 ,1/2 ,2/3 , and 9/10, respectively. Figure 2 is drawn by the use of (24a) for 0u1 and (24b) for 1u5 and both series are truncated at N=4 .

Figure 2. Function 1/ ( 1+u ) β (red) and Equation (24) for N=4 terms (blue dots) compared for p=3/2 ,β=1/3 ; p=2,β=1/2 ; p=3,β=2/3 ; p=10,β=9/ 10 values.

Equation (24a) is now used for the evaluation of I 10 for the range 0u1 while Equation (24b) is employed for the evaluation of I 11 in §3.2.2 for the range 1u x p where x p >1 and may be set to + .

I 10 = 0 1 e u du ( 1+u ) β = 0 1 ( D 0 + D 1 u+ D 2 u 2 + D 3 u 3 ++ D N u N ) e u du (25)

Successively integrating by parts yields

I 10 = D 0 e u | 0 1 D 1 ( 1+u ) e u | 0 1 D 2 ( 2+2u+ u 2 ) e u | 0 1 D 3 ( 6+6u+3 u 2 + u 3 ) e u | 0 1 D 4 ( 24+24u+12 u 2 +4 u 3 + u 4 ) e u | 0 1 (26)

which may be easily generalized as

I 10 = m=0 N ( m! D m e 1 k=m N k! m! D k ) (27)

We have thus completed the evaluation of I 10 in terms of the coefficients of the power series given in Equation (24).

3.2.2. Evaluation of I 11 = 1 x p [ e u / ( 1+u ) β ]du

For the evaluation of I 11 we make use of Equation (24b) as 1u x p in this case.

I 11 = 1 x p e u du ( 1+u ) β = 1 x p ( D 0 u β + D 1 u β+1 + D 2 u β+2 ++ D N u β+N ) e u du (28)

The first integral 1 x p ( e u / u β )du is equal to p I 1 as can bee seen from Equation (13) and cannot be evaluated directly; therefore, we keep it as p I 1 . On the other hand, the remaining integrals are worked out by partial integration so that

1 x p e u u β+1 = e 1 [ 1 β ]x e x p [ x p β ] p I 1 β (29a)

1 x p e u u β+2 = e 1 [ 1 β+1 1 β( β+1 ) ]x e x p [ x 2p β+1 x p β( β+1 ) ] + p I 1 β( β+1 ) (29b)

1 x p e u u β+3 = e 1 [ 1 β+2 1 ( β+1 )( β+2 ) + 1 β( β+1 )( β+2 ) ] x e x p [ x 3p β+2 x 2p ( β+1 )( β+2 ) x p β( β+1 )( β+2 ) ] p I 1 β( β+1 )( β+2 ) (29c)

Continuing in this manner and adding all the results to establish I 11 as expressed in (28) give

I 11 =p I 1 [ D 0 D 1 β + D 2 β( β+1 ) D 3 β( β+1 )( β+2 ) + ] + e 1 D 1 [ 1 β ]+ e 1 D 2 [ 1 β+1 1 β( β+1 ) ] + e 1 D 3 [ 1 β+2 1 ( β+1 )( β+2 ) + 1 β( β+1 )( β+2 ) ]+ x e x p [ x p β ]x e x p [ x 2p β+1 x p β( β+1 ) ] x e x p [ x 3p β+2 x 2p ( β+1 )( β+2 ) + x p β( β+1 )( β+2 ) ] (30)

The general form of (30) may be expressed as

I 11 =p I 1 [ D 0 + m=1 N ( 1 ) m ( k=1 m ( β+mk ) 1 ) D m ] + e 1 { m=1 N [ k=1 m ( 1 ) k+1 ( l=1 k ( β+ml ) 1 ) ] D m } x e x p { m=1 N [ k=1 m ( 1 ) k+1 x p( mk+1 ) ( l=1 k ( β+ml ) 1 ) ] D m } (31)

3.2.3. Evaluation of I 12 =x e 1 x p 0 1/ x p [ e x p u / ( 1+u ) β ]du

To complete the evaluation of I 1 the only remaining integral is

I 12 =x e 1 x p 0 1/ x p [ e x p u / ( 1+u ) β ]du as defined by (16). Considering only the integral itself and noting that 1/ x p <1 , the series expansion (24a) valid for 0u1 can be employed.

0 1/ x p e x p u du ( 1+u ) β = 0 1/ x p ( D 0 + D 1 u+ D 2 u 2 + D 3 u 3 ++ D N u N ) e x p u du (32)

Proceeding very similar to the evaluation of I 10 , we get

0 1/ x p e x p u du ( 1+u ) β = D 0 x p e x p u | 0 x p D 1 x p ( x p +u ) e x p u | 0 x p D 2 x p ( 2 x 2p +2 x p u+ u 2 ) e x p u | 0 x p D 3 x p ( 6 x 3p +6 x 2p u+3 x p u 2 + u 3 ) e x p u | 0 x p (33)

Generalizing the above expression and multiplying by x e 1 x p give I 12 as

I 12 =x e 1 x p m=0 N ( x p( m+1 ) m! D m e 1 k=m N x p( k+1 ) k! m! D k ) (34)

Finally, I 1 can be obtained by the use of Equation (17) ( pe ) I 1 = I 10 + I 11 I 12 ,

( pe ) I 1 = m=0 N ( m! D m e 1 k=m N k! m! D k ) +p I 1 [ D 0 + m=1 N ( 1 ) m ( k=1 m ( β+mk ) 1 ) D m ] + e 1 { m=1 N [ k=1 m ( 1 ) k+1 ( l=1 k ( β+ml ) 1 ) ] D m } x e x p { m=1 N [ k=1 m ( 1 ) k+1 x p( mk+1 ) ( l=1 k ( β+ml ) 1 ) ] D m } x e 1 x p m=0 N ( x p( m+1 ) m! D m e 1 k=m N x p( k+1 ) k! m! D k ) (35)

which can be re-arranged for I 1 as

p I 1 [ e D 0 m=1 N ( 1 ) m ( k=1 m ( β+mk ) 1 ) D m ] = m=0 N ( m! D m e 1 k=m N k! m! D k ) + e 1 { m=1 N [ k=1 m ( 1 ) k+1 ( l=1 k ( β+ml ) 1 ) ] D m } x e x p { m=1 N [ k=1 m ( 1 ) k+1 x p( mk+1 ) ( l=1 k ( β+ml ) 1 ) ] D m } x e 1 x p m=0 N ( x p( m+1 ) m! D m e 1 k=m N x p( k+1 ) k! m! D k ) (36)

Computing I 0 from (10) and I 1 from (36) enable us to compute the integral sought G p ( + ) G p ( x )= 0 x e t p dt = I 0 + I 1 as stated in (9).

4. Numerical Results

Formulations developed for computing G p ( x )= p Γ( 1/p ) 0 x e t p dt are programmed in FORTRAN, which is included in Appendix B. In this section, various comparisons with available numerical values are presented. First, the tables given in ([2], pp. 310-311) for the error function erf( x )= 2 π 0 x e t 2 dt are used for comparisons with the computed results obtained for N=4 . Then, quite similar comparisons, again using the tables of Abramowitz and Stegun ([2], p. 320) are presented for G 3 ( x )= 3 Γ( 1/3 ) 0 x e t 3 dt . For different truncation orders N and a range of p values, §4 presents a table listing computed G p ( + ) values, all of which must be exactly unity. Two graphical representations of the normalized integral function G p ( x ) for 1p10 and 0x5 are also included.

4.1. Comparisons for erf( x )= 2 π 0 x e t 2 dt or G 2 ( x )= 2 Γ( 1/2 ) 0 x e t 2 dt

The well-known error function corresponds to p=2 case hence it is considered first. Table 1 compares the tabulated values of ([2], pp. 310-11), labeled “exact”, with computations from present formulation for the truncation order N=4 . Integral value at infinity can be obtained either by simply setting the upper limit contribution of I 11 to zero or taking a relatively large x value such as x=100 ; but even x=5 is sufficient to obtain a perfectly acceptable result for x=+ . For the present case of p=2 this value corresponds to Γ( 1/2 )/2 = π /2 and the values in Table 1 are normalized by multiplying with 2/ Γ( 1/2 ) =2/ π . Finally, the relative error percentages are computed from 100∙(1 – Approximate/Exact).

Table 1. Comparisons for G 2 ( x )=erf( x )= 2 π 0 x e t 2 dt .


Abramowitz and Stegun [2]

Present work

Relative error

x

(Exact)

(N = 4)

(%)

0.00

0.00000000

0.00000000

−0.0000

0.25

0.27632639

0.27632639

−0.0000

0.50

0.52049988

0.52049988

−0.0000

0.75

0.71115563

0.71115563

−0.0000

1.00

0.84270079

0.84270079

−0.0000

1.25

0.92290013

0.92227506

−0.0677

1.50

0.96610514

0.96578097

−0.0336

1.75

0.98667167

0.98657212

−0.0101

2.00

0.99532227

0.99532944

−0.0072

+

1.00000000

1.00006365

−0.0064

For 0.00x1.00 the computed results agree perfectly well with the tabulated values because both are obtained from the series expansion in (10) with upper limit of integration set to the given x value. In computations the number of terms was restricted to 150 due to the limited capability of the machine to compute large factorials. Tables of Abramowitz and Stegun [2] terminate at x=2 ; therefore, the comparisons accord with this upper limit.

For x1 the present formulation uses (36) with N=4 as no improvement in accuracy is observed for higher truncation orders N=5,6,7,8 . However, as Table 3 in §4 reveals, higher truncation orders give improved results for higher p values, especially for x=+ . The present comparisons have the same tendency concerning x; namely, increasing the upper limit of integration decreases the relative error percentage appreciably. For instance, the error is approximately 0.07% for x=1.25 ; but it reduces tenfold to −0.007% for x=2.00 . Despite these moderately satisfactory results, even for a truncation order of as small as N=4 , the lack of improvement in accuracy for higher truncation orders indicates an inherently difficult problem, which is also observed for numerical integrations performed by Simpson’s rule of integration for purposes of extra checking. High precision computations in the range 0<x1 did not yield results as good as the series solutions despite taking an extremely small step of Δx=1/ 1000000 .

4.2. Comparisons for G 3 ( x )= 3 Γ( 1/3 ) 0 x e t 3 dt

Another group of tables given in ([2], p. 320] is for the integral

G 3 ( x )= 3 Γ( 1/3 ) 0 x e t 3 dt , which corresponds to p=3 in the present notation. Table 2 shows the comparisons up to x=2.30 , which is the highest value included in [2]. Error percentages show similar characteristics with those of p=2 case; yet, overall the errors are smaller. The listed highest error is 0.056% for x=1.20 and it reduces to 0.004% for x=2.30 . Again, values for 0.00x1.00 agree perfectly well because they are computed from the series expansion in complete agreement with the one used in [2].

Table 2. Comparisons for normalized integral G 3 ( x )= 3 Γ( 1/3 ) 0 x e t 3 dt .


Abramowitz and Stegun [2]

Present work

Relative error

x

(Exact)

(N = 4)

(%)

0.00

0.0000000

0.0000000

0.0000

0.30

0.3337037

0.3337037

0.0000

0.70

0.7227669

0.7227669

0.0000

1.00

0.9042886

0.9042886

0.0000

1.20

0.9641064

0.9635709

0.0555

1.50

0.9951149

0.9949880

0.0128

1.70

0.9991499

0.9990934

0.0336

2.10

0.9999925

0.9999496

0.0057

2.30

0.9999997

0.9999569

0.0043

+

1.0000000

0.9999573

0.0043

4.3. Computations for Various p and x Values

For different truncation orders N=4,,8 , Table 3 presents computational results for the normalized integral G p ( + ) , which is exactly equal to unity for any p. Deviation from the unity corresponds to the absolute error in computational result. It is clear from Table 3 that, regardless of the truncation number,

Table 3. Normalized integral G p ( + )= p Γ( 1/p ) 0 + e t p dt for various p values and truncation orders N.

p

N = 4

N = 5

N = 6

N = 7

N = 8

1.20

1.000544

0.999778

1.001037

0.998898

1.001525

1.50

1.000405

1.000205

1.001224

0.998582

1.002317

2.00

1.000064

1.000844

1.000719

0.999117

1.001955

3.00

0.999957

1.001095

1.000106

0.999937

1.000867

4.25

1.000047

1.000912

0.999939

1.000216

1.000303

5.75

1.000122

1.000685

0.999931

1.000251

1.000090

7.80

1.000161

1.000485

0.999961

1.000212

1.000013

10.00

1.000168

1.000358

0.999985

1.000167

0.999995

computational accuracy increases with increasing p values. In particular, N=8 case with four/five decimal places accuracy is remarkably good for p5.75 . On the other hand, lower truncation orders N=4,5 appear to perform better for relatively smaller p3 values. Nevertheless, there appears no definite trend of truncation orders. Figure 3 depicts G p ( x ) normalized integral function within the range 0x5 for five different p values. Computations for p=1 may be performed by setting p to a slightly higher value such as p=1+ 10 6 ; otherwise, β=11/p becomes exactly zero and the scheme fails. As expected, all the curves tend to unity with increasing x, even as low as x = 5.

A perspective view of G p ( x ) function for x and p pairs is presented in Figure 4. The most notable characteristic of both Figure 3 and Figure 4 is the sharp increase observed in G p ( x ) in the neighborhood of x=1 as p values increase.

Figure 3. Normalized integral function G p ( x )= p Γ( 1/p ) 0 x e t p dt for a number of p values within 0x5 .

Figure 4. A perspective view of normalized integral function G p ( x )= p Γ( 1/p ) 0 x e t p dt for 1p10 and 0x5 values.

5. Concluding Remarks

A generalized form of the error function, defined as G p ( x )= p Γ( 1/p ) 0 x e t p dt , is

evaluated by means of fast-converging novel series expansions developed in resolving the so-called Grandi’s paradox. Computations indicate that for as low truncation order as N=4 , the technique introduced here gives quite acceptable results when compared with available tables; however, the lack of substantial improvement in accuracy for higher truncation orders N=5,,8 poses a drawback. On the other hand, visibly better results for higher p and N values may indicate a potential for further improvement with even higher truncation orders N>8 , which are not pursued here since the expansions become quite cumbersome as can be seen in the FORTRAN code for N=8 . A final criticism may be raised against the idea of pursuing such analytical solutions at the present advanced age of computers. It is perfectly possible to do numerical integrations with very good accuracy by various methods; but restricting our interests only to available tools would unquestionably limit the mathematical progress which may otherwise produce fruitful extensions to new areas.

Appendix A: Derivatives of f= g β for g= C 0 + m=0 N C m u m

A practical methodology is developed here for obtaining higher derivatives of f= g β at u=0 with g= C 0 + m=0 N C m u m . The approach is essentially based on a notational procedure and considerably simpler than the direct way. Let us begin with f( 0 )= g β ( 0 )= C ^ 0 =0! C 0 , recall that in general C ^ m =m! C m as defined in §3.2.1, and introduce a differentiation scheme as follows

f ^ ( 0 )= C ^ 0 = C ^ 0 C ^ 1 (37)

where C ^ 1 =1! C 1 indicates the first derivative of C ^ 0 =0! C 0 , which is no longer considered as a constant but the value of g β ( 0 ) . For the same reason, the derivative of C ^ 0 is always evaluated as C ^ 0 C ^ 1 which is equal to g β ( 0 ) g ( 0 ) . Equation (37) is not complete however; we must have the multiplier β associated with the first derivative C ^ 1 so that the correct expression becomes f ( 0 )=β C ^ 0 C ^ 1 . Nevertheless, presently we shall ignore these multipliers of β , ( β1 ) , etc. and consider them in a systematic manner afterwards. Thus, proceeding from (37),

f ^ ( 0 )= ( C ^ 0 C ^ 1 ) = C ^ 0 C ^ 1 + C ^ 0 C ^ 1 = C ^ 0 C ^ 1 C ^ 1 + C ^ 0 C ^ 2 = C ^ 0 C ^ 1 2 + C ^ 0 C ^ 2 (38)

The second power appearing in C ^ 1 2 indicates a double differentiation hence requires the multiplier β( β1 ) while the first power in C ^ 2 corresponds to the multiplier β only. The complete expression is then f ( 0 )=β( β1 ) C ^ 0 C ^ 1 2 +β C ^ 0 C ^ 2 as given in Equation (22). Differentiation of (38) yields

f ^ ( 0 )= ( C ^ 0 C ^ 1 2 + C ^ 0 C ^ 2 ) = C ^ 0 C ^ 1 3 +3 C ^ 0 C ^ 1 C ^ 2 + C ^ 0 C ^ 3 (39)

which in turn corresponds to

f ( 0 )=β( β1 )( β2 ) C ^ 1 3 +3β( β1 ) C ^ 1 C ^ 2 +β C ^ 3 (40)

Note that total powers of the coefficients determines the number of derivatives; for example, C ^ 1 3 has a power of 3 hence is multiplied by β( β1 )( β2 ) . Likewise, C ^ 1 1 C ^ 2 1 has total 1+1=2 powers and is multiplied by β( β1 ) . It is also relatively straightforward to establish the corresponding functional form from Equation (40) as

f ( 0 )=β( β1 )( β2 ) g β3 g 3 +3β( β1 ) g β2 g g +β g β1 g (41)

Demonstration is concluded by giving the resulting expressions for the fourth-derivative.

f ^ iv ( 0 )= C ^ 0 C ^ 1 4 +6 C ^ 0 C ^ 1 2 C ^ 2 +4 C ^ 0 C ^ 1 C ^ 3 +3 C ^ 0 C ^ 2 2 + C ^ 0 C ^ 4 (42)

which in turn corresponds to

f iv ( 0 )=β( β1 )( β2 )( β3 ) C ^ 1 4 +6β( β1 )( β2 ) C ^ 1 2 C ^ 2 +4β( β1 ) C ^ 1 C ^ 3 +3β( β1 ) C ^ 2 2 +β C ^ 4 (43)

and in terms of function g reads

f iv ( 0 )=β( β1 )( β2 )( β3 ) g β4 g 4 +6β( β1 )( β2 ) g β3 g 2 g +4β( β1 ) g β2 g g +3β( β1 ) g β2 g 2 +β g β1 g iv (44)

Higher-order derivatives should be obtained fairly easily by following the same methodology.

Appendix B: FORTRAN Code for Computation of G p ( x )= p Γ( 1/p ) 0 x e t p dt

use msimsl

parameter(n=4)

double precision c(0:50),d(0:50)

double precision bt,cfn,ep,em,one,p,pi,x

double precision xmlt,sgn,sum,sumlt,twopwn

double precision XI,XI1,XI2,XI0,XI10,XI1a,XI1b,XI1c

c

c Pi & Exponential values

pi=4*datan(one); one=1; ep=dexp(one); em=dexp(-one)

c

c Power p and beta

p=2.0; bt=1-1/p

c

c Normalization coefficient p/Gamma(1/p)

cfn=p/dgamma(1/p)

c

c Upper limit of integration

x=100

c

c Regularized coefficients

c(0)=1; twopwn=2**dfloat(n)

c

do m=1,n; sum=0

c

do k=m,n

sum=sum+dbinom(n,k)

enddo

c

sgn=1-2*mod(m,2)

c(m)=sgn*sum/twopwn

enddo

c

c Coefficients for derivatives

do m=0,n; c(m)=dfac(m)*c(m); enddo

c

c Call Maclaurin coefficients

call mac(n,bt,c,d)

c

c Integral Parts

c

c Computation of I_0

c

if(x.le.one) then; XI0=x

do m=1,150; sgn=1-2*mod(m,2)

XI0=XI0+sgn*(x**(1+p*dfloat(m)))/(1+p*dfloat(m))/dfac(m)

enddo; goto 50

else; XI0=1.0

do m=1,150; sgn=1-2*mod(m,2)

XI0=XI0+sgn/(1+p*dfloat(m))/dfac(m)

enddo; endif

c c Computation of I_10

XI10=0.0

do m=0,n; XI10=XI10+dfac(m)*d(m)

do k=m,n; XI10=XI10-em*(dfac(k)/dfac(m))*d(k)

enddo; enddo

c

c Computation of I_11

c

c I1a First part of I1

XI1a=0.0 do m=1,n; sumlt=0.0

do k=1,m; sgn=1-2*mod(k+1,2); xmlt=1.0

do l=1,k; xmlt=xmlt/(bt+dfloat(m)-dfloat(l))

enddo; sumlt=sumlt+sgn*xmlt; enddo

XI1a=XI1a+sumlt*d(m); enddo

XI1a=em*XI1a

c

c I1b Second part of I1

XI1b=0.0; do m=1,n; sumlt=0.0

do k=1,m; sgn=1-2*mod(k+1,2); xmlt=1.0

do l=1,k; xmlt=xmlt/(bt+dfloat(m)-dfloat(l)); enddo

sumlt=sumlt+sgn*xmlt*(x**(-p*(1+dfloat(m)-dfloat(k))))

enddo; XI1b=XI1b+sumlt*d(m); enddo

XI1b=x*dexp(-x**p)*XI1b

c

c I1c Coefficient of I1

XI1c=d(0); do m=1,n; sgn=1-2*mod(m,2); xmlt=1.0

do l=1,m; xmlt=xmlt/(bt+dfloat(m)-dfloat(l)); enddo

XI1c=XI1c+sgn*xmlt*d(m); enddo

c

c Computation of I_2

XI2=0.0; do m=0,n; XI2=XI2+(x**(-p*(dfloat(m)+1.)))*dfac(m)*d(m)

do k=m,n

XI2=XI2-em*(x**(-p*(dfloat(k)+1.)))*(dfac(k)/dfac(m))*d(k)

enddo; enddo

XI2=x*dexp(1-x**p)*XI2

c

c Final Value

XI1=XI10+XI1a-XI1b-XI2

XI1=XI1/(ep-XI1c)/p

XI=XI0+XI1; goto 60

c

50 XI=XI0

c

60 write(*,40)p,x,cfn*XI

c

40 format(8(2x,f14.6))

c

stop; end

c subroutine mac(n,bt,c,d)

use msimsl

double precision bt,c(0:50),d(0:50)

c

d(0)=c(0)

c d(1)=c(1)

c

d(2)=(bt-1)*c(1)*c(1)+c(2)

c

d(3)=(bt-1)*(bt-2)*c(1)*c(1)*c(1)+3*(bt-1)*c(1)*c(2)+c(3)

c

d(4)=(bt-1)*(bt-2)*(bt-3)*c(1)*c(1)*c(1)*c(1)

d(4)=d(4)+6*(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c(3)*c(3)

d(8)=d(8)+28*(bt-1)*(bt-2)*c(1)*c(1)*c(6)

d(8)=d(8)+840*(bt-1)*(bt-2)*(bt-3)*c(1)*c(2)*c(2)*c(3)

d(8)=d(8)+168*(bt-1)*(bt-2)*c(1)*c(2)*c(5)

d(8)=d(8)+280*(bt-1)*(bt-2)*c(1)*c(3)*c(4)+8*(bt-1)*c(1)*c(7)

&+105*(bt-1)*(bt-2)*(bt-3)*c(2)**4+210*(bt-1)*(bt-2)*c(2)*c(2)*c(4)

d(8)=d(8)+280*(bt-1)*(bt-2)*c(2)*c(3)**2+28*(bt-1)*c(2)*c(6)

&+56*(bt-1)*c(3)*c(5)+35*(bt-1)*c(4)*c(4)+c(8)

c

do m=1,n; d(m)=bt*d(m)/dfac(m); enddo

c

return; end

Conflicts of Interest

The author declares no conflicts of interest regarding the publication of this paper.

References

[1] Laplace, P.S. (1839) Méchanique Céleste, Vol. IV. Little, Brown and Company.
[2] Abramowitz, M. and Stegun, I.A. (1972) Handbook of Mathematical Functions. Dover Publications.
[3] Arfken, G.B. and Weber, H.J. (2005) Mathematical Methods for Physicists. Elsevier Academic Press.
[4] Beji, S. (2020) Resolution of Grandi’s Paradox and Investigations on Related Series. Applied Mathematics E-Notes, 20, 265-277.
[5] Beji, S. (2021) Evaluation of Exponential Integral by Means of Fast-Converging Power Series. Advances in Pure Mathematics, 11, 101-108.
https://doi.org/10.4236/apm.2021.111006
[6] O’Conner, J.J. and Robertson, E.F. (2024) McTutor History of Mathematics Archive.
[7] Beji, S. (2020) Resolution of Grandi’s Paradox as Extended to Complex Valued Functions. Advances in Pure Mathematics, 10, 447-463.
https://doi.org/10.4236/apm.2020.108027.

Copyright © 2025 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.