Fact-checked by Grok 2 weeks ago

Incomplete gamma function

The incomplete gamma function refers to a pair of in : the lower incomplete gamma function \gamma(a, x) = \int_0^x t^{a-1} e^{-t} \, dt and the upper incomplete gamma function \Gamma(a, x) = \int_x^\infty t^{a-1} e^{-t} \, dt, defined for complex numbers a with positive real part \Re(a) > 0. These functions represent truncated versions of the defining the complete \Gamma(a) = \int_0^\infty t^{a-1} e^{-t} \, dt, satisfying the identity \gamma(a, x) + \Gamma(a, x) = \Gamma(a). Often studied in their normalized or regularized forms, such as P(a, x) = \gamma(a, x)/\Gamma(a) and Q(a, x) = \Gamma(a, x)/\Gamma(a), they provide values between 0 and 1 that are particularly useful in probabilistic interpretations. Originating from Leonhard Euler's 1730 integral representation of the , the incomplete variants emerged naturally by partitioning the integration limits, with early systematic studies appearing in the . Significant advancements in their analytic properties, including series expansions, asymptotic behaviors, and continuation to the , were developed throughout the , notably by Francesco Tricomi, who described them as the "Cinderella of " due to their overlooked yet versatile nature. In statistics and probability, the incomplete gamma functions are essential for expressing the cumulative distribution function (CDF) of the gamma distribution, where F(x; a, \theta) = P(a, x/\theta) for scale parameter \theta > 0. They underpin the chi-squared distribution, a special case of the gamma with shape k/2 and scale 2 (for k degrees of freedom), whose CDF is F(x; k) = P(k/2, x/2). Similarly, the CDF of the Poisson distribution with parameter \lambda relates to the upper incomplete gamma via F(k; \lambda) = Q(k+1, \lambda). Beyond probability, these functions appear in physics for modeling diffusion processes and in quantum chemistry for electron repulsion integrals over Gaussian basis functions. Their computation involves power series for small arguments, continued fractions, or asymptotic expansions for large ones, ensuring numerical reliability across software libraries.

Definitions

Lower incomplete gamma function

The lower incomplete gamma function, denoted \gamma(s,x), is defined for complex parameters s with \Re(s)>0 and nonnegative real x \geq 0 by the \gamma(s,x)=\int_{0}^{x}t^{s-1}e^{-t}\,dt. This representation highlights its role as a truncated version of the complete \Gamma(s)=\int_{0}^{\infty}t^{s-1}e^{-t}\,dt, capturing the contribution from the lower limit of integration up to x. The function is entire in s for fixed x>0 and increases monotonically from \gamma(s,0)=0 to \Gamma(s) as x \to \infty. An equivalent power series expansion, valid for all x \geq 0 and \Re(s)>0, is \gamma(s,x)=x^{s}\sum_{k=0}^{\infty}\frac{(-1)^{k}x^{k}}{k!(s+k)}, which follows from term-by-term integration of the exponential series within the defining integral. This series converges absolutely and provides a practical computational tool for small to moderate x, with the first few terms yielding accurate approximations in such regimes. Additionally, \gamma(s,x) admits a representation in terms of the confluent hypergeometric function of the first kind M(1;s+1;x), given by \gamma(s,x)=s^{-1}x^{s}e^{-x}M(1;s+1;x), for s \neq 0,-1,-2,\dots, linking it to broader hypergeometric theory. A normalized form, often denoted P(s,x)=\gamma(s,x)/\Gamma(s), represents the regularized lower incomplete gamma function and satisfies $0 \leq P(s,x) \leq 1 for x \geq 0, with P(s,x) \to 1 as x \to \infty. This normalization is particularly useful in probabilistic interpretations.

Upper incomplete gamma function

The upper incomplete gamma function, denoted \Gamma(a,z), is defined as the \Gamma(a,z)=\int_{z}^{\infty}t^{a-1}e^{-t}\,\mathrm{d}t, where \Re(a)>0 and the path of integration lies in the right half-plane, avoiding the origin and the negative real axis to ensure principal values. This representation captures the "tail" of the integral from z to infinity, contrasting with the lower incomplete gamma function that integrates from 0 to z. The definition originates from early 19th-century extensions of Euler's integral for the , formalized by in his 1811 work Exercices de calcul intégral. For \Re(a)>0 and z not on the branch cut, \Gamma(a,z) satisfies the fundamental partitioning relation \gamma(a,z)+\Gamma(a,z)=\Gamma(a), where \gamma(a,z) is the lower incomplete gamma function and \Gamma(a) is the complete ; this equality extends by to all complex a except the non-positive integers a=0,-1,-2,\dots. The function is entire in a for fixed z and holomorphic in z in the minus the branch cut along the negative real axis, with the principal branch defined such that \arg(z) \in (-\pi,\pi). A normalized form, often used in probability and statistics, is the complementary cumulative distribution function Q(a,z)=\frac{\Gamma(a,z)}{\Gamma(a)}, which satisfies Q(a,z)+P(a,z)=1, where P(a,z)=\gamma(a,z)/\Gamma(a) is the regularized lower incomplete gamma function. This normalization facilitates numerical evaluation and asymptotic analysis.

Fundamental Properties

Relation to the complete gamma function

