BarnesG[z]
gives the Barnes G-function
.
BarnesG
BarnesG[z]
gives the Barnes G-function
.
Details
- BarnesG is also known as the double gamma function.
- Mathematical function, suitable for both symbolic and numeric manipulation.
- The Barnes G-function is defined as
for positive integers
and is otherwise defined as
. - The Barnes G-function satisfies the functional equation
. - BarnesG[z] is an entire function of z with no branch cut discontinuities.
- For certain special arguments, BarnesG automatically evaluates to exact values.
- BarnesG can be evaluated to arbitrary numerical precision.
- BarnesG automatically threads over lists.
- BarnesG can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (5)
BarnesG[10]Plot over a subset of the reals:
Plot[BarnesG[z], {z, -4, 4}]Plot over a subset of the complexes:
ComplexPlot3D[BarnesG[z], {z, -1 - I, 1 + I}, PlotLegends -> Automatic]Series expansion at the origin:
Series[BarnesG[x], {x, 0, 2}]//FullSimplifySeries expansion at Infinity:
Series[BarnesG[x], {x, ∞, 2}]Scope (27)
Numerical Evaluation (6)
BarnesG[0.5]BarnesG[3]N[BarnesG[1 / 7], 20]The precision of the output tracks the precision of the input:
BarnesG[0.222255555666222222222222222]BarnesG[1.3 + I]Evaluate efficiently at high precision:
BarnesG[0.5`1000]//TimingBarnesG[0.7`1000];//TimingCompute worst-case guaranteed intervals using Interval and CenteredInterval objects:
BarnesG[Interval[{1.17, 1.18}]]BarnesG[CenteredInterval[1 / 2, 1 / 1000]]Or compute average-case statistical intervals using Around:
BarnesG[ Around[2.1, 0.01]]Compute the elementwise values of an array:
BarnesG[{{1 / 2, 1}, {1, 1 / 2}}]Or compute the matrix BarnesG function using MatrixFunction:
MatrixFunction[BarnesG[#]&, {{1 / 2, 1}, {1, 1 / 2}}]//FullSimplifySpecific Values (4)
BarnesG[Infinity]BarnesG[0]Evaluate symbolically at half‐integer arguments:
BarnesG[{-1 / 2, 3 / 2}]Evaluate symbolically at integer multiples of 1/4:
BarnesG[{-3 / 4, 1 / 4}]Find the first positive maximum:
xmax = x /. N@Solve[D[BarnesG[x], x] == 0 && 0 < x < 2, x, Reals][[1]]//QuietPlot[BarnesG[x], {x, -1, 4}, Epilog -> Style[Point[{xmax, BarnesG[xmax]}], PointSize[Large], Red]]Visualization (2)
Plot the BarnesG function:
Plot[BarnesG[x], {x, -4, 4}]ComplexContourPlot[Re[BarnesG[z]], {z, -3 - 4I, 3 + 4I}, Contours -> 24]ComplexContourPlot[Im[BarnesG[z]], {z, -3 - 4I, 3 + 4I}, Contours -> 24]Function Properties (10)
BarnesG is defined for all real and complex values:
FunctionDomain[BarnesG[x], x]FunctionDomain[BarnesG[z], z, Complexes]Approximate function range of BarnesG:
FunctionRange[BarnesG[x], x, y]BarnesG is an analytic function of x:
FunctionAnalytic[BarnesG[x], x]BarnesG is neither non-increasing nor non-decreasing:
FunctionMonotonicity[BarnesG[x], x]BarnesG is not injective:
FunctionInjective[BarnesG[x], x]Plot[{BarnesG[x], .2}, {x, -4, 4}]BarnesG is surjective:
FunctionSurjective[BarnesG[x], x]Plot[{BarnesG[x], 5}, {x, -5, 5}]BarnesG is neither non-negative nor non-positive:
FunctionSign[BarnesG[x], x]BarnesG has no singularities or discontinuities:
FunctionSingularities[BarnesG[x], x]FunctionDiscontinuities[BarnesG[x], x]BarnesG is neither convex nor concave:
FunctionConvexity[BarnesG[x], x]TraditionalForm formatting:
BarnesG[z]//TraditionalFormDifferentiation (2)
First derivative with respect to z:
D[BarnesG[z], z]Higher derivatives with respect to z:
Table[D[BarnesG[z], {z, k}], {k, 1, 3}]//FullSimplifyPlot the higher derivatives with respect to z:
Plot[%, {z, -4, 4}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative"}]Series Expansions (3)
Find the Taylor expansion using Series:
Series[BarnesG[x], {x, 0, 2}]//Normal//FullSimplifyPlots of the first three approximations around
:
terms = Normal@FullSimplify[Table[Series[BarnesG[x], {x, 0, m}], {m, 1, 5, 2}]];
Plot[{BarnesG[x], terms}, {x, 0, 10}, PlotRange -> {-100, 100}]Taylor expansion at a generic point:
Series[BarnesG[x], {x, x0, 2}]// Normal//FullSimplifyFind the series expansion at Infinity:
Series[BarnesG[x], {x, Infinity, 1}]Applications (5)
Integer values of BarnesG are related to the superfactorial:
Table[ Product[k!, {k, n}], {n, 10}]Table[BarnesG[n + 2], {n, 10}]BarnesG may be generated by symbolic solvers:
Product[Gamma[i] / CatalanNumber[i], i]Sum[Log[Pochhammer[3, i]], {i, 0, n}]RSolve[y[i + 1] == i! y[i], y, i]Compute the number of bits needed to store a large integer:
Log2[BarnesG[500]]//NBitLength[BarnesG[500]]For
an odd prime, a generalization of Wilson's theorem states that
. Verify for the first few odd primes:
Table[Mod[(p - 1)!!, p] == Mod[BarnesG[p + 1], p], {p, Prime[Range[2, 11]]}]Define a Cauchy matrix constructed from the first
positive integers and an integer shift
:
cmat[b_, n_Integer] := CauchyMatrix[b + Range[n], Range[n]]Show the Cauchy matrix for arbitrary
:
MatrixForm[cmat[b, 5]]The determinant of this Cauchy matrix can be expressed in terms of BarnesG. Verify with a specific value of
for the first few cases:
With[{b = 3, n = 9},
Table[Det[cmat[b, n]] == (BarnesG[n + b + 2]^2BarnesG[n + 1]^2/BarnesG[b + 2]BarnesG[2n + b + 2]), {k, n}]]Properties & Relations (2)
BarnesG satisfies a differential equation:
DSolve[{y[1] == 1, y'[z] == y[z] BarnesG'[z] / BarnesG[z]}, y, z]y[15] /. First[%]//FullSimplifyBarnesG[15]FindSequenceFunction can recognize the BarnesG sequence:
Table[BarnesG[n], {n, 10}]FindSequenceFunction[%, n]Neat Examples (3)
Determinants of Hankel matrices built out of Bell numbers:
Table[Det[HankelMatrix[BellB[Range[n]], BellB[Range[n, 2n - 1]]]], {n, 10}]Table[BarnesG[n + 1], {n, 10}]Determinants of Hankel matrices built out of Euler numbers:
Table[Det[HankelMatrix[EulerE[Range[0, n - 1]], EulerE[Range[n - 1, 2n - 2]]]], {n, 10}]Table[(-1)^Binomial[n, 2]BarnesG[n + 1]^2, {n, 10}]The determinant of the Hilbert matrix can be expressed in terms of the Barnes G-function:
hilbertDet[n_] := BarnesG[n + 1] ^ 4 / BarnesG[2 n + 1]Verify the formula for the first few cases:
Table[hilbertDet[n] == Det[HilbertMatrix[n]], {n, 2, 9}]Related Guides
Related Links
Text
Wolfram Research (2008), BarnesG, Wolfram Language function, https://reference.wolfram.com/language/ref/BarnesG.html (updated 2022).
CMS
Wolfram Language. 2008. "BarnesG." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/BarnesG.html.
APA
Wolfram Language. (2008). BarnesG. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BarnesG.html
BibTeX
@misc{reference.wolfram_2026_barnesg, author="Wolfram Research", title="{BarnesG}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/BarnesG.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_barnesg, organization={Wolfram Research}, title={BarnesG}, year={2022}, url={https://reference.wolfram.com/language/ref/BarnesG.html}, note=[Accessed: 13-June-2026]}