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: \Gamma(s,x) = \int_x^ t^\,e^\, dt,whereas the lower incomplete gamma function is defined as: \gamma(s,x) = \int_0^x t^\,e^\, dt .In both cases is a complex parameter, such that the real part of is positive.

Properties

By integration by parts we find the recurrence relations \Gamma(s+1,x) = s\Gamma(s,x) + x^ e^and \gamma(s+1,x) = s\gamma(s,x) - x^ e^.Since the ordinary gamma function is defined as \Gamma(s) = \int_0^ t^\,e^\, dtwe have \Gamma(s) = \Gamma(s,0) = \lim_ \gamma(s,x)and \gamma(s,x) + \Gamma(s,x) = \Gamma(s).

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] \gamma(s, x) = \sum_^\infty \frac = x^s \, \Gamma(s) \, e^ \sum_^\infty\frac.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 Weierstraß,[3] the limiting function, sometimes denoted as [4] \gamma^*(s, z) := e^\sum_^\infty\fracis 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] \gamma(s,z) = z^s \, \Gamma(s) \, \gamma^*(s,z),extends the real lower incomplete gamma function as a holomorphic function, both jointly and separately in and . It follows from the properties of

zs

and the Γ-function, that the first two factors capture the singularities of

\gamma(s,z)

(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 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

e2\pi

,[1] for a suitable integer.
Behavior near branch point

The decomposition above further shows, that γ behaves near asymptotically like:\gamma(s, z) \asymp z^s \, \Gamma(s) \, \gamma^*(s, 0) = z^s \, \Gamma(s)/\Gamma(s+1) = z^s/s.

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,\int_u^v t^\,e^\, dt = \gamma(s,v) - \gamma(s,u)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] \gamma(s, z) = \int_0^z t^\,e^\, dt, \, \Re(s) > 0.

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] \Gamma(s) = \int_0^\infty t^\,e^\, dt = \lim_ \gamma(s, x)

=s complex

=This result extends to complex . Assume first and . Then\left|\gamma(s, b) - \gamma(s, a)\right| \le \int_a^b \left|t^\right| e^\, dt = \int_a^b t^ e^\, dt \le \int_a^b t e^\, dtwhere[8] \left|z^s\right| = \left|z\right|^ \, e^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 follows\Gamma(s) = \lim_ \gamma(s, x)for 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\Gamma(s) - \gamma(s, u) = \Gamma(s) - \gamma(s, |u|) + \gamma(s, |u|) - \gamma(s, u).

As shown above, the first difference can be made arbitrarily small, if is sufficiently large. The second difference allows for following estimation:\left|\gamma(s, |u|) - \gamma(s, u)\right| \le \int_u^

\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\le R \left|\arg u\right| R^\, e^\,e^ \le \delta\,R^\,e^\,e^ = M\,(R\,\cos\delta)^\,e^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:\Gamma(s) = \lim_
\to \infty
\gamma(s, z), \quad \left|\arg z\right| < \pi/2 - \epsilon,if is not a non-negative integer, is arbitrarily small, but fixed, and denotes the principal branch on this domain.
Overview

\gamma(s,z)

is:

Upper incomplete gamma function

As for the upper incomplete gamma function, a holomorphic extension, with respect to or, is given by[1] \Gamma(s,z) = \Gamma(s) - \gamma(s, z)at points, where the right hand side exists. Since

\gamma

is multi-valued, the same holds for

\Gamma

, but a restriction to principal values only yields the single-valued principal branch of

\Gamma

.

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

\Gamma(s,z)

proves to be bounded in a neighbourhood of that limit for a fixed .

To determine the limit, the power series of

\gamma*

at is useful. When replacing

e-x

by its power series in the integral definition of

\gamma

, one obtains (assume, positive reals for now):\gamma(s, x) = \int_0^x t^ e^ \, dt = \int_0^x \sum_^\infty \left(-1\right)^k \, \frac \, dt = \sum_^\infty \left(-1\right)^k \, \frac = x^s\,\sum_^\infty \fracor[4] \gamma^*(s,x) = \sum_^\infty \frac,which, as a series representation of the entire

\gamma*

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:\gamma(s, z) - \frac = - \frac + z^s\,\sum_^\infty \frac = \frac + z^s\, \sum_^\infty \frac,\quad \Re(s) > -1, \,s \ne 0.

When :[9] \frac \to \ln(z),\quad \Gamma(s) - \frac = \frac - \gamma + O(s) - \frac \to -\gamma,(

\gamma

is the Euler–Mascheroni constant here), hence,\Gamma(0,z) = \lim_\left(\Gamma(s) - \tfrac - (\gamma(s, z) - \tfrac)\right) = -\gamma - \ln(z) - \sum_^\infty \fracis 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

\Gamma(-n,z)

