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, , integrates from to , while the upper incomplete gamma function, , integrates from 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 with and a real argument , the lower incomplete gamma function is
For , the upper incomplete gamma function is
The upper integral converges for every complex when ; the lower integral requires because its integration interval includes the origin. The power is unambiguous on the positive real axis, where it means .
Splitting the defining integral of the complete gamma function gives
Thus “incomplete” refers to integration over only part of the complete interval, not to an approximation. The distinction between the lowercase and uppercase , and between one-argument and two-argument notation, is essential.
For real ,
and
Regularized functions
The regularized incomplete gamma functions are
For and , they satisfy
As functions of , increases from to , while decreases from to . Their normalization makes them particularly useful in probability: represents an accumulated lower-tail probability, and represents the complementary upper-tail probability.
Software conventions vary. A routine named “incomplete gamma” may return , , , or , 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
Consequently,
Integration by parts yields the recurrence relations
For positive real , the corresponding regularized relations are
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 and ,
Special values and related functions
Integer parameters
At ,
For a positive integer , repeated application of the recurrence gives
and therefore
Here is a factorial. These finite sums connect incomplete gamma functions with Poisson probabilities.
Half-integer parameters
The error function is defined by
Its complementary form is . Substituting in the incomplete gamma integrals gives
Recurrence then expresses all positive half-integer cases using the error function and elementary terms.
Exponential integrals
For ,
where is an exponential integral. More generally, defining
gives
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
For positive real and , a useful nonalternating representation is
Equivalently,
In particular, for fixed as ,
For fixed and large positive , repeated integration by parts yields the asymptotic expansion
This expansion is generally asymptotic rather than convergent. For positive integer , it terminates and becomes the exact finite-sum formula.
When is large and is near , fixed-parameter large- 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 follows a gamma distribution with shape and scale , its density is
Its cumulative distribution function and upper-tail probability are
For a chi-squared distribution with degrees of freedom, the shape is and the scale is , so
Incomplete gamma functions therefore enter chi-squared tail calculations and related statistical procedures.
Poisson probabilities
If has a Poisson distribution with mean , then for a nonnegative integer ,
Correspondingly,
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 satisfying ,
Replacing the lower incomplete gamma function by the upper one gives the corresponding moment over . Such expressions are used in truncated distributions and conditional expected values.
For fixed , the strict increase of allows inversion with respect to . Solving
produces gamma quantiles. These inverses generally require numerical computation.
Complex arguments and analytic continuation
Extension to a complex second argument requires a choice of branch for the logarithm in . 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 , the upper incomplete gamma function is an entire function of the complex parameter . The lower function has a meromorphic analytic continuation in , with simple poles at
whose residues are at . These poles follow from
because the upper function is entire in 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- 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 when is large.
- Recurrence relations shift parameters into regions where another method is accurate.
A central issue is numerical stability. If is extremely close to , computing as may lose most or all significant digits. Accurate routines therefore evaluate the smaller tail directly when needed.
The prefactor can also overflow or underflow in floating-point arithmetic. Computing its logarithm,
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.