前言
阶乘和gamma
函数关系密切.
# 在python中适用sympy来求这个积分
>>> from sympy import *
>>> import numpy as np
>>> x = symbols('x')
>>> print(integrate(x**1 * exp(-x), (x, 0, np.inf)))
1
>>> print(integrate(x**2 * exp(-x), (x, 0, np.inf)))
2
>>> print(integrate(x**3 * exp(-x), (x, 0, np.inf)))
6