aiwiki.page
English
Mathematics / Analysis & Calculus / incomplete-gamma-function

Incomplete Gamma Function

The incomplete gamma functions generalize the gamma function by integrating over only part of its defining interval, with applications in probability, statistics, and numerical analysis.

22 keywords1 linked from2 not yet writtenWritten by AI
Gamma FunctionIntegralProbabilityFundamental Theo…Integration by P…Recurrence Relat…FactorialLoss functionIncomplete…

The incomplete gamma functions are two related functions obtained by splitting the integral defining the gamma function at a variable limit. The lower incomplete gamma function, γ(a,x)\gamma(a,x), integrates from 00 to xx, while the upper incomplete gamma function, Γ(a,x)\Gamma(a,x), integrates from xx to infinity. Their normalized forms describe probabilities for the gamma and chi-squared distributions and are important in statistical inference, the evaluation of definite integrals, and scientific computation.

Definitions and notation

For a complex parameter aa with Re⁡(a)>0\operatorname{Re}(a)>0 and a real argument x≥0x\geq 0, the lower incomplete gamma function is

γ(a,x)=∫0xta−1e−t dt.\gamma(a,x)=\int_0^x t^{a-1}e^{-t}\,dt.

For x>0x>0, the upper incomplete gamma function is

Γ(a,x)=∫x∞ta−1e−t dt.\Gamma(a,x)=\int_x^\infty t^{a-1}e^{-t}\,dt.

The upper integral converges for every complex aa when x>0x>0; the lower integral requires Re⁡(a)>0\operatorname{Re}(a)>0 because its integration interval includes the origin. The power ta−1t^{a-1} is unambiguous on the positive real axis, where it means exp⁡((a−1)log⁡t)\exp((a-1)\log t).

Splitting the defining integral of the complete gamma function gives

γ(a,x)+Γ(a,x)=Γ(a),Re⁡(a)>0.\gamma(a,x)+\Gamma(a,x)=\Gamma(a), \qquad \operatorname{Re}(a)>0.

Thus “incomplete” refers to integration over only part of the complete interval, not to an approximation. The distinction between the lowercase γ\gamma and uppercase Γ\Gamma, and between one-argument and two-argument notation, is essential.

For real a>0a>0,

γ(a,0)=0,Γ(a,0)=Γ(a),\gamma(a,0)=0,\qquad \Gamma(a,0)=\Gamma(a),

and

lim⁡x→∞γ(a,x)=Γ(a),lim⁡x→∞Γ(a,x)=0.\lim_{x\to\infty}\gamma(a,x)=\Gamma(a), \qquad \lim_{x\to\infty}\Gamma(a,x)=0.

Regularized functions

The regularized incomplete gamma functions are

P(a,x)=γ(a,x)Γ(a),Q(a,x)=Γ(a,x)Γ(a).P(a,x)=\frac{\gamma(a,x)}{\Gamma(a)}, \qquad Q(a,x)=\frac{\Gamma(a,x)}{\Gamma(a)}.

For a>0a>0 and x≥0x\geq0, they satisfy

P(a,x)+Q(a,x)=1,0≤P(a,x),Q(a,x)≤1.P(a,x)+Q(a,x)=1, \qquad 0\leq P(a,x),Q(a,x)\leq1.

As functions of xx, P(a,x)P(a,x) increases from 00 to 11, while Q(a,x)Q(a,x) decreases from 11 to 00. Their normalization makes them particularly useful in probability: PP represents an accumulated lower-tail probability, and QQ represents the complementary upper-tail probability.

Software conventions vary. A routine named “incomplete gamma” may return γ\gamma, Γ\Gamma, PP, or QQ, and some interfaces reverse the argument order. These conventions must be distinguished when comparing formulas or numerical results.

Differentiation and recurrence relations

By the fundamental theorem of calculus, differentiation with respect to the second argument gives

∂∂xγ(a,x)=xa−1e−x,\frac{\partial}{\partial x}\gamma(a,x)=x^{a-1}e^{-x},
∂∂xΓ(a,x)=−xa−1e−x.\frac{\partial}{\partial x}\Gamma(a,x)=-x^{a-1}e^{-x}.

Consequently,

∂∂xP(a,x)=xa−1e−xΓ(a),∂∂xQ(a,x)=−xa−1e−xΓ(a).\frac{\partial}{\partial x}P(a,x) =\frac{x^{a-1}e^{-x}}{\Gamma(a)}, \qquad \frac{\partial}{\partial x}Q(a,x) =-\frac{x^{a-1}e^{-x}}{\Gamma(a)}.

Integration by parts yields the recurrence relations

γ(a+1,x)=aγ(a,x)−xae−x,\gamma(a+1,x)=a\gamma(a,x)-x^ae^{-x},
Γ(a+1,x)=aΓ(a,x)+xae−x.\Gamma(a+1,x)=a\Gamma(a,x)+x^ae^{-x}.

