Gamma
Details
- Mathematical function, suitable for both symbolic and numerical manipulation.
- The gamma function satisfies
. - The incomplete gamma function satisfies
. - The generalized incomplete gamma function is given by the integral
. - Note that the arguments in the incomplete form of Gamma are arranged differently from those in the incomplete form of Beta.
- Gamma[z] has no branch cut discontinuities.
- Gamma[a,z] has a branch cut discontinuity in the complex z plane running from
to
. - For certain special arguments, Gamma automatically evaluates to exact values.
- Gamma can be evaluated to arbitrary numerical precision.
- Gamma automatically threads over lists.
- Gamma can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (7)
Table[Gamma[n], {n, 10}]Table[Gamma[n + 1 / 2], {n, 5}]Evaluate numerically for complex arguments:
Gamma[2.3 + I]Plot over a subset of the reals:
Plot[Gamma[x], {x, -3, 3}]Plot over a subset of the complexes:
ComplexPlot3D[Gamma[z], {z, -2 - 2I, 2 + 2I}, PlotLegends -> Automatic]Series expansion at the origin:
Series[Gamma[x], {x, 0, 1}]Series expansion at Infinity:
Series[Gamma[ x], {x, ∞, 3}]//Normal//FullSimplifyScope (51)
Numerical Evaluation (5)
{Gamma[2.2], Gamma[1.5, 7.5], Gamma[1, 1.1, 2.2]}N[Gamma[22 / 10], 50]The precision of the output tracks the precision of the input:
Gamma[2.20000000000000000000000000000000000000000]Evaluate Gamma efficiently at high precision:
Gamma[2.2`500]//TimingGamma[2.2`5000];//TimingCompute worst-case guaranteed intervals using Interval and CenteredInterval objects:
Gamma[Interval[{1.4, 1.5}]]Gamma[CenteredInterval[3 / 4, 1 / 100]]Gamma[2 / 3, CenteredInterval[-3 + I, (1 + I) / 100]]Compute average-case statistical intervals using Around:
Gamma[1, 1, Around[1 / 2, 0.01]]Compute the elementwise values of an array:
Gamma[2, {{7 / 2, 0}, {0, 13 / 2}}]Or compute the matrix Gamma function using MatrixFunction:
MatrixFunction[Gamma[2, #]&, {{7 / 2, 0}, {0, 13 / 2}}]Specific Values (5)
Singular points of Gamma:
Assuming[{n∈Integers && n ≤ 0}, Refine[Gamma[n]]]Gamma[{-Infinity, Infinity, I Infinity, ComplexInfinity}]Find a local minimum as a root of
:
xmin = N@Solve[D[Gamma[x], x] == 0 && 0 < x < 2, x, Reals][[1, 1, 2]]//QuietPlot[Gamma[x], {x, -1, 4}, Epilog -> Style[Point[{xmin, Gamma[xmin]}], PointSize[Large], Red]]Evaluate the incomplete gamma function symbolically at integer and half‐integer orders:
Gamma[2, z]//FunctionExpandGamma[7 / 2, z]//FunctionExpandEvaluate the generalized incomplete gamma function symbolically at half‐integer orders:
Gamma[13 / 2, 7 / 2, 1 / 2]//FunctionExpand//SimplifyVisualization (3)
Plot the Euler gamma function:
Plot[Gamma[x], {x, -4, 4}]ComplexContourPlot[Re[Gamma[z]], {z, -4 - 4I, 4 + 4I}, Contours -> 24]ComplexContourPlot[Im[Gamma[z]], {z, -4 - 4I, 4 + 4I}, Contours -> 24]Plot the incomplete gamma function for integer and half-integer orders:
Plot[{Gamma[1 / 2, x], Gamma[1, x], Gamma[3 / 2, x], Gamma[2, x]}, {x, -4, 4}, IconizedObject[«PlotOptions»]]Function Properties (10)
Real domain of the complete Euler gamma function:
FunctionDomain[Gamma[x], x]FunctionDomain[Gamma[z], z, Complexes]Domain of the incomplete gamma functions:
FunctionDomain[Gamma[z, a], {z, a}]FunctionDomain[Gamma[z, a], {z, a}, Complexes]FunctionDomain[Gamma[z, a, b], {z, a, b}, Complexes]The gamma function
achieves all nonzero values on the reals:
FunctionRange[Gamma[x], x, y]The incomplete gamma function
achieves all positive real values for real inputs:
FunctionRange[Gamma[1, x], x, y]On the complexes, however, it achieves all nonzero values:
FunctionRange[Gamma[1, z], z, y, Complexes]The incomplete gamma function
has the restricted range
:
FunctionRange[Gamma[1 / 2, x], x, y]The Euler gamma function has the mirror property
:
FullSimplify[Gamma[Conjugate[z]] == Conjugate[Gamma[z]]]The complete gamma function
is a meromorphic, nonanalytic function:
FunctionMeromorphic[Gamma[x], x]FunctionAnalytic[Gamma[x], x]
is analytic in
for positive integer
:
FunctionAnalytic[Gamma[a, x], x, Assumptions -> a > 0 && a∈ℤ]But in general, it is neither an analytic nor a meromorphic function:
FunctionAnalytic[Gamma[1 / 2, x], x]FunctionMeromorphic[Gamma[1 / 2, x], x]
has both singularities and discontinuities on the non-positive integers:
FunctionSingularities[Gamma[x], x]FunctionDiscontinuities[Gamma[x], x]
is neither non-increasing nor non-decreasing:
FunctionMonotonicity[Gamma[x], x, PositiveReals]
is a non-increasing function of
when
is a positive, odd integer:
FunctionMonotonicity[Gamma[2k + 1, x], x, Assumptions -> k∈ℤ && k > 0]But in general, it is neither non-increasing nor non-decreasing:
FunctionMonotonicity[Gamma[2, x], x]FunctionInjective[Gamma[1 / 2, x], x]
is an injective function of
for noninteger
:
FunctionInjective[Gamma[a, x], x, Assumptions -> a > 0 && a∉ℤ]FunctionInjective[Gamma[a, x], x, Assumptions -> a < 0 && a∉ℤ]For integer
, it may or may not be injective in
:
FunctionInjective[Gamma[1, x], x]FunctionInjective[Gamma[2, x], x]Plot[{Gamma[1, x], Gamma[2, x], Gamma[x], .925}, {x, -1, 3}, PlotRange -> {0, 2}]FunctionSurjective[Gamma[x], x]FunctionSurjective[Gamma[a, x], x, Assumptions -> a ≤ 0]FunctionSurjective[Gamma[a, x], x, Assumptions -> a > 0 && a∉ℤ]Plot[{Gamma[1 / 2, x], -1}, {x, 0, 10}]
is neither non-negative nor non-positive:
FunctionSign[Gamma[x], x]
is non-negative for positive odd
:
FunctionSign[Gamma[2k + 1, x], x, Assumptions -> k∈ℤ && k > 0]In general, it is neither non-negative nor non-positive:
FunctionSign[Gamma[2, x], x]
is neither convex nor concave:
FunctionConvexity[Gamma[x], x]
is convex on its real domain for
:
FunctionConvexity[{Gamma[a, x], x > 0}, x, Assumptions -> -1 ≤ a ≤ 1]It is in general neither convex nor concave for other values of
:
FunctionConvexity[Gamma[2, x], x]Differentiation (4)
First derivative of the Euler gamma function:
D[Gamma[x], x]First derivative of the incomplete gamma function:
D[Gamma[a, x], x]Higher derivatives of the Euler gamma function:
Table[D[Gamma[x], {x, n}], {n, 1, 3}]Plot[Evaluate[%], {x, -4, 4}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative"}]Higher derivatives of the incomplete gamma function for an order
:
Table[D[Gamma[1 / 2, x], {x, n}], {n, 1, 3}]Plot[Evaluate[%], {x, 0, 4}]Integration (3)
Indefinite integral of the incomplete gamma function:
Integrate[Gamma[a, x], x]Indefinite integrals of a product involving the incomplete gamma function:
Integrate[Exp[x]Gamma[a, x], x]Integrate[x ^ b Gamma[a, x], x]Numerical approximation of a definite integral
:
NIntegrate[Gamma[x], {x, 1, 2}]Series Expansions (7)
Taylor expansion for the Euler gamma function around
:
Series[Gamma[x], {x, 1, 3}]Plot the first three approximations for the Euler gamma function around
:
terms = Normal@Table[Series[Gamma[x], {x, 1, m}], {m, 1, 3}];
Plot[{Gamma[x], terms}, {x, 0, 2}]Series expansion at infinity for the Euler gamma function (Stirling approximation):
Series[Gamma[z], {z, Infinity, 2}]//NormalGive the result for an arbitrary symbolic direction:
Series[Gamma[x], {x, DirectedInfinity[z], 2}]//Simplify//NormalSeries expansion for the incomplete gamma function at a generic point:
Series[Gamma[a, z], {z, z0, 2}]Series[Gamma[a, z], {a, a0, 2}]Series expansion for the incomplete gamma function at infinity:
Series[Gamma[a, z], {z, Infinity, 3}]//NormalSeries[Gamma[a, z], {a, Infinity, 2}]//NormalSeries expansion for the generalized incomplete gamma function at a generic point:
Series[Gamma[a, z1, z2], {z2, z20, 2}]Series expansion at a singular point:
Series[Gamma[x], {x, -1, 1}]//NormalGamma can be applied to a power series:
Gamma[1 + x + (x^2/2) + O[x]^3]Integral Transforms (4)
Compute the Laplace transform of the incomplete gamma function using LaplaceTransform:
LaplaceTransform[Gamma[a, t], t, s ]InverseLaplaceTransform of the incomplete gamma function:
InverseLaplaceTransform[Gamma[a, s], s, t ]MellinTransform of the incomplete gamma function:
MellinTransform[Gamma[a, x], x, s ]InverseMellinTransform of the Euler gamma function:
InverseMellinTransform[Gamma[s], s, x ]Function Identities and Simplifications (5)
FunctionExpand[(n - 1)!, {Element[n, Integers] && n > 0}]Use FullSimplify to simplify gamma functions:
FullSimplify[Gamma[z]Gamma[1 - z]]FullSimplify[2^2z - 1Gamma[z]Gamma[z + 1 / 2]]The Euler gamma function basic relation,
:
FullSimplify[Gamma[z + 1] == z Gamma[z]]The Euler gamma function of a double argument,
:
FullSimplify[Gamma[2x] == (2^2x - 1/Sqrt[π])Gamma[x]Gamma[x + 1 / 2]]Relation to the incomplete gamma function:
FullSimplify[Gamma[z, 0], Re@z > 0]Function Representations (5)
Integral representation of the Euler gamma function:
Integrate[t ^ (z - 1) Exp[-t], {t, 0, Infinity}, Assumptions -> Re[z] > 0]Integral representation of the incomplete gamma function:
Integrate[t ^ (a - 1) Exp[-t], {t, z, Infinity}, Assumptions -> Re[z] > 0]The incomplete gamma function can be represented in terms of MeijerG:
MeijerGReduce[Gamma[a, x], x]Activate[%]//FullSimplifyThe incomplete gamma function can be represented as a DifferentialRoot:
DifferentialRootReduce[Gamma[a, x], x]TraditionalForm formatting:
Gamma[z]//TraditionalFormGeneralizations & Extensions (6)
Euler Gamma Function (3)
Gamma threads elementwise over lists:
Gamma[{2, 3, 5, 7, 11}]Series[Gamma[z], {z, 0, 1}]Expansion at symbolically specified negative integers:
Series[Gamma[z], {z, -n, 1}, Assumptions -> n∈Integers∧n ≥ 0]TraditionalForm formatting:
Gamma[z]//TraditionalFormIncomplete Gamma Function (1)
Applications (9)
Plot of the absolute value of Gamma in the complex plane:
Plot3D[Abs[Gamma[x + I y]], {x, -5, 2}, {y, -1, 1}]Find the asymptotic expansion of ratios of gamma functions:
Series[(Gamma[n + α]/Gamma[n + β]), {n, ∞, 1}]Volume of an
‐dimensional unit hypersphere:
hypersphereVolume[n_] := (π^n / 2/Gamma[(n/2) + 1])Table[r ^ n hypersphereVolume[n], {n, 10}]Plot the volume of the unit hypersphere as a function of dimension:
DiscretePlot[hypersphereVolume[n], {n, 0, 25}]Plot the real part of the incomplete gamma function over the parameter plane:
Plot3D[Re[Gamma[a, x]], {a, -2, 2}, {x, -2, 2}]CDF[ChiSquareDistribution[r]][x]{D[%, x], PDF[ChiSquareDistribution[r]][x]}Plot the CDF for different numbers of degrees of freedom:
Plot[Evaluate[Table[CDF[ChiSquareDistribution[r]][x], {r, 5}]], {x, 0, 10}]Compute derivatives of the Gamma function with the BellY polynomial:
Gamma[n]BellY[Table[{1, PolyGamma[k - 1, n]}, {k, 3}]]//ExpandD[Gamma[n], {n, 3}]Compute
as a limit of Gamma functions at Infinity:
Limit[(2 ^ (4 x - 1) Gamma[x + 1] ^ 4) / ((2x - 1) Gamma[2x + 1] ^ 2), x -> ∞]Expectation value of the square root of a quadratic form over a normal distribution:
MatrixForm[mat = HilbertMatrix[3]]NExpectation[Sqrt[(1/2){u, v, w}.mat.{u, v, w}], {u, v, w}ProductDistribution[{NormalDistribution[], 3}], Method -> "MonteCarlo"]//QuietCompare with the closed-form result in terms of Gamma and CarlsonRG:
N[(Gamma[(3 - 1/2)]/Gamma[(3/2)])(CarlsonRG@@Eigenvalues[mat]), 25]Represent Zeta in terms of Integrate and the Gamma function:
FullSimplify[Zeta[s] == (1/Gamma[s]) Subsuperscript[∫, 0, ∞](t^s - 1/E^t - 1)ⅆt, Re[s] > 1]Properties & Relations (7)
Use FullSimplify to simplify gamma functions:
FullSimplify[Gamma[z]Gamma[1 - z]]Numerically find a root of a transcendental equation:
FindRoot[Gamma[z] - 4 Gamma[z + 2] + z == 2, {z, 1}]Sum expressions involving Gamma:
Underoverscript[∑, k = 1, n]Gamma[k]FunctionExpand[%]Generate from integrals, products, and limits:
Integrate[t ^ (z - 1) Exp[-t], {t, 0, Infinity}, Assumptions -> Re[z] > 0]E^z EulerGamma Product[(1 + (z/k))E^-z / k, {k, 1, Infinity}]Product[((1 + (1/k))^z/1 + (z/k)), {k, 1, Infinity}]Obtain Gamma as the solution of a differential equation:
DSolve[z Derivative[2][w][z] + (1 - a + z) Derivative[1][w][z] == 0 , w, z]Integrate[z ^ b Gamma[a, z], z]Gamma can be represented as a DifferenceRoot:
DifferenceRootReduce[Gamma[k], k]Possible Issues (2)
Neat Examples (3)
Nest Gamma over the complex plane:
DensityPlot[Arg[Nest[Gamma, x + I y, 3]], {x, -1.25, -0.6}, {y, -0.25, 0.25}]//QuietFractal from iterating Gamma:
ArrayPlot[Table[c = N[cr + I ci];Length @NestWhileList[If[Abs[#] > 20., Indeterminate, Gamma[# / c]]&, c, (# =!= Indeterminate)&, 1, 20], {ci, -2.5, 2.5, 5 / 100}, {cr, -2, 2, 4 / 100}]]//QuietWith[{a = 1 / 3, ε = 1*^-12},
ParametricPlot3D[Table[{r Cos[φ], r Sin[φ], Im[Exp[2 k π I a] Gamma[a, r Exp[I φ]] + (1 - Exp[2 k π I a]) Gamma[a]]}, {k, -2, 2}], {r, 0, 2}, {φ, -π + ε, π - ε}, BoxRatios -> {1, 1, 2.5}, Mesh -> None, PlotPoints -> 21, PlotRange -> All, PlotStyle -> Directive[Hue[0.09], Opacity[0.6]]]]History
Introduced in 1988 (1.0) | Updated in 2021 (13.0) ▪ 2022 (13.1)
Text
Wolfram Research (1988), Gamma, Wolfram Language function, https://reference.wolfram.com/language/ref/Gamma.html (updated 2022).
CMS
Wolfram Language. 1988. "Gamma." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/Gamma.html.
APA
Wolfram Language. (1988). Gamma. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Gamma.html
BibTeX
@misc{reference.wolfram_2026_gamma, author="Wolfram Research", title="{Gamma}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/Gamma.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_gamma, organization={Wolfram Research}, title={Gamma}, year={2022}, url={https://reference.wolfram.com/language/ref/Gamma.html}, note=[Accessed: 12-June-2026]}