Incomplete gamma function explained
In mathematics, the upper and lower incomplete gamma functions are types of special functions which arise as solutions to various mathematical problems such as certain integrals.
Their respective names stem from their integral definitions, which are defined similarly to the gamma function but with different or "incomplete" integral limits. The gamma function is defined as an integral from zero to infinity. This contrasts with the lower incomplete gamma function, which is defined as an integral from zero to a variable upper limit. Similarly, the upper incomplete gamma function is defined as an integral from a variable lower limit to infinity.
Definition
The upper incomplete gamma function is defined as:whereas the lower incomplete gamma function is defined as:In both cases is a complex parameter, such that the real part of is positive.
Properties
By integration by parts we find the recurrence relationsandSince the ordinary gamma function is defined aswe haveand
Continuation to complex values
The lower incomplete gamma and the upper incomplete gamma function, as defined above for real positive and, can be developed into holomorphic functions, with respect both to and, defined for almost all combinations of complex and .[1] Complex analysis shows how properties of the real incomplete gamma functions extend to their holomorphic counterparts.
Lower incomplete gamma function
Holomorphic extension
Repeated application of the recurrence relation for the lower incomplete gamma function leads to the power series expansion: [2] Given the rapid growth in absolute value of when, and the fact that the reciprocal of is an entire function, the coefficients in the rightmost sum are well-defined, and locally the sum converges uniformly for all complex and . By a theorem of Weierstrass,[3] the limiting function, sometimes denoted as [4] is entire with respect to both (for fixed) and (for fixed),[1] and, thus, holomorphic on by Hartog's theorem.[5] Hence, the following decomposition[1] extends the real lower incomplete gamma function as a holomorphic function, both jointly and separately in and . It follows from the properties of
and the
Γ-function, that the first two factors capture the
singularities of
(at or a non-positive integer), whereas the last factor contributes to its zeros.
Multi-valuedness
The complex logarithm is determined up to a multiple of only, which renders it multi-valued. Functions involving the complex logarithm typically inherit this property. Among these are the complex power, and, since appears in its decomposition, the -function, too.
The indeterminacy of multi-valued functions introduces complications, since it must be stated how to select a value. Strategies to handle this are:
- (the most general way) replace the domain of multi-valued functions by a suitable manifold in called Riemann surface. While this removes multi-valuedness, one has to know the theory behind it;[6]
- restrict the domain such that a multi-valued function decomposes into separate single-valued branches, which can be handled individually.
The following set of rules can be used to interpret formulas in this section correctly. If not mentioned otherwise, the following is assumed:
=Sectors
=Sectors in having their vertex at often prove to be appropriate domains for complex expressions. A sector consists of all complex fulfilling and with some and . Often, can be arbitrarily chosen and is not specified then. If is not given, it is assumed to be, and the sector is in fact the whole plane, with the exception of a half-line originating at and pointing into the direction of, usually serving as a branch cut. Note: In many applications and texts, is silently taken to be 0, which centers the sector around the positive real axis.
=Branches
=In particular, a single-valued and holomorphic logarithm exists on any such sector D having its imaginary part bound to the range . Based on such a restricted logarithm, and the incomplete gamma functions in turn collapse to single-valued, holomorphic functions on (or), called branches of their multi-valued counterparts on D. Adding a multiple of to yields a different set of correlated branches on the same set . However, in any given context here, is assumed fixed and all branches involved are associated to it. If, the branches are called principal, because they equal their real analogues on the positive real axis. Note: In many applications and texts, formulas hold only for principal branches.
=Relation between branches
=The values of different branches of both the complex power function and the lower incomplete gamma function can be derived from each other by multiplication of
,
[1] for a suitable integer.
Behavior near branch point
The decomposition above further shows, that γ behaves near asymptotically like:
For positive real, and,, when . This seems to justify setting for real . However, matters are somewhat different in the complex realm. Only if (a) the real part of is positive, and (b) values are taken from just a finite set of branches, they are guaranteed to converge to zero as, and so does . On a single branch of is naturally fulfilled, so there for with positive real part is a continuous limit. Also note that such a continuation is by no means an analytic one.
Algebraic relations
All algebraic relations and differential equations observed by the real hold for its holomorphic counterpart as well. This is a consequence of the identity theorem, stating that equations between holomorphic functions valid on a real interval, hold everywhere. In particular, the recurrence relation [2] and [2] are preserved on corresponding branches.
Integral representation
The last relation tells us, that, for fixed, is a primitive or antiderivative of the holomorphic function . Consequently, for any complex,holds, as long as the path of integration is entirely contained in the domain of a branch of the integrand. If, additionally, the real part of is positive, then the limit for applies, finally arriving at the complex integral definition of [1]
Any path of integration containing 0 only at its beginning, otherwise restricted to the domain of a branch of the integrand, is valid here, for example, the straight line connecting and .
=Real values
=Given the integral representation of a principal branch of, the following equation holds for all positive real, :[7]
=s complex
=This result extends to complex . Assume first and . Thenwhere[8] has been used in the middle. Since the final integral becomes arbitrarily small if only is large enough, converges uniformly for on the strip towards a holomorphic function, which must be Γ(s) because of the identity theorem. Taking the limit in the recurrence relation and noting, that lim for and all, shows, that converges outside the strip, too, towards a function obeying the recurrence relation of the Γ-function. It followsfor all complex not a non-positive integer, real and principal.
=Sectorwise convergence
=Now let be from the sector with some fixed, be the principal branch on this sector, and look at
As shown above, the first difference can be made arbitrarily small, if is sufficiently large. The second difference allows for following estimation:
\left|z^ e^\right| dz = \int_u^
\left|z\right|^ \, e^ \, e^ \, dz,where we made use of the integral representation of and the formula about above. If we integrate along the arc with radius around 0 connecting and, then the last integral is
where is a constant independent of or . Again referring to the behavior of for large, we see that the last expression approaches 0 as increases towards .In total we now have:
if is not a non-negative integer, is arbitrarily small, but fixed, and denotes the principal branch on this domain.
Overview
is:
- entire in for fixed, positive integer ;
- multi-valued holomorphic in for fixed not an integer, with a branch point at ;
- on each branch meromorphic in for fixed, with simple poles at non-positive integers s.
Upper incomplete gamma function
As for the upper incomplete gamma function, a holomorphic extension, with respect to or, is given by[1] at points, where the right hand side exists. Since
is multi-valued, the same holds for
, but a restriction to principal values only yields the single-valued principal branch of
.
When is a non-positive integer in the above equation, neither part of the difference is defined, and a limiting process, here developed for, fills in the missing values. Complex analysis guarantees holomorphicity, because
proves to be
bounded in a
neighbourhood of that limit for a fixed .
To determine the limit, the power series of
at is useful. When replacing
by its power series in the integral definition of
, one obtains (assume, positive reals for now):
or
[4] which, as a series representation of the entire
function, converges for all complex (and all complex not a non-positive integer).
With its restriction to real values lifted, the series allows the expansion:
When :[9] (
is the
Euler–Mascheroni constant here), hence,
is the limiting function to the upper incomplete gamma function as, also known as the
exponential integral [10] By way of the recurrence relation, values of
for positive integers can be derived from this result,
[11] so the upper incomplete gamma function proves to exist and be holomorphic, with respect both to and, for all and .
is:
- entire in for fixed, positive integral ;
- multi-valued holomorphic in for fixed non zero and not a positive integer, with a branch point at ;
- equal to
for with positive real part and (the limit when
), but this is a continuous extension, not an
analytic one (
does not hold for real !);
- on each branch entire in for fixed .
Special values
if is a positive
integer,
if is a positive
integer,
[12] \Gamma(s,0)=\Gamma(s),\Re(s)>0
,
,
,
\Gamma(0,x)=-\operatorname{Ei}(-x)
for
,
\Gamma(s,x)=xs\operatorname{E}1-s(x)
,
\Gamma\left(\tfrac{1}{2},x\right)=\sqrt\pi\operatorname{erfc}\left(\sqrtx\right)
,
\gamma\left(\tfrac{1}{2},x\right)=\sqrt\pi\operatorname{erf}\left(\sqrtx\right)
.
Here,
is the
exponential integral,
is the generalized exponential integral,
is the
error function, and
is the complementary error function,
\operatorname{erfc}(x)=1-\operatorname{erf}(x)
.
Asymptotic behavior
as
,
as
and
(for real, the error of is on the order of if and if),
\Gamma(s,x)\sim\Gamma(s)-
(-1)n
as an
asymptotic series where
and
.
[13] \Gamma(-N,x)\simCN+
lnx-
(-1)n
as an
asymptotic series where
and
, where
, where
is the
Euler-Mascheroni constant.
[13]
as
,
as
,
\Gamma(s,z)\simzs-1e-z\sumk=0
z-k
as an
asymptotic series where
and
\left|\argz\right|<\tfrac{3}{2}\pi
.
[14] Evaluation formulae
The lower gamma function can be evaluated using the power series expansion:[15] where
} is the
Pochhammer symbol.
An alternative expansion iswhere is Kummer's confluent hypergeometric function.
Connection with Kummer's confluent hypergeometric function
When the real part of is positive,where has an infinite radius of convergence.
Again with confluent hypergeometric functions and employing Kummer's identity,
For the actual computation of numerical values, Gauss's continued fraction provides a useful expansion:
This continued fraction converges for all complex, provided only that is not a negative integer.
The upper gamma function has the continued fraction[16] and
Multiplication theorem
The following multiplication theorem holds true:
Software implementation
The incomplete gamma functions are available in various of the computer algebra systems.
Even if unavailable directly, however, incomplete function values can be calculated using functions commonly included in spreadsheets (and computer algebra packages). In Excel, for example, these can be calculated using the gamma function combined with the gamma distribution function.
- The lower incomplete function:
= EXP(GAMMALN(s))*GAMMA.DIST(x,s,1,TRUE)
.
- The upper incomplete function:
= EXP(GAMMALN(s))*(1-GAMMA.DIST(x,s,1,TRUE))
.These follow from the definition of the gamma distribution's cumulative distribution function.
In Python, the Scipy library provides implementations of incomplete gamma functions under, however, it does not support negative values for the first argument. The function from the mpmath library supports all complex arguments.
Regularized gamma functions and Poisson random variables
Two related functions are the regularized gamma functions:
is the
cumulative distribution function for
gamma random variables with
shape parameter
and
scale parameter 1.
When
is an integer,
is the cumulative distribution function for
Poisson random variables: If
is a
random variable then
This formula can be derived by repeated integration by parts.
In the context of the stable count distribution, the
parameter can be regarded as inverse of Lévy's stability parameter
:
where
is a standard stable count distribution of shape
.
and
are implemented as
gammainc
[17] and
gammaincc
[18] in
scipy.
Derivatives
Using the integral representation above, the derivative of the upper incomplete gamma function
with respect to is
The derivative with respect to its first argument
is given by
[19] and the second derivative by
where the function
is a special case of the
Meijer G-functionThis particular special case has internal
closure properties of its own because it can be used to express
all successive derivatives. In general,
where
is the
permutation defined by the
Pochhammer symbol:
All such derivatives can be generated in succession from:
and
This function
can be computed from its series representation valid for
,
with the understanding that is not a negative integer or zero. In such a case, one must use a limit. Results for
can be obtained by
analytic continuation. Some special cases of this function can be simplified. For example,
,
, where
is the
Exponential integral. These derivatives and the function
provide exact solutions to a number of integrals by repeated differentiation of the integral definition of the upper incomplete gamma function.
[20] [21] For example,
This formula can be further
inflated or generalized to a huge class of
Laplace transforms and
Mellin transforms. When combined with a
computer algebra system, the exploitation of special functions provides a powerful method for solving definite integrals, in particular those encountered by practical engineering applications (see
Symbolic integration for more details).
Indefinite and definite integrals
The following indefinite integrals are readily obtained using integration by parts (with the constant of integration omitted in both cases):The lower and the upper incomplete gamma function are connected via the Fourier transform:This follows, for example, by suitable specialization of .
Notes
- Web site: DLMF: §8.2 Definitions and Basic Properties ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions . dlmf.nist.gov.
- Web site: DLMF: §8.8 Recurrence Relations and Derivatives ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
- Web site: Complex Analysis . Math 534 . Autumn 2009 . Donald E. Marshall . University of Washington . student handout . 2011-04-23 . dead . https://web.archive.org/web/20110516005152/http://www.math.washington.edu/~marshall/math_534/Notes.pdf . 2011-05-16 . Theorem 3.9 on p.56.
- Web site: DLMF: §8.7 Series Expansions ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
- Web site: Paul Garrett. Hartogs' Theorem: separate analyticity implies joint. cse.umn.edu. 21 December 2023.
- Web site: C. Teleman. Riemann Surfaces. berkeley.edu. 21 December 2023.
- Web site: DLMF: §5.2 Definitions ‣ Properties ‣ Chapter 5 Gamma Function. dlmf.nist.gov.
- Web site: DLMF: §4.4 Special Values and Limits ‣ Logarithm, Exponential, Powers ‣ Chapter 4 Elementary Functions. dlmf.nist.gov.
- [Gamma function#General|see last eq.]
- Web site: DLMF: §8.4 Special Values ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
- Web site: DLMF: 8.4 Special Values.
- (equation 2)
- Book: Bender & Orszag . 1978 . Advanced Mathematical Methods for Scientists and Engineers . Springer.
- Web site: DLMF: §8.11 Asymptotic Approximations and Expansions ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
- Web site: DLMF: §8.11 Asymptotic Approximations and Expansions ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
- Abramowitz and Stegun p. 263, 6.5.31
- Web site: scipy.special.gammainc — SciPy v1.11.4 Manual. docs.scipy.org.
- Web site: scipy.special.gammaincc — SciPy v1.11.4 Manual. docs.scipy.org.
- [Keith Geddes|K.O. Geddes]
- M. S. . Milgram. The generalized integro-exponential function. Math. Comp.. 1985. 44. 170. 443–458. 0777276. 10.1090/S0025-5718-1985-0777276-4. free.
- 0912.3844. Mathar. Numerical Evaluation of the Oscillatory Integral over exp(i*pi*x)*x^(1/x) between 1 and infinity. math.CA. 2009., App B
References
- Web site: Incomplete Gamma function . §6.5.
- Giampietro . Allasia. Renata . Besenghi. Numerical calculation of incomplete gamma functions by the trapezoidal rule. Numer. Math.. 50. 4. 10.1007/BF01396662. 1986. 419–428. 121964300.
- Paolo . Amore. Asymptotic and exact series representations for the incomplete Gamma function. Europhys. Lett.. 2005. 2170316. 71 . 1. 1–7 . 10.1209/epl/i2005-10066-6. math-ph/0501019. 2005EL.....71....1A. 1921569.
- G. Arfken and H. Weber. Mathematical Methods for Physicists. Harcourt/Academic Press, 2000. (See Chapter 10.)
- DiDonato . Armido R. . Morris, Jr. . Alfred H. . Computation of the incomplete gamma function ratios and their inverse . ACM Transactions on Mathematical Software . 12 . 4 . 377 - 393 . Dec 1986 . 10.1145/22721.23109 . 14351930 .
- Richard . Barakat. Evaluation of the Incomplete Gamma Function of Imaginary Argument by Chebyshev Polynomials. Math. Comp.. 1961. 0128058. 15 . 73 . 7–11 . 10.1090/s0025-5718-1961-0128058-1. free.
- Petr . Carsky . Martin . Polasek. Incomplete Gamma functions for real and complex arguments. 1998 . 10.1006/jcph.1998.5975 . 143. 1 . 259–265 . J. Comput. Phys. . 1624704. 1998JCoPh.143..259C.
- M. Aslam . Chaudhry . S. M. . Zubair. On the decomposition of generalized incomplete Gamma functions with applications to Fourier transforms. J. Comput. Appl. Math.. 1995 . 59 . 101 . 253–284 . 1346414 . 10.1016/0377-0427(94)00026-w. free .
- DiDonato . Armido R. . Morris, Jr. . Alfred H. . 10.1145/29380.214348 . ALGORITHM 654: FORTRAN subroutines for computing the incomplete gamma function ratios and their inverse . ACM Transactions on Mathematical Software . 13 . 3 . 318 - 319 . Sep 1987 . 19902932 . free . (See also www.netlib.org/toms/654).
- H. . Früchtl . P. . Otto. A new algorithm for the evaluation of the incomplete Gamma Function on vector computers. ACM Trans. Math. Softw.. 1994 . 20 . 4. 436–446 . 10.1145/198429.198432. 16737306 . free .
- Walter . Gautschi. The incomplete gamma function since Tricomi. 1998 . Atti Convegni Lincei . 1737497. 147 . 203–237.
- Walter . Gautschi. A Note on the recursive calculation of Incomplete Gamma Functions. ACM Trans. Math. Softw.. 1999. 1697463 . 25 . 1 . 101–107 . 10.1145/305658.305717. 36469885. free.
- Book: Izrail Solomonovich . Gradshteyn . Izrail Solomonovich Gradshteyn . Iosif Moiseevich . Ryzhik . Iosif Moiseevich Ryzhik . Yuri Veniaminovich . Geronimus . Yuri Veniaminovich Geronimus . Michail Yulyevich . Tseytlin . Michail Yulyevich Tseytlin . Alan . Jeffrey . Daniel . Zwillinger . Victor Hugo . Moll . Victor Hugo Moll . Scripta Technica, Inc. . Table of Integrals, Series, and Products . . 2015 . October 2014 . 8 . en . 978-0-12-384933-5 . 2014010276 . 2016-02-21-->. Gradshteyn and Ryzhik . 8.35. . 908–911 .
- William B. . Jones . W. J. . Thron. On the computation of incomplete gamma functions in the complex domain. 1985. J. Comput. Appl. Math. . 10.1016/0377-0427(85)90034-2. 0793971 . 12-13 . 401–417. free .
- Mathar . Richard J. . Numerical representation of the incomplete gamma function of complex-valued argument . Numerical Algorithms . 2004 . 36 . 3 . 247 - 264 . 10.1023/B:NUMA.0000040063.91709.58 . math/0306184 . 2004NuAlg..36..247M . 2091195 . 30860614 .
- Allen R. . Miller . Ira S. . Moskowitz. On certain Generalized incomplete Gamma functions. 1998 . J. Comput. Appl. Math.. 91 . 2. 179–190 . 10.1016/s0377-0427(98)00031-4. free .
- R. B. . Paris . A uniform asymptotic expansion for the incomplete gamma function. J. Comput. Appl. Math.. 2002 . 10.1016/S0377-0427(02)00553-8. 148 . 2 . 323–339 . 1936142. 2002JCoAM.148..323P. free .
- Book: Press . WH . Teukolsky . SA . Vetterling . WT . Flannery . BP . 2007 . Numerical Recipes: The Art of Scientific Computing . 3rd . Cambridge University Press . New York . 978-0-521-88068-8 . Section 6.2. Incomplete Gamma Function and Error Function . http://apps.nrbook.com/empanel/index.html?pg=259 . 9 August 2011 . 15 April 2021 . https://web.archive.org/web/20210415081842/http://apps.nrbook.com/empanel/index.html?pg=259 . dead .
- Roy . Takenaga . On the Evaluation of the Incomplete Gamma Function. 1966 . Math. Comp. . 20 . 96. 606–610. 0203911 . 10.1090/S0025-5718-1966-0203911-3 . free .
- Nico . Temme. Uniform Asymptotic Expansions of the Incomplete Gamma Functions and the Incomplete Beta Function. Math. Comp.. 10.1090/S0025-5718-1975-0387674-2 . 29 . 132 . 1975 . 1109–1114 . 0387674. free.
- Riho . Terras. The determination of incomplete Gamma Functions through analytic integration. 1979 . J. Comput. Phys. . 31 . 1. 146–151. 0531128 . 10.1016/0021-9991(79)90066-4. 1979JCoPh..31..146T.
- Francesco G. . Tricomi. Sulla funzione gamma incompleta. 1950. 10.1007/BF02428264 . Ann. Mat. Pura Appl.. 31. 263–279. 0047834. 120404791.
- F. G. . Tricomi. Asymptotische Eigenschaften der unvollst. Gammafunktion. 1950. 0045253. Math. Z. . 136–148. 53. 2. 10.1007/bf01162409. 121234109.
- Joris . van Deun . Ronald . Cools. A stable recurrence for the incomplete gamma function with imaginary second argument. Numer. Math. . 2006 . 10.1007/s00211-006-0026-1 . 445–456 . 104. 4 . 2249673. 43780150 .
External links
—
Regularized Lower Incomplete Gamma Function Calculator
—
Regularized Upper Incomplete Gamma Function Calculator
—
Lower Incomplete Gamma Function Calculator
—
Upper Incomplete Gamma Function Calculator