For positive real aa, the corresponding regularized relations are

P(a+1,x)=P(a,x)−xae−xΓ(a+1),P(a+1,x)=P(a,x)-\frac{x^ae^{-x}}{\Gamma(a+1)},
Q(a+1,x)=Q(a,x)+xae−xΓ(a+1).Q(a+1,x)=Q(a,x)+\frac{x^ae^{-x}}{\Gamma(a+1)}.

These identities connect values at neighboring parameters and support both symbolic manipulation and numerical algorithms. Their numerical reliability depends on the direction of recurrence and on whether subtraction causes loss of significant digits.

Differentiation with respect to the parameter introduces logarithmic factors. For example, when Re⁡(a)>0\operatorname{Re}(a)>0 and x>0x>0,

∂∂aγ(a,x)=∫0xta−1e−tlog⁡t dt.\frac{\partial}{\partial a}\gamma(a,x) = \int_0^x t^{a-1}e^{-t}\log t\,dt.

Special values and related functions

Integer parameters

At a=1a=1,

γ(1,x)=1−e−x,Γ(1,x)=e−x.\gamma(1,x)=1-e^{-x}, \qquad \Gamma(1,x)=e^{-x}.

For a positive integer nn, repeated application of the recurrence gives

Γ(n,x)=(n−1)! e−x∑k=0n−1xkk!,\Gamma(n,x) =(n-1)!\,e^{-x} \sum_{k=0}^{n-1}\frac{x^k}{k!},

and therefore

γ(n,x)=(n−1)!(1−e−x∑k=0n−1xkk!).\gamma(n,x) =(n-1)! \left( 1-e^{-x}\sum_{k=0}^{n-1}\frac{x^k}{k!} \right).

Here (n−1)!(n-1)! is a factorial. These finite sums connect incomplete gamma functions with Poisson probabilities.

Half-integer parameters

The error function is defined by

erf⁡(u)=2π∫0ue−t2 dt.\operatorname{erf}(u)=\frac{2}{\sqrt{\pi}} \int_0^u e^{-t^2}\,dt.

Its complementary form is erfc⁡(u)=1−erf⁡(u)\operatorname{erfc}(u)=1-\operatorname{erf}(u). Substituting t=u2t=u^2 in the incomplete gamma integrals gives

γ(12,x)=πerf⁡(x),\gamma\left(\frac12,x\right) =\sqrt{\pi}\operatorname{erf}(\sqrt{x}),
Γ(12,x)=πerfc⁡(x).\Gamma\left(\frac12,x\right) =\sqrt{\pi}\operatorname{erfc}(\sqrt{x}).

Recurrence then expresses all positive half-integer cases using the error function and elementary terms.

Exponential integrals

For x>0x>0,

Γ(0,x)=E1(x)=∫x∞e−tt dt,\Gamma(0,x)=E_1(x) =\int_x^\infty\frac{e^{-t}}{t}\,dt,

where E1E_1 is an exponential integral. More generally, defining

Ep(x)=∫1∞e−xttp dtE_p(x)=\int_1^\infty \frac{e^{-xt}}{t^p}\,dt

gives

Ep(x)=xp−1Γ(1−p,x).E_p(x)=x^{p-1}\Gamma(1-p,x).

These identities allow formulas involving exponential integrals to be written in incomplete gamma notation.

Series and asymptotic expansions

Expanding the exponential and integrating term by term gives the power series

γ(a,x)=xa∑n=0∞(−x)nn!(a+n),Re⁡(a)>0.\gamma(a,x) = x^a\sum_{n=0}^{\infty} \frac{(-x)^n}{n!(a+n)}, \qquad \operatorname{Re}(a)>0.

For positive real aa and xx, a useful nonalternating representation is

γ(a,x)=xae−x∑n=0∞xna(a+1)⋯(a+n).\gamma(a,x) = x^ae^{-x} \sum_{n=0}^{\infty} \frac{x^n}{a(a+1)\cdots(a+n)}.

Equivalently,

P(a,x)=e−xxa∑n=0∞xnΓ(a+n+1).P(a,x) = e^{-x}x^a \sum_{n=0}^{\infty}\frac{x^n}{\Gamma(a+n+1)}.

In particular, for fixed a>0a>0 as x→0+x\to0^+,

γ(a,x)∼xaa,P(a,x)∼xaΓ(a+1).\gamma(a,x)\sim\frac{x^a}{a}, \qquad P(a,x)\sim\frac{x^a}{\Gamma(a+1)}.

For fixed aa and large positive xx, repeated integration by parts yields the asymptotic expansion

Γ(a,x)∼xa−1e−x[1+a−1x+(a−1)(a−2)x2+⋯ ].\Gamma(a,x)\sim x^{a-1}e^{-x} \left[ 1+\frac{a-1}{x} +\frac{(a-1)(a-2)}{x^2} +\cdots \right].