The lower incomplete gamma function \gamma(s, x) and the upper incomplete gamma function \Gamma(s, x) are related to the complete \Gamma(s) by the fundamental identity \gamma(s, x) + \Gamma(s, x) = \Gamma(s), which holds for \Re s > 0, x > 0, and s \neq 0, -1, -2, \dots. This relation arises directly from the integral representations, as the path from $0 to x combined with the path from x to \infty (along the positive real axis) yields the full integral defining \Gamma(s). The normalized (or regularized) incomplete gamma functions provide a probabilistic interpretation of this relation: P(s, x) = \frac{\gamma(s, x)}{\Gamma(s)}, \quad Q(s, x) = \frac{\Gamma(s, x)}{\Gamma(s)}, satisfying P(s, x) + Q(s, x) = 1 under the same conditions on s and x. These normalized forms express the incomplete gamma functions as fractions of the complete , facilitating computations and analyses where the total \Gamma(s) serves as a scaling factor. For complex arguments, the \gamma(s, z) + \Gamma(s, z) = \Gamma(s) continues to hold when principal values are taken, with paths avoiding the non-positive real axis and the (except for the endpoint in \Gamma(s, z)). This ensures the additivity persists in the of the functions.

Recurrence relations

The incomplete gamma functions satisfy linear that mirror the of the complete , \Gamma(a+1) = a \Gamma(a). These relations are obtained by integrating the defining integrals by parts and hold for \Re(a) > 0 and complex z away from the branch cut. They facilitate numerical evaluation, series expansions, and connections to other special functions. For the lower incomplete gamma function, the first-order forward recurrence is \gamma(a+1, z) = a \gamma(a, z) - z^a e^{-z}. This allows computation of \gamma(a+1, z) from \gamma(a, z), with the exponential term providing the boundary contribution from the upper limit in the definition. A similar relation holds in the backward direction, though numerical stability favors forward for increasing a when |z| is not too large. The upper incomplete gamma function obeys the complementary first-order recurrence \Gamma(a+1, z) = a \Gamma(a, z) + z^a e^{-z}, where the positive sign reflects the integration by parts starting from the lower limit at z. Backward recursion is often preferred for the upper function to avoid overflow in asymptotic regimes. Both the lower and upper incomplete gamma functions satisfy the same second-order linear homogeneous recurrence w(a+2, z) - (a + 1 + z) w(a+1, z) + a z w(a, z) = 0, with w(a, z) denoting either \gamma(a, z) or \Gamma(a, z). This relation, analogous to the three-term recurrence for confluent hypergeometric functions, enables stepping in the parameter a by two units and is useful for deriving continued fractions or solving differential equations satisfied by these functions. Higher-order recurrences extend these to steps n = 0, 1, 2, \dots. For the lower incomplete gamma, \gamma(a + n, z) = (a)_n \gamma(a, z) - z^a e^{-z} \sum_{k=0}^{n-1} \frac{\Gamma(a + n)}{\Gamma(a + k + 1)} z^k, where (a)_n = \Gamma(a + n)/\Gamma(a) is the Pochhammer symbol. The corresponding formula for the upper incomplete gamma replaces the subtracted sum with an added one: \Gamma(a + n, z) = (a)_n \Gamma(a, z) + z^a e^{-z} \sum_{k=0}^{n-1} \frac{\Gamma(a + n)}{\Gamma(a + k + 1)} z^k. These generalized relations are particularly valuable for generating sequences of values in asymptotic expansions or when combining with the for the .

Analytic Continuation

Extension to complex arguments

The incomplete gamma functions admit to complex arguments a and z, extending their definitions beyond the positive real axis. The lower incomplete gamma function is defined as \gamma(a,z) = \int_0^z t^{a-1} e^{-t} \, dt, where the integration path is any curve from 0 to z that lies in the except for the origin and the non-positive real axis, ensuring the principal value. Similarly, the upper incomplete gamma function is \Gamma(a,z) = \int_z^\infty t^{a-1} e^{-t} \, dt, with the path from z to \infty avoiding the non-positive real axis. These representations hold without restrictions on the paths as long as the integrand remains analytic along them, allowing continuation to the entire minus branch cuts. For the principal branch, the argument of z is taken in (-\pi, \pi), and t^{a-1} = \exp((a-1)\log t) uses logarithm with branch cut along the negative real axis. This makes \gamma(a,z) multi-valued when a is not an , with the relation \gamma(a, z e^{2\pi i m}) = e^{2\pi i m a} \gamma(a,z) for integer m, reflecting the encircling of the branch point at t=0. The upper incomplete gamma satisfies \Gamma(a, z e^{2\pi i m}) = \Gamma(a,z) + (1 - e^{2\pi i m a}) \gamma(a,z), ensuring consistency with the complete gamma function \Gamma(a) = \gamma(a,z) + \Gamma(a,z). The normalized lower incomplete gamma, \gamma^*(a,z) = \gamma(a,z)/\Gamma(a), is entire in both a and z, providing a single-valued analytic continuation. Analytically, for fixed a with \Re a > 0, \gamma(a,z) is analytic in z except for the branch cut along the non-positive real axis, while \Gamma(a,z) is entire in z. Extension to \Re a \leq 0 introduces poles in \gamma(a,z) at a = -n for nonnegative integers n, with residues (-1)^n / n!. Numerical representations for complex arguments often employ , asymptotic expansions, or connections to the , facilitating computation across the .

Branch structure and multi-valuedness

The incomplete gamma functions, both lower \gamma(a, z) and upper \Gamma(a, z), admit analytic continuation to complex arguments z \in \mathbb{C} for fixed a \notin \{0, -1, -2, \dots\}, but exhibit multi-valued behavior due to the inherent logarithm in the integrand t^{a-1} = \exp((a-1) \log t). This arises primarily from the endpoint at t = 0 in the defining integrals, leading to branch points at z = 0 and z = \infty. The functions are meromorphic in a but multi-valued in z unless a is a non-negative integer, in which case they reduce to single-valued elementary functions. The principal branch is conventionally defined such that the functions are analytic in the complex z-plane excluding the branch cut along the non-positive real axis (-\infty, 0]. On this branch, the argument of z satisfies -\pi < \arg z < \pi, and the values along the cut from above (\arg z = \pi^-) and below (\arg z = -\pi^+) differ, reflecting the discontinuity. For the upper incomplete gamma, \Gamma(a, z) is continuous from above along the cut, ensuring consistency with the real positive axis values where the integral representation holds without ambiguity. This choice aligns with standard numerical implementations and facilitates computation via series or asymptotic expansions in the cut plane. Multi-valuedness manifests through monodromy when encircling the branch point at z = 0 counterclockwise along a closed path not enclosing \infty. For the lower incomplete gamma, the value transforms as \gamma(a, z e^{2\pi i}) = e^{2\pi i a} \gamma(a, z), indicating a multiplicative factor from the z^a contribution in its series representation \gamma(a, z) = z^a e^{-z} \sum_{n=0}^\infty \frac{z^n}{(a)_{n+1} n!}. For the upper incomplete gamma, the relation is \Gamma(a, z e^{2\pi i}) = e^{2\pi i a} \Gamma(a, z) + (1 - e^{2\pi i a}) \Gamma(a), where the additional term accounts for the contribution from the complete gamma function \Gamma(a) when the integration path from z to \infty encircles the origin. These relations hold for a \notin \{0, -1, -2, \dots\} and demonstrate that the functions on different Riemann sheets differ by integer multiples of $2\pi i in the logarithmic phase. The branch structure at \infty follows from the asymptotic behavior, where large |z| expansions involve the complementary error function or Stirling-like series, but the multi-valuedness is fully captured by the finite branch point at z = 0. In practice, the principal sheet provides the values matching the real-axis integrals for z > 0, with extensions to other sheets obtained via the formulas. This framework ensures rigorous handling in applications involving contours, such as in or statistical distributions.

Special Values and Identities

Particular evaluations

The incomplete gamma function yields closed-form expressions in several , particularly when the parameter a is a positive , a , or zero, often connecting to other elementary or such as the , complementary error function, and . These evaluations are derived from the integral definitions via , series expansions, or known identities for related functions. For a = 1, the functions simplify to elementary forms: \gamma(1, z) = 1 - e^{-z}, \Gamma(1, z) = e^{-z}, valid for \Re z > 0. These follow directly from the integral representation \gamma(1, z) = \int_0^z e^{-t} \, dt. When a = n is a positive (n = 1, 2, 3, \dots), repeated leads to finite sums involving the partial exponential series. Equivalently, shifting the index for convenience, \gamma(n+1, z) = n! \left( 1 - e^{-z} \sum_{k=0}^n \frac{z^k}{k!} \right), \Gamma(n+1, z) = n! \, e^{-z} \sum_{k=0}^n \frac{z^k}{k!}, for n = 0, 1, 2, \dots and \Re z > 0. Here, the sum \sum_{k=0}^n z^k / k! is the nth partial sum of the Taylor series for e^z. These expressions highlight the connection to the cumulative distribution function of the Poisson distribution with parameter z. For the half-integer case a = 1/2, the functions relate to the Gaussian error integrals. Specifically, \gamma\left( \frac{1}{2}, z^2 \right) = \sqrt{\pi} \, \erf(z), \Gamma\left( \frac{1}{2}, z^2 \right) = \sqrt{\pi} \, \erfc(z), where \erf(z) = (2 / \sqrt{\pi}) \int_0^z e^{-t^2} \, dt and \erfc(z) = 1 - \erf(z), for z \in \mathbb{C} with the principal branch. Higher half-integers a = n + 1/2 (n = 1, 2, \dots) can be obtained recursively using the relation \gamma(a+1, z) = a \gamma(a, z) - z^a e^{-z}, yielding expressions as finite sums of terms involving \erfc(z) and powers of z. The upper incomplete gamma for a = 0 connects to the function: \Gamma(0, z) = E_1(z) = \int_z^\infty \frac{e^{-t}}{t} \, dt, defined as the for \arg z \in (-\pi, \pi). This case is singular at a = 0, as \Gamma(0) diverges, but the integral converges for \Re z > 0. For non-positive integers a = -n (n = 0, 1, 2, \dots), the upper incomplete gamma admits an expression involving the and a finite alternating sum: \Gamma(-n, z) = \frac{(-1)^n}{n!} \left( E_1(z) - e^{-z} \sum_{k=0}^{n-1} \frac{(-1)^k k!}{z^{k+1}} \right), valid for \Re z > 0. The normalized lower incomplete gamma \gamma^*(-n, z) = \gamma(-n, z) / \Gamma(-n) (taken in the limiting sense, as \Gamma(-n) has poles) simplifies to \gamma^*(-n, z) = z^n. These forms arise from and handle the poles at non-positive integers.

