通过MCP连接 →

输入计算

数学公式

广告

结果

伽马函数值
3.32335097044784
Γ(a) for a = 3.5
自变量 a 3.5
Γ(a) 3.32335097044784
计算方法 Lanczos 近似(g = 7)

什么是伽马函数?

伽马函数记作 \(\Gamma(a)\),是阶乘在实数(乃至复数)范围内的连续推广。对于正整数 \(n\),它满足 \(\Gamma(n) = (n-1)!\),因此 \(\Gamma(5) = 4! = 24\)。当实数 \(a\) 的实部为正时,它由广义积分 $$\Gamma\!\left(a\right) = \int_{0}^{\infty} t^{\,a - 1}\, e^{-t}\, dt$$ 定义。本计算器可返回你输入的任意实数 \(a\) 所对应的 \(\Gamma(a)\) 值。

Smooth curve of the Gamma function plotted against the argument a, showing factorial-like growth and poles at non-positive integers
The Gamma function Γ(a) extends the factorial to non-integer arguments, with poles at 0 and negative integers.

如何使用本计算器

在"变量 a"输入框中填入实数 \(a\),并选择结果要显示的小数位数。被积函数 \(t^{a-1}e^{-t}\) 以及从 0 到无穷大的积分上下限都由定义本身确定,所以你只需提供 \(a\) 即可。计算器会给出 \(\Gamma(a)\) 的结果。如果你输入 \(a = 0\) 或负整数,结果会显示"未定义",因为伽马函数在这些点上存在极点。

公式详解

计算器并非每次都对积分做数值积分,而是采用 Lanczos 近似(\(g = 7\),九个系数)。该方法可将积分值还原到约 15 位有效数字。当 \(a \le 0.5\) 时,它会先应用反射公式 $$\Gamma(a)\cdot\Gamma(1-a) = \frac{\pi}{\sin(\pi a)}$$ 把自变量映射到数值表现良好的区间,并且能够在非整数的负自变量处给出有限值(有时为负值)。

Shaded area under the curve of the integrand t to the power a minus 1 times e to the minus t from zero to infinity
Γ(a) equals the area under the integrand tᵃ⁻¹e⁻ᵗ from 0 to infinity.

实例演算

以 \(a = 3.5\) 为例。利用递推关系 \(\Gamma(a) = (a-1)\cdot\Gamma(a-1)\):$$\Gamma(3.5) = 2.5 \cdot 1.5 \cdot 0.5 \cdot \Gamma(0.5) = 1.875 \cdot \sqrt{\pi} = 1.875 \cdot 1.7724538509 \approx 3.3233509704$$ 计算器给出的结果与此完全一致。

常见问题

为什么 \(\Gamma(0)\) 是未定义的?此处积分发散,函数在 0 以及每一个负整数处都有一个一阶极点,因此取值为无穷大。

\(\Gamma(0.5)\) 等于多少?恰好等于 \(\sqrt{\pi} \approx 1.7724538509\),这是与高斯积分密切相关的著名结果。

计算结果有多精确?对于常见的自变量,Lanczos 近似可达到约 15 位数字的精度,对于几乎所有实际应用都绰绰有余。

最后更新: