{
  "id": "gamma-function",
  "title": "Gamma Function",
  "lang": "en",
  "source_lang": "en",
  "summary": "The gamma function extends factorials to noninteger arguments and is fundamental in analysis, probability, and mathematical physics.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "Euler gamma function",
    "Euler’s integral of the second kind"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/gamma-function/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/gamma-function/",
      "json": "https://aiwiki.page/zh/gamma-function.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The gamma function, denoted by \\(\\Gamma(z)\\), is a function that extends the factorial through the identity \\(\\Gamma(n+1)=n!\\) for nonnegative integers \\(n\\). It is defined by an integral when the argument has positive real part and extended to almost all complex numbers by analytic continuation. Its integral representation, functional identities, and asymptotic behavior make it a central function in mathematical analysis and probability. (dlmf.nist.gov)"
    },
    {
      "heading": "Integral definition and the factorial relation",
      "text": "For \\(\\operatorname{Re}z>0\\), Euler’s integral defines the gamma function:\n\n\\[\\Gamma(z)=\\int_0^\\infty t^{z-1}e^{-t}\\,dt.\\]\n\nHere \\(t^{z-1}=\\exp((z-1)\\ln t)\\), with the ordinary real logarithm because \\(t>0\\). The condition on \\(z\\) ensures integrability at zero; exponential decay ensures convergence at infinity. For positive real numbers \\(x\\), the integrand is positive, so \\(\\Gamma(x)>0\\). (dlmf.nist.gov)\n\nIntegration by parts gives the recurrence relation\n\n\\[\\Gamma(z+1)=z\\Gamma(z).\\]\n\nSince \\(\\Gamma(1)=\\int_0^\\infty e^{-t}\\,dt=1\\), induction yields\n\n\\[\\Gamma(n+1)=n!, \\qquad n=0,1,2,\\ldots.\\]\n\nThe shift is important: \\(\\Gamma(n)=(n-1)!\\), not \\(n!\\), for positive integers \\(n\\). When factorial notation is extended to noninteger arguments, it conventionally means \\(z!=\\Gamma(z+1)\\). (dlmf.nist.gov)"
    },
    {
      "heading": "Analytic continuation and singularities",
      "text": "The recurrence extends the function beyond the region where Euler’s integral converges. For an integer \\(m\\geq1\\) chosen so that \\(\\operatorname{Re}(z+m)>0\\),\n\n\\[\\Gamma(z)= \\frac{\\Gamma(z+m)} {z(z+1)\\cdots(z+m-1)},\\]\n\nprovided the denominator is nonzero. This agrees with the original integral on their common domain and supplies its analytic continuation. (dlmf.nist.gov)\n\nThe resulting function is meromorphic: it is analytic except for simple poles at\n\n\\[z=0,-1,-2,\\ldots.\\]\n\nAt \\(z=-n\\), the residue is\n\n\\[\\operatorname{Res}_{z=-n}\\Gamma(z)=\\frac{(-1)^n}{n!}.\\]\n\nThe gamma function has no zeros. Its reciprocal \\(1/\\Gamma(z)\\), with the singularities removed, is analytic throughout the complex plane and has simple zeros at precisely the nonpositive integers. Thus analytic continuation does not assign finite gamma values at those poles. (dlmf.nist.gov)"
    },
    {
      "heading": "Special values and functional identities",
      "text": "The principal noninteger special value is\n\n\\[\\Gamma\\left(\\frac12\\right)=\\sqrt{\\pi}.\\]\n\nIndeed, substituting \\(t=u^2\\) into Euler’s integral gives\n\n\\[\\Gamma\\left(\\frac12\\right) =2\\int_0^\\infty e^{-u^2}\\,du =\\sqrt{\\pi},\\]\n\nusing the Gaussian integral. Repeated application of the recurrence then gives\n\n\\[\\Gamma\\left(n+\\frac12\\right) =\\frac{(2n)!}{4^n n!}\\sqrt{\\pi}, \\qquad n=0,1,2,\\ldots.\\]\n\nFor example, \\(\\Gamma(3/2)=\\sqrt{\\pi}/2\\) and \\(\\Gamma(-1/2)=-2\\sqrt{\\pi}\\). (dlmf.nist.gov)\n\nEuler’s reflection formula relates complementary arguments:\n\n\\[\\Gamma(z)\\Gamma(1-z) =\\frac{\\pi}{\\sin(\\pi z)}, \\qquad z\\notin\\mathbb Z.\\]\n\nLegendre’s duplication formula is\n\n\\[\\Gamma(z)\\Gamma\\left(z+\\frac12\\right) =2^{1-2z}\\sqrt{\\pi}\\,\\Gamma(2z).\\]\n\nMore generally, Gauss’s multiplication formula, for a positive integer \\(m\\), states\n\n\\[\\prod_{k=0}^{m-1}\\Gamma\\left(z+\\frac{k}{m}\\right) =(2\\pi)^{(m-1)/2}m^{1/2-mz}\\Gamma(mz).\\]\n\nThe multiplication identities hold wherever the displayed values are finite, and as identities of meromorphic functions. (dlmf.nist.gov)"
    },
    {
      "heading": "Why this extension of factorials is distinguished",
      "text": "Factorial interpolation and the recurrence alone do not determine a unique function. For example, multiplying \\(\\Gamma(x)\\) by a positive period-one function \\(p(x)\\) satisfying \\(p(1)=1\\) preserves both the recurrence and the positive-integer values. An additional condition is therefore necessary. (arxiv.org)\n\nThe Bohr–Mollerup theorem provides that condition. A positive function \\(f\\) on \\((0,\\infty)\\) equals \\(\\Gamma\\) if\n\n- \\(f(1)=1\\);\n- \\(f(x+1)=xf(x)\\);\n- \\(\\ln f(x)\\) is a convex function.\n\nThis logarithmic convexity distinguishes the gamma function from other factorial interpolations. (dlmf.nist.gov)\n\nLogarithmic convexity can also be seen through the second derivative:\n\n\\[\\frac{d^2}{dx^2}\\ln\\Gamma(x) =\\sum_{k=0}^\\infty\\frac{1}{(x+k)^2}>0, \\qquad x>0.\\]\n\nIt is therefore strict on the positive real axis. The gamma function has a unique positive-real minimum at approximately \\(x=1.461632\\), where its value is approximately \\(0.885603\\); it decreases before this point and increases afterward. (visiblecement.nist.gov)"
    },
    {
      "heading": "Product representations",
      "text": "An alternative to the integral definition is Euler’s limit:\n\n\\[\\Gamma(z)= \\lim_{N\\to\\infty} \\frac{N!\\,N^z}{z(z+1)\\cdots(z+N)}, \\qquad z\\notin\\{0,-1,-2,\\ldots\\}.\\]\n\nThe Weierstrass product expresses the reciprocal:\n\n\\[\\frac{1}{\\Gamma(z)} =z e^{\\gamma z} \\prod_{n=1}^{\\infty} \\left(1+\\frac{z}{n}\\right)e^{-z/n},\\]\n\nwhere \\(\\gamma\\approx0.5772156649\\) is the Euler–Mascheroni constant, not the gamma function itself. The product displays the reciprocal’s zeros at zero and the negative integers. The exponential factors compensate for the first-order terms of the individual factors, allowing the infinite product to converge. (dlmf.nist.gov)"
    },
    {
      "heading": "Asymptotic behavior",
      "text": "For large positive \\(x\\), Stirling’s approximation gives\n\n\\[\\Gamma(x)\\sim\\sqrt{2\\pi}\\,x^{x-1/2}e^{-x}.\\]\n\nHere \\(\\sim\\) means that the ratio of the two sides tends to one. A more precise asymptotic expansion is\n\n\\[\\Gamma(x)\\sim \\sqrt{2\\pi}\\,x^{x-1/2}e^{-x} \\left( 1+\\frac{1}{12x} +\\frac{1}{288x^2} -\\frac{139}{51840x^3} +\\cdots \\right).\\]\n\nEquivalently,\n\n\\[\\ln\\Gamma(x)\\sim \\left(x-\\frac12\\right)\\ln x-x+\\frac12\\ln(2\\pi) +\\frac{1}{12x}-\\frac{1}{360x^3} +\\frac{1}{1260x^5}-\\cdots.\\]\n\nThese are asymptotic, generally divergent expansions rather than convergent series at a fixed argument. Truncation is essential to their numerical use. Complex versions hold in sectors bounded away from the negative real axis, with appropriate logarithm conventions. (dlmf.nist.gov)\n\nRatios have a particularly simple leading behavior. For fixed \\(a\\) and \\(b\\),\n\n\\[\\frac{\\Gamma(z+a)}{\\Gamma(z+b)} \\sim z^{a-b}\\]\n\nas \\(|z|\\to\\infty\\) in such sectors. This converts many expressions involving gamma functions into power-law estimates. (dlmf.nist.gov)"
    },
    {
      "heading": "Related functions",
      "text": "Beta function\n\nThe mathematical beta function is defined, for \\(\\operatorname{Re}a>0\\) and \\(\\operatorname{Re}b>0\\), by\n\n\\[B(a,b)=\\int_0^1 t^{a-1}(1-t)^{b-1}\\,dt.\\]\n\nIts relation to the gamma function is\n\n\\[B(a,b)=\\frac{\\Gamma(a)\\Gamma(b)}{\\Gamma(a+b)}.\\]\n\nThis identity connects integrals over a finite interval with Euler’s integral over the positive half-line. (dlmf.nist.gov)\n\nDigamma and polygamma functions\n\nThe digamma function is the logarithmic derivative\n\n\\[\\psi(z)=\\frac{\\Gamma'(z)}{\\Gamma(z)}.\\]\n\nIts successive derivatives are the polygamma functions. In particular, \\(\\psi'(z)\\) is called the trigamma function. They encode derivatives of expressions containing gamma functions, including the curvature of \\(\\ln\\Gamma(x)\\). (dlmf.nist.gov)\n\nIncomplete gamma functions\n\nFor real \\(a>0\\) and \\(x\\geq0\\), the lower and upper incomplete gamma functions divide Euler’s integral at \\(x\\):\n\n\\[\\gamma(a,x)=\\int_0^x t^{a-1}e^{-t}\\,dt, \\qquad \\Gamma(a,x)=\\int_x^\\infty t^{a-1}e^{-t}\\,dt.\\]\n\nThey satisfy\n\n\\[\\gamma(a,x)+\\Gamma(a,x)=\\Gamma(a).\\]\n\nTheir normalized forms,\n\n\\[P(a,x)=\\frac{\\gamma(a,x)}{\\Gamma(a)}, \\qquad Q(a,x)=\\frac{\\Gamma(a,x)}{\\Gamma(a)},\\]\n\nsatisfy \\(P(a,x)+Q(a,x)=1\\). The two-argument notation \\(\\Gamma(a,x)\\) denotes the upper incomplete function, not the ordinary gamma function. (dlmf.nist.gov)"
    },
    {
      "heading": "Applications",
      "text": "Probability and statistics\n\nThe gamma distribution has probability density\n\n\\[f(x)=\\frac{x^{a-1}e^{-x/\\theta}} {\\Gamma(a)\\theta^a}, \\qquad x>0,\\]\n\nwhere \\(a>0\\) is the shape and \\(\\theta>0\\) the scale. The denominator normalizes the density. Substitution \\(t=x/\\theta\\) reduces its total integral to \\(\\Gamma(a)/\\Gamma(a)=1\\). Its cumulative distribution function is \\(P(a,x/\\theta)\\). The chi-squared distribution with \\(\\nu\\) degrees of freedom is the case \\(a=\\nu/2\\), \\(\\theta=2\\). (itl.nist.gov)\n\nGeometry and integral representations\n\nIn \\(n\\)-dimensional Euclidean space, the volume of a ball of radius \\(r\\) is\n\n\\[V_n(r)=\\frac{\\pi^{n/2}r^n}{\\Gamma(n/2+1)},\\]\n\nand its boundary has surface measure\n\n\\[S_{n-1}(r)= \\frac{2\\pi^{n/2}r^{n-1}}{\\Gamma(n/2)}.\\]\n\nInteger and half-integer gamma values place the formulas for both even and odd dimensions in a single expression. (dlmf.nist.gov)\n\nGamma functions also form the building blocks of Mellin–Barnes integrals, contour representations of many special functions. Moving the integration contour and evaluating residues can produce expansions for small or large arguments, together with integral representations of the error. (dlmf.nist.gov)"
    },
    {
      "heading": "Numerical evaluation and limitations",
      "text": "Methods in numerical analysis combine recurrence, series expansions, asymptotic expansions, and reflection. One approach shifts the argument to a region where an asymptotic expansion is accurate and then applies the recurrence backward. Reflection can transfer evaluation from the left half-plane to the right half-plane. Numerical integration provides another approach. (dlmf.nist.gov)\n\nBecause \\(\\Gamma(x)\\) grows rapidly, computing \\(\\ln\\Gamma(x)\\) can avoid overflow in floating-point arithmetic. Gamma ratios and products can often be evaluated through sums and differences of logarithms rather than through separately computed large values. For complex arguments, an analytic logarithm of \\(\\Gamma(z)\\) requires branch conventions and need not equal the principal logarithm of a computed gamma value. Near poles, formulas must account for the singular behavior rather than treat the function as finite. (dlmf.nist.gov)"
    },
    {
      "heading": "Historical development",
      "text": "The gamma function originated in Leonhard Euler’s study of factorial interpolation in the eighteenth century. Euler developed integral and product descriptions and discovered the reflection formula. Legendre derived the duplication formula, while later work supplied global analytic representations and uniqueness characterizations. The development of these properties transformed factorial interpolation into a broader theory linking analysis, geometry, and statistics. (nist.gov)"
    }
  ],
  "links": [
    "mathematical-function",
    "factorial",
    "complex-number",
    "mathematical-analysis",
    "integral",
    "real-number",
    "recurrence-relation",
    "analytic-continuation",
    "analytic-function",
    "convex-function",
    "euler-mascheroni-constant",
    "stirlings-approximation",
    "asymptotic-expansion",
    "beta-function",
    "digamma-function",
    "derivative",
    "incomplete-gamma-function",
    "probability-density-function",
    "cumulative-distribution-function",
    "chi-squared-distribution",
    "euclidean-space",
    "numerical-analysis",
    "floating-point-arithmetic"
  ],
  "sources": [
    {
      "title": "DLMF: §5.2 Definitions",
      "url": "https://dlmf.nist.gov/5.2"
    },
    {
      "title": "DLMF: §5.4 Special Values and Extrema",
      "url": "https://dlmf.nist.gov/5.4"
    },
    {
      "title": "DLMF: §5.5 Functional Relations",
      "url": "https://dlmf.nist.gov/5.5"
    },
    {
      "title": "DLMF: §5.8 Infinite Products",
      "url": "https://dlmf.nist.gov/5.8"
    },
    {
      "title": "DLMF: §5.11 Asymptotic Expansions",
      "url": "https://dlmf.nist.gov/5.11"
    },
    {
      "title": "DLMF: §5.12 Beta Function",
      "url": "https://dlmf.nist.gov/5.12"
    },
    {
      "title": "DLMF: §5.15 Polygamma Functions",
      "url": "https://dlmf.nist.gov/5.15"
    },
    {
      "title": "DLMF: §5.19 Mathematical Applications",
      "url": "https://dlmf.nist.gov/5.19"
    },
    {
      "title": "DLMF: §5.21 Methods of Computation",
      "url": "https://dlmf.nist.gov/draft1/5.21"
    },
    {
      "title": "DLMF: §8.2 Definitions and Basic Properties",
      "url": "https://dlmf.nist.gov/8.2"
    },
    {
      "title": "1.6.5. Gamma",
      "url": "https://www.itl.nist.gov/div898/handbook/apr/section1/apr165.htm"
    },
    {
      "title": "Gamma and Factorial in the Monthly",
      "url": "https://arxiv.org/abs/1703.05349"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}