for positive integers can be derived from this result,[11] \Gamma(-n, z) = \frac \left(\frac \sum_^ (-1)^k (n - k - 1)! \, z^k + \left(-1\right)^n \Gamma(0, z)\right)so the upper incomplete gamma function proves to exist and be holomorphic, with respect both to and, for all and .

\Gamma(s,z)

is:

\Gamma(s)

for with positive real part and (the limit when

(si,zi)\to(s,0)

), but this is a continuous extension, not an analytic one (does not hold for real !);

Special values

\Gamma(s+1,1)=

\lfloores!\rfloor
e

if is a positive integer,

\Gamma(s,x)=(s-1)!e-x

s-1
\sum
k=0
xk
k!
if is a positive integer,[12]

\Gamma(s,0)=\Gamma(s),\Re(s)>0

,

\Gamma(1,x)=e-x

,

\gamma(1,x)=1-e-x

,

\Gamma(0,x)=-\operatorname{Ei}(-x)

for

x>0

,

\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,

\operatorname{Ei}

is the exponential integral,

\operatorname{E}n

is the generalized exponential integral,

\operatorname{erf}

is the error function, and

\operatorname{erfc}

is the complementary error function,

\operatorname{erfc}(x)=1-\operatorname{erf}(x)

.

Asymptotic behavior

\gamma(s,x)
xs

\to

1
s
as

x\to0

,
\Gamma(s,x)
xs

\to-

1
s
as

x\to0

and

\Re(s)<0

(for real, the error of is on the order of if and if),

\Gamma(s,x)\sim\Gamma(s)-

infty
\sum
n=0

(-1)n

xs+n
n!(s+n)
as an asymptotic series where

x\to0+

and

s0,-1,-2,...

.[13]

\Gamma(-N,x)\simCN+

(-1)N+1
N!

lnx-

infty
\sum
n=0,n\neN

(-1)n

xn-N
n!(n-N)
as an asymptotic series where

x\to0+

and

N=1,2,...

, where C_N = \frac \left(\gamma - \displaystyle\sum_^N \frac \right), where

\gamma

is the Euler-Mascheroni constant.[13]

\gamma(s,x)\to\Gamma(s)

as

x\toinfty

,
\Gamma(s,x)
xs-1e-x

\to1

as

x\toinfty

,

\Gamma(s,z)\simzs-1e-z\sumk=0

\Gamma(s)
\Gamma(s-k)

z-k

as an asymptotic series where

|z|\toinfty

and

\left|\argz\right|<\tfrac{3}{2}\pi

.[14]

Evaluation formulae

The lower gamma function can be evaluated using the power series expansion:[15] \gamma(s, z) = \sum_^\infty \frac=z^s e^\sum_^\infty\dfracwhere

s\overline{k+1

}is the Pochhammer symbol.

An alternative expansion is\gamma(s,z)= \sum_^\infty \frac \frac= \frac M(s, s+1,-z),where is Kummer's confluent hypergeometric function.

Connection with Kummer's confluent hypergeometric function

When the real part of is positive,\gamma(s,z) = s^ z^s e^ M(1,s+1,z)where M(1, s+1, z) = 1 + \frac + \frac + \frac + \cdots has an infinite radius of convergence.

Again with confluent hypergeometric functions and employing Kummer's identity,\begin\Gamma(s,z) &= e^ U(1-s,1-s,z) = \frac \int_0^\infty \frac du \\&= e^ z^s U(1,1+s,z) = e^ \int_0^\infty e^ (z+u)^ du = e^ z^s \int_0^\infty e^ (1+u)^ du.\end

For the actual computation of numerical values, Gauss's continued fraction provides a useful expansion:\gamma(s, z) = \cfrac.

This continued fraction converges for all complex, provided only that is not a negative integer.

The upper gamma function has the continued fraction[16] \Gamma(s, z) = \cfracand\Gamma(s, z)= \cfrac

Multiplication theorem

The following multiplication theorem holds true:\Gamma(s,z) = \frac 1 \sum_^ \frac \Gamma(s+i,t z)= \Gamma(s,t z) -(t z)^s e^ \sum_^ \frac L_^(t z).

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.

\gamma(s,x)

= EXP(GAMMALN(s))*GAMMA.DIST(x,s,1,TRUE).

\Gamma(s,x)

= 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:\beginP(s,x) &= \frac, \\[1ex]Q(s,x) &= \frac = 1 - P(s,x).\end

P(s,x)

is the cumulative distribution function for gamma random variables with shape parameter

s

and scale parameter 1.

When

s

is an integer,

Q(s,λ)

is the cumulative distribution function for Poisson random variables: If

X

is a

Poi(λ)

