{
  "id": "incomplete-gamma-function",
  "title": "Incomplete Gamma Function",
  "lang": "en",
  "source_lang": "en",
  "summary": "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.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "Incomplete gamma functions",
    "upper incomplete gamma function",
    "lower incomplete gamma function"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/incomplete-gamma-function/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/incomplete-gamma-function/",
      "json": "https://aiwiki.page/zh/incomplete-gamma-function.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "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, \\(\\gamma(a,x)\\), integrates from \\(0\\) to \\(x\\), while the upper incomplete gamma function, \\(\\Gamma(a,x)\\), integrates from \\(x\\) 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."
    },
    {
      "heading": "Definitions and notation",
      "text": "For a complex parameter \\(a\\) with \\(\\operatorname{Re}(a)>0\\) and a real argument \\(x\\geq 0\\), the lower incomplete gamma function is\n\n\\[\\gamma(a,x)=\\int_0^x t^{a-1}e^{-t}\\,dt.\\]\n\nFor \\(x>0\\), the upper incomplete gamma function is\n\n\\[\\Gamma(a,x)=\\int_x^\\infty t^{a-1}e^{-t}\\,dt.\\]\n\nThe upper integral converges for every complex \\(a\\) when \\(x>0\\); the lower integral requires \\(\\operatorname{Re}(a)>0\\) because its integration interval includes the origin. The power \\(t^{a-1}\\) is unambiguous on the positive real axis, where it means \\(\\exp((a-1)\\log t)\\).\n\nSplitting the defining integral of the complete gamma function gives\n\n\\[\\gamma(a,x)+\\Gamma(a,x)=\\Gamma(a), \\qquad \\operatorname{Re}(a)>0.\\]\n\nThus “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.\n\nFor real \\(a>0\\),\n\n\\[\\gamma(a,0)=0,\\qquad \\Gamma(a,0)=\\Gamma(a),\\]\n\nand\n\n\\[\\lim_{x\\to\\infty}\\gamma(a,x)=\\Gamma(a), \\qquad \\lim_{x\\to\\infty}\\Gamma(a,x)=0.\\]"
    },
    {
      "heading": "Regularized functions",
      "text": "The regularized incomplete gamma functions are\n\n\\[P(a,x)=\\frac{\\gamma(a,x)}{\\Gamma(a)}, \\qquad Q(a,x)=\\frac{\\Gamma(a,x)}{\\Gamma(a)}.\\]\n\nFor \\(a>0\\) and \\(x\\geq0\\), they satisfy\n\n\\[P(a,x)+Q(a,x)=1, \\qquad 0\\leq P(a,x),Q(a,x)\\leq1.\\]\n\nAs functions of \\(x\\), \\(P(a,x)\\) increases from \\(0\\) to \\(1\\), while \\(Q(a,x)\\) decreases from \\(1\\) to \\(0\\). Their normalization makes them particularly useful in probability: \\(P\\) represents an accumulated lower-tail probability, and \\(Q\\) represents the complementary upper-tail probability.\n\nSoftware conventions vary. A routine named “incomplete gamma” may return \\(\\gamma\\), \\(\\Gamma\\), \\(P\\), or \\(Q\\), and some interfaces reverse the argument order. These conventions must be distinguished when comparing formulas or numerical results."
    },
    {
      "heading": "Differentiation and recurrence relations",
      "text": "By the fundamental theorem of calculus, differentiation with respect to the second argument gives\n\n\\[\\frac{\\partial}{\\partial x}\\gamma(a,x)=x^{a-1}e^{-x},\\]\n\n\\[\\frac{\\partial}{\\partial x}\\Gamma(a,x)=-x^{a-1}e^{-x}.\\]\n\nConsequently,\n\n\\[\\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)}.\\]\n\nIntegration by parts yields the recurrence relations\n\n\\[\\gamma(a+1,x)=a\\gamma(a,x)-x^ae^{-x},\\]\n\n\\[\\Gamma(a+1,x)=a\\Gamma(a,x)+x^ae^{-x}.\\]\n\nFor positive real \\(a\\), the corresponding regularized relations are\n\n\\[P(a+1,x)=P(a,x)-\\frac{x^ae^{-x}}{\\Gamma(a+1)},\\]\n\n\\[Q(a+1,x)=Q(a,x)+\\frac{x^ae^{-x}}{\\Gamma(a+1)}.\\]\n\nThese 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.\n\nDifferentiation with respect to the parameter introduces logarithmic factors. For example, when \\(\\operatorname{Re}(a)>0\\) and \\(x>0\\),\n\n\\[\\frac{\\partial}{\\partial a}\\gamma(a,x) = \\int_0^x t^{a-1}e^{-t}\\log t\\,dt.\\]"
    },
    {
      "heading": "Special values and related functions",
      "text": "Integer parameters\n\nAt \\(a=1\\),\n\n\\[\\gamma(1,x)=1-e^{-x}, \\qquad \\Gamma(1,x)=e^{-x}.\\]\n\nFor a positive integer \\(n\\), repeated application of the recurrence gives\n\n\\[\\Gamma(n,x) =(n-1)!\\,e^{-x} \\sum_{k=0}^{n-1}\\frac{x^k}{k!},\\]\n\nand therefore\n\n\\[\\gamma(n,x) =(n-1)! \\left( 1-e^{-x}\\sum_{k=0}^{n-1}\\frac{x^k}{k!} \\right).\\]\n\nHere \\((n-1)!\\) is a factorial. These finite sums connect incomplete gamma functions with Poisson probabilities.\n\nHalf-integer parameters\n\nThe error function is defined by\n\n\\[\\operatorname{erf}(u)=\\frac{2}{\\sqrt{\\pi}} \\int_0^u e^{-t^2}\\,dt.\\]\n\nIts complementary form is\n\\(\\operatorname{erfc}(u)=1-\\operatorname{erf}(u)\\). Substituting \\(t=u^2\\) in the incomplete gamma integrals gives\n\n\\[\\gamma\\left(\\frac12,x\\right) =\\sqrt{\\pi}\\operatorname{erf}(\\sqrt{x}),\\]\n\n\\[\\Gamma\\left(\\frac12,x\\right) =\\sqrt{\\pi}\\operatorname{erfc}(\\sqrt{x}).\\]\n\nRecurrence then expresses all positive half-integer cases using the error function and elementary terms.\n\nExponential integrals\n\nFor \\(x>0\\),\n\n\\[\\Gamma(0,x)=E_1(x) =\\int_x^\\infty\\frac{e^{-t}}{t}\\,dt,\\]\n\nwhere \\(E_1\\) is an exponential integral. More generally, defining\n\n\\[E_p(x)=\\int_1^\\infty \\frac{e^{-xt}}{t^p}\\,dt\\]\n\ngives\n\n\\[E_p(x)=x^{p-1}\\Gamma(1-p,x).\\]\n\nThese identities allow formulas involving exponential integrals to be written in incomplete gamma notation."
    },
    {
      "heading": "Series and asymptotic expansions",
      "text": "Expanding the exponential and integrating term by term gives the power series\n\n\\[\\gamma(a,x) = x^a\\sum_{n=0}^{\\infty} \\frac{(-x)^n}{n!(a+n)}, \\qquad \\operatorname{Re}(a)>0.\\]\n\nFor positive real \\(a\\) and \\(x\\), a useful nonalternating representation is\n\n\\[\\gamma(a,x) = x^ae^{-x} \\sum_{n=0}^{\\infty} \\frac{x^n}{a(a+1)\\cdots(a+n)}.\\]\n\nEquivalently,\n\n\\[P(a,x) = e^{-x}x^a \\sum_{n=0}^{\\infty}\\frac{x^n}{\\Gamma(a+n+1)}.\\]\n\nIn particular, for fixed \\(a>0\\) as \\(x\\to0^+\\),\n\n\\[\\gamma(a,x)\\sim\\frac{x^a}{a}, \\qquad P(a,x)\\sim\\frac{x^a}{\\Gamma(a+1)}.\\]\n\nFor fixed \\(a\\) and large positive \\(x\\), repeated integration by parts yields the asymptotic expansion\n\n\\[\\Gamma(a,x)\\sim x^{a-1}e^{-x} \\left[ 1+\\frac{a-1}{x} +\\frac{(a-1)(a-2)}{x^2} +\\cdots \\right].\\]\n\nThis expansion is generally asymptotic rather than convergent. For positive integer \\(a\\), it terminates and becomes the exact finite-sum formula.\n\nWhen \\(a\\) is large and \\(x\\) is near \\(a\\), fixed-parameter large-\\(x\\) 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."
    },
    {
      "heading": "Probability and statistics",
      "text": "Gamma and chi-squared distributions\n\nIf a random variable \\(X\\) follows a gamma distribution with shape \\(a>0\\) and scale \\(\\theta>0\\), its density is\n\n\\[f_X(x)= \\frac{x^{a-1}e^{-x/\\theta}}{\\Gamma(a)\\theta^a}, \\qquad x>0.\\]\n\nIts cumulative distribution function and upper-tail probability are\n\n\\[\\Pr(X\\leq x)=P\\left(a,\\frac{x}{\\theta}\\right),\\]\n\n\\[\\Pr(X>x)=Q\\left(a,\\frac{x}{\\theta}\\right).\\]\n\nFor a chi-squared distribution with \\(\\nu\\) degrees of freedom, the shape is \\(\\nu/2\\) and the scale is \\(2\\), so\n\n\\[\\Pr(X\\leq x)=P\\left(\\frac{\\nu}{2},\\frac{x}{2}\\right).\\]\n\nIncomplete gamma functions therefore enter chi-squared tail calculations and related statistical procedures.\n\nPoisson probabilities\n\nIf \\(N\\) has a Poisson distribution with mean \\(\\lambda>0\\), then for a nonnegative integer \\(k\\),\n\n\\[\\Pr(N\\leq k) = e^{-\\lambda}\\sum_{j=0}^{k}\\frac{\\lambda^j}{j!} = Q(k+1,\\lambda).\\]\n\nCorrespondingly,\n\n\\[\\Pr(N\\geq k+1)=P(k+1,\\lambda).\\]\n\nThe upper regularized gamma function thus represents the lower Poisson tail, whereas it represents an upper tail for a gamma-distributed variable.\n\nTruncated moments and inverse functions\n\nFor a gamma-distributed variable and a real exponent \\(r\\) satisfying \\(a+r>0\\),\n\n\\[\\mathbb{E}\\!\\left[X^r\\mathbf{1}_{\\{X\\leq b\\}}\\right] = \\theta^r\\frac{\\gamma(a+r,b/\\theta)}{\\Gamma(a)}.\\]\n\nReplacing the lower incomplete gamma function by the upper one gives the corresponding moment over \\(X>b\\). Such expressions are used in truncated distributions and conditional expected values.\n\nFor fixed \\(a>0\\), the strict increase of \\(P(a,x)\\) allows inversion with respect to \\(x\\). Solving\n\n\\[P(a,x)=p,\\qquad 0<p<1,\\]\n\nproduces gamma quantiles. These inverses generally require numerical computation."
    },
    {
      "heading": "Complex arguments and analytic continuation",
      "text": "Extension to a complex second argument \\(z\\) requires a choice of branch for the logarithm in \\(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.\n\nFor fixed positive \\(x\\), the upper incomplete gamma function \\(\\Gamma(a,x)\\) is an entire function of the complex parameter \\(a\\). The lower function has a meromorphic analytic continuation in \\(a\\), with simple poles at\n\n\\[a=0,-1,-2,\\ldots,\\]\n\nwhose residues are \\((-1)^n/n!\\) at \\(a=-n\\). These poles follow from\n\n\\[\\gamma(a,x)=\\Gamma(a)-\\Gamma(a,x),\\]\n\nbecause the upper function is entire in \\(a\\) while the complete gamma function has those poles.\n\nThe identity remains valid under consistent continuation, but values at singular parameters require limits rather than direct subtraction of divergent expressions."
    },
    {
      "heading": "Numerical evaluation",
      "text": "Reliable implementations combine several methods rather than relying on a single formula across the whole parameter range:\n\n- Series expansions are effective for the lower function in suitable small-\\(x\\) and moderate-parameter regions.\n- Continued fractions provide useful representations for the upper function.\n- Asymptotic expansions serve large arguments or large parameters.\n- Uniform approximations handle the transition region near \\(x=a\\) when \\(a\\) is large.\n- Recurrence relations shift parameters into regions where another method is accurate.\n\nA central issue is numerical stability. If \\(P(a,x)\\) is extremely close to \\(1\\), computing \\(Q(a,x)\\) as \\(1-P(a,x)\\) may lose most or all significant digits. Accurate routines therefore evaluate the smaller tail directly when needed.\n\nThe prefactor \\(x^ae^{-x}/\\Gamma(a)\\) can also overflow or underflow in floating-point arithmetic. Computing its logarithm,\n\n\\[a\\log x-x-\\log\\Gamma(a),\\]\n\nand 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."
    }
  ],
  "links": [
    "gamma-function",
    "integral",
    "probability",
    "fundamental-theorem-of-calculus",
    "integration-by-parts",
    "recurrence-relation",
    "factorial",
    "loss-function",
    "power-series",
    "asymptotic-expansion",
    "random-variable",
    "cumulative-distribution-function",
    "chi-squared-distribution",
    "poisson-distribution",
    "expected-value",
    "quantile",
    "analytic-continuation",
    "continued-fraction",
    "numerical-stability",
    "floating-point-arithmetic"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}