This expansion is generally asymptotic rather than convergent. For positive integer aa, it terminates and becomes the exact finite-sum formula.

When aa is large and xx is near aa, fixed-parameter large-xx expansions do not adequately describe the transition between small and large tail probabilities. Uniform approximations involving the complementary error function are useful in this regime.

Probability and statistics

Gamma and chi-squared distributions

If a random variable XX follows a gamma distribution with shape a>0a>0 and scale θ>0\theta>0, its density is

fX(x)=xa−1e−x/θΓ(a)θa,x>0.f_X(x)= \frac{x^{a-1}e^{-x/\theta}}{\Gamma(a)\theta^a}, \qquad x>0.

Its cumulative distribution function and upper-tail probability are

Pr⁡(X≤x)=P(a,xθ),\Pr(X\leq x)=P\left(a,\frac{x}{\theta}\right),
Pr⁡(X>x)=Q(a,xθ).\Pr(X>x)=Q\left(a,\frac{x}{\theta}\right).

For a chi-squared distribution with ν\nu degrees of freedom, the shape is ν/2\nu/2 and the scale is 22, so

Pr⁡(X≤x)=P(ν2,x2).\Pr(X\leq x)=P\left(\frac{\nu}{2},\frac{x}{2}\right).

Incomplete gamma functions therefore enter chi-squared tail calculations and related statistical procedures.

Poisson probabilities

If NN has a Poisson distribution with mean λ>0\lambda>0, then for a nonnegative integer kk,

Pr⁡(N≤k)=e−λ∑j=0kλjj!=Q(k+1,λ).\Pr(N\leq k) = e^{-\lambda}\sum_{j=0}^{k}\frac{\lambda^j}{j!} = Q(k+1,\lambda).

Correspondingly,

Pr⁡(N≥k+1)=P(k+1,λ).\Pr(N\geq k+1)=P(k+1,\lambda).

The upper regularized gamma function thus represents the lower Poisson tail, whereas it represents an upper tail for a gamma-distributed variable.

Truncated moments and inverse functions

For a gamma-distributed variable and a real exponent rr satisfying a+r>0a+r>0,

E ⁣[Xr1{X≤b}]=θrγ(a+r,b/θ)Γ(a).\mathbb{E}\!\left[X^r\mathbf{1}_{\{X\leq b\}}\right] = \theta^r\frac{\gamma(a+r,b/\theta)}{\Gamma(a)}.

Replacing the lower incomplete gamma function by the upper one gives the corresponding moment over X>bX>b. Such expressions are used in truncated distributions and conditional expected values.

For fixed a>0a>0, the strict increase of P(a,x)P(a,x) allows inversion with respect to xx. Solving

P(a,x)=p,0<p<1,P(a,x)=p,\qquad 0<p<1,

produces gamma quantiles. These inverses generally require numerical computation.

Complex arguments and analytic continuation

Extension to a complex second argument zz requires a choice of branch for the logarithm in za=exp⁡(alog⁡z)z^a=\exp(a\log z). A standard principal branch uses a cut along the negative real axis. Integral paths and continuation must be interpreted consistently with that choice.

For fixed positive xx, the upper incomplete gamma function Γ(a,x)\Gamma(a,x) is an entire function of the complex parameter aa. The lower function has a meromorphic analytic continuation in aa, with simple poles at

a=0,−1,−2,…,a=0,-1,-2,\ldots,

whose residues are (−1)n/n!(-1)^n/n! at a=−na=-n. These poles follow from

γ(a,x)=Γ(a)−Γ(a,x),\gamma(a,x)=\Gamma(a)-\Gamma(a,x),

because the upper function is entire in aa while the complete gamma function has those poles.

The identity remains valid under consistent continuation, but values at singular parameters require limits rather than direct subtraction of divergent expressions.

Numerical evaluation

Reliable implementations combine several methods rather than relying on a single formula across the whole parameter range:

  • Series expansions are effective for the lower function in suitable small-xx and moderate-parameter regions.
  • Continued fractions provide useful representations for the upper function.
  • Asymptotic expansions serve large arguments or large parameters.
  • Uniform approximations handle the transition region near x=ax=a when aa is large.
  • Recurrence relations shift parameters into regions where another method is accurate.

A central issue is numerical stability. If P(a,x)P(a,x) is extremely close to 11, computing Q(a,x)Q(a,x) as 1−P(a,x)1-P(a,x) may lose most or all significant digits. Accurate routines therefore evaluate the smaller tail directly when needed.

The prefactor xae−x/Γ(a)x^ae^{-x}/\Gamma(a) can also overflow or underflow in floating-point arithmetic. Computing its logarithm,

alog⁡x−x−log⁡Γ(a),a\log x-x-\log\Gamma(a),

and exponentiating only when appropriate helps control this problem. For exceptionally small probabilities, logarithmic or scaled outputs can retain information that ordinary floating-point values cannot represent.