Multiplication theorem

The multiplication theorem for the incomplete gamma function, first presented by Tricomi in 1950, provides a that relates the lower incomplete gamma function evaluated at a scaled argument to its value at the original argument and a involving higher-order terms. This is particularly useful for deriving expansions and understanding the of the function. For the lower incomplete gamma function \gamma(a, z) = \int_0^z t^{a-1} e^{-t} \, dt, where a \neq 0, -1, -2, \dots is a fixed , the states: \gamma(a, \lambda z) = \lambda^a \gamma(a, z) + \sum_{n=1}^\infty \frac{(\lambda - 1)^n}{n!} \gamma(a + n, z), with the series converging for arbitrary \lambda and the left-hand side analytic in \lambda z \in \mathbb{C} \setminus \mathbb{R}^-. Tricomi derived this by manipulating representations, interpreting it as a multiplication formula analogous to those for other . A companion result, not explicitly stated by Tricomi but proven subsequently, holds for the upper incomplete gamma function \Gamma(a, z) = \int_z^\infty t^{a-1} e^{-t} \, dt. It is given by: \Gamma(a, \lambda z) = \Gamma(a, z) + \sum_{n=1}^\infty \frac{(1 - \lambda)^n}{n!} \Gamma(a + n, z), valid for |1 - \lambda| < 1, and can be extended analytically. This form arises from similar series manipulations and is applied in expansions of the exponential integral E_1(z) = \int_z^\infty \frac{e^{-t}}{t} \, dt, where \Gamma(a, \lambda z) connects to E_1(\lambda z).90100-5) These theorems extend the classical Gauss multiplication formula for the complete gamma function \Gamma(a) to its incomplete counterparts, facilitating numerical evaluations and asymptotic analyses in regions where direct integration is challenging.

Asymptotic Behavior

Expansions for large arguments

For large positive arguments x with fixed parameter s > 0, the upper incomplete gamma function \Gamma(s, x) admits an that captures its rapid decay. This expansion is derived from and takes the form of a , useful for approximation when x is sufficiently large compared to s. The leading behavior is \Gamma(s, x) \sim x^{s-1} e^{-x} as x \to \infty, with higher-order terms given by \Gamma(s, x) = x^{s-1} e^{-x} \sum_{k=0}^{n-1} \frac{(1-s)_k}{(-x)^k} + R_n(s, x), where (1-s)_k is the falling factorial, and the remainder satisfies R_n(s, x) = O(x^{s-n} e^{-x}) as x \to \infty in the sector |\arg x| \leq 3\pi/2 - \delta for any fixed \delta > 0 and fixed n. This series is asymptotic, meaning the error decreases initially as more terms are added but eventually diverges for fixed x, optimal truncation occurring around n \approx |x|. The first few terms illustrate the structure: for k=0, the term is 1; for k=1, (s-1)/x; for k=2, (s-1)(s-2)/x^2, and so on, reflecting successive integrations by parts of the defining \Gamma(s, x) = \int_x^\infty t^{s-1} e^{-t} \, dt. This is particularly effective for x \gg s, where \Gamma(s, x) becomes negligible compared to the complete \Gamma(s), implying \gamma(s, x) \sim \Gamma(s) with relative error O(x^{s-1} e^{-x}/\Gamma(s)). For complex arguments, the expansion holds in the specified sector, avoiding the branch cut along the negative real axis, and provides uniform control over the remainder via Darboux methods or Watson's lemma. In applications such as tail probabilities for the , this asymptotic quantifies rare events for large thresholds. When both s and x are large with x/s fixed and away from 1, yields complementary expansions. For x > s (i.e., \lambda = x/s > 1), \Gamma(s, x)/\Gamma(s) \sim \frac{1}{2} \operatorname{erfc}(\eta \sqrt{s/2}) + S(s, \eta), where \eta = [2(\lambda - 1 - \ln \lambda)]^{1/2} and S(s, \eta) \sim e^{-(s/2) \eta^2} / \sqrt{2\pi s} \sum_{k=0}^\infty c_k(\eta) s^{-k}, with coefficients c_k satisfying a recurrence. This uniform expansion bridges the fixed-s large-x regime and the transition region near x \approx s. For \lambda < 1, a similar form applies to the lower incomplete gamma. These are essential for high-parameter regimes in statistics and physics.

Expansions for small arguments

For small values of the argument z, the lower incomplete gamma function \gamma(a,z) can be expanded in a power series that converges for all finite z when \Re(a)>0: \gamma(a,z)=\sum_{n=0}^{\infty}\frac{(-1)^{n}z^{a+n}}{n!(a+n)}. This expansion arises from the integral definition \gamma(a,z)=\int_{0}^{z}t^{a-1}e^{-t}\,dt by term-by-term integration of the for e^{-t}, yielding coefficients involving the reciprocal of the rising factorial in the denominator. Equivalently, the normalized lower incomplete gamma \gamma^*(a,z)=\gamma(a,z)/\Gamma(a) has the form \gamma^*(a,z)=z^{a}e^{-z}\sum_{n=0}^{\infty}\frac{z^{n}}{\Gamma(a+n+1)}, which highlights its connection to the series representation of the of the first kind, though the direct is often used for computational purposes when |z| is small. The upper incomplete gamma function \Gamma(a,z) for small |z| is obtained by subtraction from the complete : \Gamma(a,z)=\Gamma(a)-\gamma(a,z)=\Gamma(a)-\sum_{n=0}^{\infty}\frac{(-1)^{n}z^{a+n}}{n!(a+n)}, valid under the same conditions on a (with a \neq 0,-1,-2,\dots). As z \to 0, \Gamma(a,z) \sim \Gamma(a), with the series providing the leading corrections of order z^{a}. For practical evaluation, truncating the series after a few terms suffices when |z| \ll 1, as higher powers diminish rapidly; for example, with a=1 and z=0.1, the first term approximates \gamma(1,0.1) \approx 0.0952 with error less than $10^{-4}. These expansions are particularly useful for asymptotic analysis near the origin and in numerical libraries, where they complement continued fraction representations for larger arguments.

Evaluation Methods

Series and continued fraction representations