random variable then \Pr(X

This formula can be derived by repeated integration by parts.

In the context of the stable count distribution, the

s

parameter can be regarded as inverse of Lévy's stability parameter

\alpha

: Q(s,x) = \int_0^\infty e^ \, \mathfrak_\left(\nu\right) \, d\nu, \quad (s > 1)where

ak{N}\alpha(\nu)

is a standard stable count distribution of shape

\alpha=1/s<1

.

P(s,x)

and

Q(s,x)

are implemented as gammainc[17] and gammaincc[18] in scipy.

Derivatives

Using the integral representation above, the derivative of the upper incomplete gamma function

\Gamma(s,x)

with respect to is \frac = - x^ e^The derivative with respect to its first argument

s

is given by[19] \frac = \ln x \Gamma (s,x) + x\,T(3,s,x)and the second derivative by\frac = \ln^2 x \Gamma (s,x) + 2 x \left[\ln x\,T(3,s,x) + T(4,s,x) \right]where the function

T(m,s,x)

is a special case of the Meijer G-functionT(m,s,x) = G_^ \!\left(\left. \begin 0, 0, \dots, 0 \\ s-1, -1, \dots, -1 \end \; \right| \, x \right).This particular special case has internal closure properties of its own because it can be used to express all successive derivatives. In general, \frac = \ln^m x \Gamma (s,x) + m x\,\sum_^ P_n^ \ln^ x\,T(3+n,s,x)where
n
P
j
is the permutation defined by the Pochhammer symbol:P_j^n = \binom j! = \frac.All such derivatives can be generated in succession from:\frac = \ln x ~ T(m,s,x) + (m-1) T(m+1,s,x)and\frac = -\fracThis function

T(m,s,x)

can be computed from its series representation valid for

|z|<1

, T(m,s,z) = - \frac \left.\frac \left[\Gamma (s-t) z^{t-1}\right]\right|_ + \sum_^ \fracwith the understanding that is not a negative integer or zero. In such a case, one must use a limit. Results for

|z|\ge1

can be obtained by analytic continuation. Some special cases of this function can be simplified. For example,

T(2,s,x)=\Gamma(s,x)/x

,

xT(3,1,x)=E1(x)

, where

E1(x)

is the Exponential integral. These derivatives and the function

T(m,s,x)

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, \int_^ \frac dt= \frac \int_^ \frac dt = \frac \Gamma (s,x)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):\begin\int x^ \gamma(s,x) \, dx &= \frac \left(x^b \gamma(s,x) - \gamma(s+b,x) \right), \\[1ex]\int x^ \Gamma(s,x) \, dx &= \frac \left(x^b \Gamma(s,x) - \Gamma(s+b,x) \right).\endThe lower and the upper incomplete gamma function are connected via the Fourier transform:\int_^\infty \frac e^ dz = \frac .This follows, for example, by suitable specialization of .

Notes

  1. Web site: DLMF: §8.2 Definitions and Basic Properties ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions . dlmf.nist.gov.
  2. Web site: DLMF: §8.8 Recurrence Relations and Derivatives ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
  3. 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.
  4. Web site: DLMF: §8.7 Series Expansions ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
  5. Web site: Paul Garrett. Hartogs' Theorem: separate analyticity implies joint. cse.umn.edu. 21 December 2023.
  6. Web site: C. Teleman. Riemann Surfaces. berkeley.edu. 21 December 2023.
  7. Web site: DLMF: §5.2 Definitions ‣ Properties ‣ Chapter 5 Gamma Function. dlmf.nist.gov.
  8. Web site: DLMF: §4.4 Special Values and Limits ‣ Logarithm, Exponential, Powers ‣ Chapter 4 Elementary Functions. dlmf.nist.gov.
  9. [Gamma function#General|see last eq.]
  10. Web site: DLMF: §8.4 Special Values ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
  11. Web site: DLMF: 8.4 Special Values.
  12. (equation 2)
  13. Book: Bender & Orszag . 1978 . Advanced Mathematical Methods for Scientists and Engineers . Springer.
  14. Web site: DLMF: §8.11 Asymptotic Approximations and Expansions ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
  15. Web site: DLMF: §8.11 Asymptotic Approximations and Expansions ‣ Incomplete Gamma Functions ‣ Chapter 8 Incomplete Gamma and Related Functions. dlmf.nist.gov.
  16. Abramowitz and Stegun p. 263, 6.5.31
  17. Web site: scipy.special.gammainc — SciPy v1.11.4 Manual. docs.scipy.org.
  18. Web site: scipy.special.gammaincc — SciPy v1.11.4 Manual. docs.scipy.org.
  19. [Keith Geddes|K.O. Geddes]
  20. M. S. . Milgram. The generalized integro-exponential function. Math. Comp.. 1985. 44. 170. 443–458. 0777276. 10.1090/S0025-5718-1985-0777276-4. free.
  21. 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

External links

P(a,x)

Regularized Lower Incomplete Gamma Function Calculator

Q(a,x)

Regularized Upper Incomplete Gamma Function Calculator

\gamma(a,x)

Lower Incomplete Gamma Function Calculator

\Gamma(a,x)

Upper Incomplete Gamma Function Calculator