Error Analysis in the Series Evaluation of the Exponential Type Integral Ezel(Z)
Total Page:16
File Type:pdf, Size:1020Kb
An International Joumal computers & mathematics with applications PERGAMON Computers and Mathematics with Applications 43 (2002) 207-266 www.elsevier.com/locate/camwa Error Analysis in the Series Evaluation of the Exponential Type Integral eZEl(z) W. C. HASSENPFLUG Department of Mechanical Engineering University of Stellenbosch, Stellenbosch, South Africa (Received July 1999; accepted August 1999) Abstract--The method of convolution algebra is used to compute values of the exponential type integral eZ E1 (z), y(z) = f0 ~ se-S + z ds, by expansion of the integrand in a string of Taylor series' along the real s-axis for any complex parameter z, accurate within 4-1 of the last digit of seven-digit computation. Accuracy is verified by comparison with existing tables of E1 and related integrals. This method is used to assess the accuracy of the error estimates of all subsequent computations. Three errors of a Taylor series are identified. These consist of a Taylor series truncation error, a digital truncation error, and a stability error. Methods are developed to estimate the error. By iteration a numerical radius of convergence for a given accuracy is determined. The z-plane is divided into three regions in which three different types of series are used to expand the function f(z) directly in z. Around the center the well-known Frobenius series is used. In the outer region the well-known asymptotic approximation is used. Their accuracy boundaries are determined. In the near-annular region in between, a set of Taylor series is introduced. As the result, the function f(z) can be computed fast with the appropriate series for any complex argument z, to an accuracy within less than relative error of 5 x 10 -7. (~) 2001 Elsevier Science Ltd. All rights reserved. Keywords--Exponential integral, Error analysis, Convolution algebra, Numeric integration, Tay- lor series error. 1. INTRODUCTION The integral to be evaluated is f(z) = s + z ds - g(s) ds. (1.1) It is related to the standard exponential integral E1 (see [1-3]) by the substitution s + z = t, ~z c¢e -t y(z) = e z dt -~ e z El(z). (1.2) t The exponential integral E1 is extensively tabulated, usually in a related form [1-3] because of its application in physics. In the form of equation (1.1), it occurs frequently in hydrodynamic applications [4]. I wish to thank D. N. J. Els who showed me how to make PostScript files. 0898-1221/01/$ - see front matter (~) 2001 Elsevier Science Ltd. All rights reserved. Typeset by .AA/~TEX PII: S0898-1221(01)00283-8 208 W.C. HASSENPFLUG Our aim here is to derive the series expansion of the function f(z) by a method that can be applied generally to similar definite integrals. For that purpose, we make use of the differential equation 1 f'(z) - f(z) = --, (1.3) z which can be verified by substituting the integral from equation (1.1), and integrating f~ by parts. This is a linear first-order differential equation, whose solution by the standard method is f(z)=-ez(/le~dz+7) (1.4) where ~/ at this stage is an unknown integration constant. The integral can be expanded in a Frobenius series by separating the singular term in the integrand of equation (1.4) 1 1+( 1 ) Z Z ~: ez -- ' which produces the solution f(z) = -e ~ (log z + h(z)) (1.5) = -e z log z + l(z) (1.6) in two alternative forms, where (-1)nz n h(z)=v+ fl (e- ~_I) dz=~'+ (1.7) J Z n:l nn! l(z) = -eZh(z). (1.8) Equation (1.7) corresponds to the well-known Frobenius series expansion of El, see [2,3], "~ (-1)nz n El(Z) ---- --7 -- log z -- nn! ' n=l 7 = .5772156649... is Euler's constant. If we want to solve the differential equation (1.3) directly with convolution numbers [5], we will have to find the singular term first. Due to the term 1/z, equation (1.3) has no Taylor series solution. The residue of the integrand g(s) at the singular point s -- -z is e z. Therefore, the integral around the residue is e~21r~, which is the discontinuity of the function f(z) along any cut in any one chosen principal sheet. This discontinuity is satisfied by the function e z log z, which is the desired singular term. Alternatively, the indeterminate integral in equation (1.4) can be expanded and the singular term found from there. This leads to the attempted series solution of the form of equation (1.6), where l(z) is a Taylor series. Substituting equation (1.6) in (1.3) produces the differential equation l'(z) - l(z) = ! (ez _ 1). (1.9) Z Alternatively, the attempted series solution may be put into the form equation (1.5), which substituted in equation (1.3) produces the differential equation h'(z) = _1 (e z - 1) . (1.10) Z Using the Taylor expansion of the right-hand side, l(z) or h(z) is solved by convolution numbers. Error Analysis 209 However, there is no initial value available from which h(0) can be determined. Instead, the definition of equation (1.1) must be used. Let us define the series h(z) with initial value 0 as hi(z). We can choose z = 1, so that from equation (1.5) f(1) ho = hi(1) = 7. (I.ii) e Similarly, we can solve equation (1.9) with initial value 0 as ll(z), so that from equation (1.6) l0 = f(1) -/1(1) = -% (1.12) It is apparently not possible to obtain the complete Frobenius series without some other method to determine the integral in equation (1.1), at least for the particular value of z = 1. For this purpose, the direct integration in Sections 2 and 3 is developed. From the theory of differential equations, it is known that the asymptotic behaviour of f(z) in equation (1.3) is (see [6, Section 4.4]) f(z) z -.i (1.13) oo Z Although it is clear from the singularity of f(z) in equation (1.5) that no Laurent series exists, it is formally attempted. The transformation ~_--1 Z in equation (1.3) produces the differential equation /'(0 = ¢ /(0. (1.14) This can be solved directly by formal Taylor series expansion in ft. The result is equal to the well-known asymptotic expansion (see [2,7,8]) 00 (_l)nn ! (1.15) f(z) = Z zn+: n=0 It is interesting to note that the series expansion requires the initial value to be 0, so that no other method is required to supply an integration constant, and indeed the solution satisfies equation (1.13). Having a series about the center and one at infinity, we plot the corresponding function values for an initial visual inspection; see Figure 1. The center series is plotted from near the origin to the right, and the asymptotic series from z = 30 towards the left. The two available series expansions seem to cover the whole region. But if the function values are computed at the indicated center of the overlapping region, the difference indicates an error, whose magnitude is unacceptably high for mathematical purposes. f(z) I f(V 0.5 % 0.5 I ., le0 0 1-3O (a) Positive real axis, relative error at z = 8 is (b) Negative real axis, relative error at z = -8 is 0.018. 0.006. Figure 1. Magnitude of function f(z) from center and asymptotic series. Center series n = 32, asymptotic series n -- 8. 210 W.C. HASSENPFLUG Therefore, we first need a method to determine the value of f(z) accurately to compute the error and valid range of any of the series. Two methods are given in Sections 2 and 3. Second, we need a method to estimate the error of these two expansions by direct means, so that a region within an acceptable error for a particular application can be determined from its own series. This is done in Sections 4 and 5. Finally, we need an additional expansion to compute the function to higher accuracy between the two regions. This will be a Taylor series, which is developed in Section 6. The z-plane is divided into three regions in which the three different types of series are used to expand the function f(z) directly in z. Around the center the Frobenius series is used. In the outer region, the asymptotic approximation is used. In the near-annular region in between, a sequence of Taylor series is used. Only the principal sheet of the Riemann plane needs to be considered, with the slit along the negative real axis. For each type of series, the numerical radius of convergence is determined by an error estimate to satisfy a preset accuracy. The initial value for the center series expansion is known from Section 2 or 3; for the asymptotic series no initial value is required. For the region in between, the initial value in each disk is determined by the previous disk. The path along which the sequence of Taylor disks is taken is determined by results of the error analysis. With seven-digit computation, relative accuracy of 1.2 x 10 -6 can be obtained in the whole z-plane. The error theory is tested with the almost full digit accuracy function value of Section 2 in single precision. Therefore, the same procedure could be applied to test the error theory and determine accuracy boundaries in double precision. A stability error occurs in the Taylor coefficients.