The incomplete gamma function admits power series expansions that are particularly useful for small values of the argument z. For the lower incomplete gamma function, defined as \gamma(a,z) = \int_0^z t^{a-1} e^{-t} \, dt with \Re a > 0, the series representation is \gamma(a,z) = \Gamma(a) z^a e^{-z} \sum_{k=0}^\infty \frac{z^k}{\Gamma(a+k+1)}, which converges for all finite z and a \neq 0, -1, -2, \dots. This form arises from term-by-term integration of the exponential series within the integral definition. Equivalently, the regularized lower incomplete gamma \gamma^*(a,z) = \gamma(a,z)/\Gamma(a) expands as \gamma^*(a,z) = \sum_{k=0}^\infty \frac{(-1)^k z^{a+k}}{k! \, (a+k) \Gamma(a)}, valid under the same conditions and useful for numerical evaluation when |z| is not too large. The upper incomplete gamma function \Gamma(a,z) = \int_z^\infty t^{a-1} e^{-t} \, dt = \Gamma(a) - \gamma(a,z) has a complementary series derived from the above: \Gamma(a,z) = \Gamma(a) - \gamma(a,z) = \Gamma(a) \left(1 - z^a e^{-z} \sum_{k=0}^\infty \frac{z^k}{\Gamma(a+k+1)}\right), converging for a \neq 0, -1, -2, \dots and all finite z. Alternative expansions exist, such as one in terms of modified Bessel functions for \gamma(a,x): \gamma(a,x) = \Gamma(a) x^{a/2} e^{-x} \sum_{n=0}^\infty (-1)^n e_n x^{n/2} I_{n+a}(2\sqrt{x}), where I_\nu is the modified Bessel function of the first kind and e_n are coefficients from the exponential series, applicable for a \neq 0, -1, -2, \dots. These series are efficient for computation when |z| < 1 or moderately small, but may require acceleration techniques for larger z. Continued fraction representations provide an alternative for evaluating the incomplete gamma functions, especially for larger |z|, offering rapid convergence in certain regions. For the regularized lower incomplete gamma, a continued fraction form is \Gamma(a+1) e^z \gamma^*(a,z) = \cfrac{1}{1 - \cfrac{z}{a+1 + \cfrac{z}{a+2 - \cfrac{(a+1)z}{a+3 + \cfrac{2z}{a+4 - \cfrac{(a+2)z}{a+5 + \cfrac{3z}{a+6 - \cdots}}}}}}, with partial numerators n z (for n \geq 1) alternating in sign with denominators involving a + n \pm adjustments, converging for a \neq -1, -2, \dots and suitable for the forward or modified Lentz's method in numerical algorithms. This representation stems from Gauss's continued fraction for the ratio of hypergeometric functions, linked to the incomplete gamma via confluent hypergeometric representations. For the upper incomplete gamma, the continued fraction is z^{-a} e^z \Gamma(a,z) = \cfrac{1/z}{1 + \cfrac{(1-a)/z}{1 + \cfrac{1/z}{1 + \cfrac{(2-a)/z}{1 + \cfrac{2/z}{1 + \cfrac{(3-a)/z}{1 + \cfrac{3/z}{1 + \cdots}}}}}}, valid for |\arg z| < \pi, with partial numerators (n - a)/z and n/z alternating, and denominators of 1. This form converges quickly for large |z| and is preferred in computational libraries for the tail probability in statistical applications, as it avoids overflow issues in the series expansions. Both continued fractions are derived from the asymptotic theory of confluent hypergeometric functions and have been analyzed for convergence properties in works on special function approximations.

Connection to confluent hypergeometric functions

The incomplete gamma functions, both lower \gamma(a,z) and upper \Gamma(a,z), admit representations in terms of , which provide alternative avenues for analysis and computation, particularly through series expansions and asymptotic behaviors. The , denoted M(a,b,z) or , satisfies the differential equation z w'' + (b - z) w' - a w = 0, and serves as a fundamental solution that generalizes many special functions. For the lower incomplete gamma function, the relation is given by \gamma(a,z) = a^{-1} z^a e^{-z} M(1, 1+a, z) = a^{-1} z^a M(a, 1+a, -z), valid for a \neq 0, -1, -2, \dots. This expression leverages the series representation of M(a,b,z) = \sum_{n=0}^\infty \frac{(a)_n}{(b)_n} \frac{z^n}{n!}, where (\cdot)_n denotes the , allowing the incomplete gamma to be computed via a hypergeometric series truncated appropriately for small |z|. The regularized lower incomplete gamma, \gamma^*(a,z) = \gamma(a,z)/\Gamma(a), simplifies to \gamma^*(a,z) = e^{-z} \mathbf{M}(1,1+a,z) = \mathbf{M}(a,1+a,-z), where \mathbf{M}(a,b,z) = M(a,b,z)/\Gamma(b) is the regularized confluent hypergeometric function. The upper incomplete gamma function \Gamma(a,z) connects to the second solution of the confluent hypergeometric equation, the Tricomi function U(a,b,z), via \Gamma(a,z) = e^{-z} U(1-a,1-a,z) = z^a e^{-z} U(1,1+a,z). This holds under the principal branch conditions for complex arguments, with U(a,b,z) behaving asymptotically as z^{-a} for large |z| in |\arg z| < 3\pi/2. Such representations facilitate the study of the incomplete gamma's analytic continuation and branch structure, as the confluent functions' multi-valuedness aligns with the incomplete gamma's behavior across the negative real axis. Further connections arise through Whittaker functions, which are scaled variants of confluent hypergeometric functions: M_{\kappa,\mu}(z) = e^{-z/2} z^{\mu + 1/2} M(\mu - \kappa + 1/2, 1 + 2\mu, z) and W_{\kappa,\mu}(z) = e^{-z/2} z^{\mu + 1/2} U(\mu - \kappa + 1/2, 1 + 2\mu, z). Thus, \gamma(a,z) = a^{-1} z^{a/2 - 1/2} e^{-z/2} M_{a/2 - 1/2, a/2}(z), and \Gamma(a,z) = e^{-z/2} z^{a/2 - 1/2} W_{a/2 - 1/2, a/2}(z), offering utility in problems involving quantum mechanics and diffusion processes where Whittaker functions naturally emerge. These identities, rooted in the confluent limit of Gauss's hypergeometric function, underscore the incomplete gamma's role as a special case within the broader hypergeometric hierarchy.

Numerical computation and software

The numerical computation of the incomplete gamma functions \gamma(s, x) and \Gamma(s, x) relies on a combination of series expansions, continued fractions, and asymptotic approximations, selected based on the values of the parameters s and x to ensure accuracy and efficiency. For small x relative to s, the lower incomplete gamma function \gamma(s, x) is effectively evaluated using its power series representation \gamma(s, x) = \Gamma(s) x^s e^{-x} \sum_{n=0}^\infty \frac{x^n}{\Gamma(s+n+1)}, which converges rapidly when |x/s| < 1. This series is particularly suitable for the regime where direct integration or Taylor expansion is feasible, avoiding overflow issues by normalizing terms incrementally. Conversely, for larger x, the upper incomplete gamma function \Gamma(s, x) benefits from continued fraction expansions, such as the Lentz-Thompson-Barnett algorithm applied to the representation \Gamma(s, x) = e^{-x} x^s / (1 + x/(s+1) + \cdots), which provides stable convergence for |x/s| > 1 and is less prone to cancellation errors than series methods. Asymptotic expansions are crucial for large arguments, where the series or saddle-point approximations yield high accuracy with few terms. For instance, when x is large, \Gamma(s, x) \sim x^{s-1} e^{-x} \sum_{n=0}^\infty (-1)^n \frac{(1-s)_n}{x^n}, valid for |\arg x| < \pi/2, allowing computation with relative errors below machine precision for x > 10. Uniform asymptotics, such as those involving the parameter \lambda = x/s, extend this to large s with fixed \lambda, using expansions like \Gamma(s, s\lambda) / (s^{s-1} e^{-s} \sqrt{2\pi s}) \sim e^{s \eta(\lambda)} / \sqrt{2\pi s \lambda (1-\lambda)} where \eta(\lambda) = \lambda - 1 - \lambda \ln \lambda, derived from for integrals. These methods are often combined in hybrid algorithms: series for small x/s, continued fractions for intermediate, and asymptotics for large, with careful handling of the transition regions to minimize round-off errors, as detailed in Temme's comprehensive analysis. In software libraries, the incomplete gamma functions are implemented with these techniques to support double-precision . The GNU Scientific Library (GSL) provides functions like gsl_sf_gamma_inc_P(a, x) for the regularized lower form P(s, x) = \gamma(s, x)/\Gamma(s), using a of series for x < s + 1 and continued fractions otherwise, achieving full machine accuracy across the real plane for s > 0, x \geq 0. SciPy's scipy.special.gammainc(a, x) computes the regularized lower incomplete gamma, employing Temme's algorithm for the unnormalized case and Lentz's method for the upper, with benchmarks showing relative errors under $10^{-15} for typical inputs. MATLAB's gammainc(x, a) and igamma(a, z) support both regularized and unnormalized variants, utilizing series expansions for small arguments and asymptotic series for large, including symbolic computation for exact results when inputs are integers. The Boost.Math library offers gamma_p(a, z) for the regularized lower form, implemented in C++ with policy-based error handling, drawing on the same core methods and validated against Cody's test suite for 53-bit precision compliance. These implementations prioritize portability and performance, often accelerating computations for integer s via recurrence relations.

Regularized Forms and Applications

Regularized incomplete gamma functions

The regularized incomplete gamma functions are normalized versions of the lower and upper incomplete gamma functions, obtained by dividing by the complete \Gamma(s). The lower regularized incomplete gamma function is defined as P(s, x) = \frac{\gamma(s, x)}{\Gamma(s)} = \frac{1}{\Gamma(s)} \int_0^x t^{s-1} e^{-t} \, dt, where \Re(s) > 0 and x \geq 0. Similarly, the upper regularized incomplete gamma function is Q(s, x) = \frac{\Gamma(s, x)}{\Gamma(s)} = \frac{1}{\Gamma(s)} \int_x^\infty t^{s-1} e^{-t} \, dt, with the same domain restrictions. These functions satisfy the fundamental identity P(s, x) + Q(s, x) = 1 for all s and x in their domain. Both P(s, x) and Q(s, x) are analytic in s for \Re(s) > 0 and can be continued to other regions of the , excluding branch points associated with \Gamma(s). An alternative representation for the scaled lower form is \gamma^*(s, x) = x^{-s} P(s, x) = \frac{1}{\Gamma(s)} \int_0^1 t^{s-1} e^{-x t} \, dt, which facilitates certain computational and asymptotic analyses. Recurrence relations provide efficient ways to relate values at different orders. For integer increments, P(s+1, x) = P(s, x) - \frac{x^s e^{-x}}{\Gamma(s+1)}, and Q(s+1, x) = Q(s, x) + \frac{x^s e^{-x}}{\Gamma(s+1)}. More generally, for nonnegative integers n, P(s+n, x) = P(s, x) - \frac{x^s e^{-x}}{\Gamma(s)} \sum_{k=0}^{n-1} \frac{x^k}{\Gamma(s+k+1)}, with a corresponding addition for Q(s+n, x). These relations stem from and mirror those of the unregularized forms, adjusted by the normalization factor. The with respect to the upper limit x are straightforward due to the applied to the definitions. Specifically, \frac{d}{dx} P(s, x) = \frac{x^{s-1} e^{-x}}{\Gamma(s)}, and \frac{d}{dx} Q(s, x) = -\frac{x^{s-1} e^{-x}}{\Gamma(s)}. Higher-order follow by repeated ; for the second derivative, \frac{d^2}{dx^2} P(s, x) = \frac{e^{-x} (s - x - 1) x^{s-2}}{\Gamma(s)}, with an analogous form for Q(s, x). These regularized forms are particularly useful in numerical computations because their values lie between 0 and 1, aiding in error control and convergence assessments for series expansions and continued fractions.

Role in probability and statistics

The incomplete gamma function plays a central role in probability and statistics, particularly as a component of the cumulative distribution functions (CDFs) for several important continuous and discrete distributions. For a random variable X following a gamma distribution with shape parameter \alpha > 0 and rate parameter \beta > 0, the CDF is given by F(x; \alpha, \beta) = P(X \leq x) = \frac{\gamma(\alpha, \beta x)}{\Gamma(\alpha)}, \quad x \geq 0, where \gamma(\alpha, z) is the lower incomplete gamma function and \Gamma(\alpha) is the complete gamma function. This regularized form, often denoted P(\alpha, \beta x), directly quantifies the probability that the random variable does not exceed a given threshold, making it essential for modeling waiting times, lifetimes, and other positive-valued phenomena in fields like reliability engineering and queueing theory. The , a special case of the with \nu/2 and rate $1/2 (where \nu > 0 is the ), has its CDF expressed similarly using the incomplete gamma function: F(x; \nu) = P(X \leq x) = \frac{\gamma(\nu/2, x/2)}{\Gamma(\nu/2)}, \quad x \geq 0. This connection is fundamental in hypothesis testing, where the chi-squared statistic under the follows this distribution, and the incomplete gamma enables computation of p-values for goodness-of-fit tests, tests, and variance comparisons. For integer degrees of freedom, the function simplifies further, linking to the properties of the with integer parameters. Additionally, the incomplete gamma function relates to the through its CDF or . For a random variable Y with mean \lambda > 0, the survival probability P(Y \geq k) for integer k \geq 0 can be written as P(Y \geq k) = P(k, \lambda) = \frac{\gamma(k, \lambda)}{\Gamma(k)}, where \gamma(k, \lambda) is the lower incomplete gamma function and P is the regularized lower incomplete gamma; this equivalence arises from the integral representation of the Poisson probabilities. This relationship is particularly useful in applied probability, such as analyzing rare events in Poisson processes, and extends to where gamma distributions serve as conjugate priors for Poisson rates.

Derivatives and Integrals

Differentiation formulas

The differentiation of the incomplete gamma functions can be performed with respect to either the argument z or the parameter a. These formulas are derived from the integral definitions and satisfy certain recurrence relations.

Derivatives with Respect to z

The first derivative of the lower incomplete gamma function with respect to z follows directly from the applied to its definition \gamma(a,z) = \int_0^z t^{a-1} e^{-t} \, dt, yielding \frac{\mathrm{d}}{\mathrm{d}z} \gamma(a,z) = z^{a-1} e^{-z}, for \Re(a) > 0 and z in the with a branch cut along the negative real axis. Correspondingly, for the upper incomplete gamma function \Gamma(a,z) = \int_z^\infty t^{a-1} e^{-t} \, dt, \frac{\mathrm{d}}{\mathrm{d}z} \Gamma(a,z) = -z^{a-1} e^{-z}, with the same conditions on a and z. This relation also implies \frac{\mathrm{d}}{\mathrm{d}z} \gamma(a,z) = -\frac{\mathrm{d}}{\mathrm{d}z} \Gamma(a,z). Higher-order derivatives with respect to z can be expressed using scaled versions of the incomplete gamma functions. For nonnegative integers n, \frac{\mathrm{d}^n}{\mathrm{d}z^n} (z^{-a} \gamma(a,z)) = (-1)^n z^{-a-n} \gamma(a+n,z), and \frac{\mathrm{d}^n}{\mathrm{d}z^n} (z^{-a} \Gamma(a,z)) = (-1)^n z^{-a-n} \Gamma(a+n,z). These hold for \Re(a) > -n to ensure convergence. Alternative forms involve exponential scaling and falling factorials (Pochhammer symbols for negative steps): \frac{\mathrm{d}^n}{\mathrm{d}z^n} (e^z \gamma(a,z)) = (-1)^n (1-a)_n e^z \gamma(a-n,z), and \frac{\mathrm{d}^n}{\mathrm{d}z^n} (e^z \Gamma(a,z)) = (-1)^n (1-a)_n e^z \Gamma(a-n,z), valid for \Re(a) > n. Here, (1-a)_n = (1-a)(1-a+1)\cdots(1-a+n-1) is the rising Pochhammer symbol. These recurrences facilitate and series expansions.

Derivatives with Respect to a

The partial derivative with respect to the parameter a is obtained by differentiating under the integral sign, assuming suitable conditions for interchanging the derivative and integral (e.g., \Re(a) > 0). For the lower incomplete gamma function, \frac{\partial}{\partial a} \gamma(a,z) = \int_0^z t^{a-1} e^{-t} \ln t \, dt, and for the upper, \frac{\partial}{\partial a} \Gamma(a,z) = \int_z^\infty t^{a-1} e^{-t} \ln t \, dt. These expressions introduce the logarithmic factor \ln t, which complicates closed-form evaluation but connects to the digamma function in limits or special cases. Higher-order partial derivatives follow similarly: \frac{\partial^n}{\partial a^n} \Gamma(a,z) = \int_z^\infty t^{a-1} e^{-t} (\ln t)^n \, dt, for nonnegative integers n, with analogous forms for \gamma(a,z). Recurrence relations for these derivatives, particularly when a = -m for nonnegative m, involve harmonic numbers and further incomplete gamma terms, as derived in specialized analyses. For instance, explicit series expansions express \frac{\partial^n}{\partial a^n} \Gamma(a,z) in terms of the complete derivatives and powers of \ln z.

Integral representations

The incomplete gamma functions are fundamentally defined by improper integrals. The lower incomplete gamma function is given by \gamma(s,x) = \int_0^x t^{s-1} e^{-t} \, dt, valid for \Re s > 0 and x > 0. Similarly, the upper incomplete gamma function is \Gamma(s,x) = \int_x^\infty t^{s-1} e^{-t} \, dt, with the same conditions, and satisfies \gamma(s,x) + \Gamma(s,x) = \Gamma(s), where \Gamma(s) is the complete . These representations arise from truncating the for \Gamma(s). Alternative integral representations facilitate , numerical evaluation, and connections to other . For the lower incomplete gamma function with non-integer s, one form is \gamma(s,x) = \frac{x^s}{\sin(\pi s)} \int_0^\pi e^{x \cos \theta} \cos(s\theta + x \sin \theta) \, d\theta, which extends the domain beyond positive real x. A Laplace-type transform form is \gamma(s,x) = x^s \int_0^\infty e^{-st - x e^{-t}} \, dt, also for \Re s > 0, which is particularly effective for large x due to the rapid decay of the integrand. For the upper incomplete gamma function, a representation valid for \Re x > 0 is \Gamma(s,x) = x^s e^{-x} \int_0^\infty \frac{e^{-xt}}{(1+t)^{1-s}} \, dt, useful in deriving series expansions. When \Re s < 1 and |\arg x| < \pi, it can be expressed as \Gamma(s,x) = \frac{x^s e^{-x}}{\Gamma(1-s)} \int_0^\infty \frac{t^{-s} e^{-t}}{x + t} \, dt, relating it to the and enabling connections to . An exponential form analogous to the lower case is \Gamma(s,x) = x^s \int_0^\infty \exp(st - x e^t) \, dt, for \Re x > 0, which supports uniform asymptotic expansions. Contour integral representations provide tools for analytic continuation to the complex plane. For \gamma(s,x) with |\arg x| < \pi/2 and s \neq 0, -1, -2, \dots, \gamma(s,x) = \frac{1}{2\pi i} \int_{c - i\infty}^{c + i\infty} \frac{\Gamma(\sigma)}{s - \sigma} x^{s - \sigma} \, d\sigma, where the contour is a vertical line with c chosen to separate poles. For \Gamma(s,x) with |\arg x| < \pi/2, \Gamma(s,x) = \frac{1}{2\pi i} \int_{c - i\infty}^{c + i\infty} \Gamma(\sigma + s) \frac{x^{-\sigma}}{\sigma} \, d\sigma, with the contour to the right of all poles of \Gamma(\sigma + s). These Mellin-Barnes type integrals are essential for meromorphic continuation and evaluating at non-positive integers.