高斯积分 (英語:Gaussian integral ),有时也被称为概率积分 ,是高斯函数 (e −x 2 )在整个實數線 上的积分 。它得名于德国 数学家 兼物理学家 卡爾·弗里德里希·高斯 之姓氏。
f (x ) = e −x 2 的图像,这个函数与 x 轴之间的面积等于 π {\displaystyle \scriptstyle {\sqrt {\pi }}} 。 ∫ − ∞ ∞ e − x 2 d x = π {\displaystyle \int _{-\infty }^{\infty }e^{-x^{2}}dx={\sqrt {\pi }}} 高斯积分用处很广。例如,利用换元积分法,它可以用来计算正态分布 的归一化常数 。在极限为有限值的时候,高斯积分与正态分布 的误差函数 和累积分布函数 密切相关。在物理学中,这种积分也经常出现:例如在量子力学 中,谐振子基态的概率密度;在路径积分公式中,谐振子的传播子;以及统计力学 中的配分函数,以上的计算都要用到这个积分。
我们可以通过Risch算法 证明误差函数不具有初等函数 形式;尽管如此,高斯积分可以通过多元微积分 方法分析求解。虽然不定积分 ∫ e − x 2 d x {\displaystyle \int e^{-x^{2}}\,dx} 无法用初等函数表示,但定积分 ∫ − ∞ ∞ e − x 2 d x {\displaystyle \int _{-\infty }^{\infty }e^{-x^{2}}\,dx} 是可以计算的。
任意高斯函数 的定积分为
∫ − ∞ ∞ e − a ( x + b ) 2 d x = π a . {\displaystyle \int _{-\infty }^{\infty }e^{-a(x+b)^{2}}\,dx={\sqrt {\frac {\pi }{a}}}.}
计算方式
通过极限计算 要想找到高斯积分的闭合形式,首先定义一个近似函数:
I ( a ) = ∫ − a a e − x 2 d x {\displaystyle I(a)=\int _{-a}^{a}e^{-x^{2}}dx} ,高斯积分可以通过它的极限来运算:
lim a → ∞ I ( a ) = ∫ − ∞ + ∞ e − x 2 d x . {\displaystyle \lim _{a\to \infty }I(a)=\int _{-\infty }^{+\infty }e^{-x^{2}}\,dx.} 对 I {\displaystyle I} 取平方获得
I 2 ( a ) = ( ∫ − a a e − x 2 d x ) ⋅ ( ∫ − a a e − y 2 d y ) = ∫ − a a ( ∫ − a a e − y 2 d y ) e − x 2 d x = ∫ − a a ∫ − a a e − ( x 2 + y 2 ) d x d y . {\displaystyle I^{2}(a)=\left(\int _{-a}^{a}e^{-x^{2}}\,dx\right)\cdot \left(\int _{-a}^{a}e^{-y^{2}}\,dy\right)=\int _{-a}^{a}\left(\int _{-a}^{a}e^{-y^{2}}\,dy\right)\,e^{-x^{2}}\,dx=\int _{-a}^{a}\int _{-a}^{a}e^{-(x^{2}+y^{2})}\,dx\,dy.} 根据富比尼定理 ,以上的双重积分可以被看作是直角坐标系 上一个正方形的面积积分 ∫ e − ( x 2 + y 2 ) d ( x , y ) {\displaystyle \int e^{-(x^{2}+y^{2})}\,d(x,y)} ,其顶点 为 { ( − a , a ) , ( a , a ) , ( a , − a ) , ( − a , − a ) } {\displaystyle \{(-a,a),(a,a),(a,-a),(-a,-a)\}} 。
不论 x {\displaystyle x} 为任何实数,指数函数 e x {\displaystyle e^{x}} 均大于0,所以这个正方形的内切圆 的积分必须小于 I ( a ) 2 {\displaystyle I(a)^{2}} 。同理,正方形的外接圆 积分必须大于 I ( a ) 2 {\displaystyle I(a)^{2}} 。通过从直角坐标系转化到极坐标系 x = r cos θ {\displaystyle x=r\,\cos \theta } , y = r sin θ {\displaystyle y=r\,\sin \theta } , d ( x , y ) = r d ( r , θ ) {\displaystyle d(x,y)=r\,d(r,\theta )} ,可以计算出这两个圆面的积分:
∫ 0 2 π ∫ 0 a r e − r 2 d r d θ < I 2 ( a ) < ∫ 0 2 π ∫ 0 a 2 r e − r 2 d r d θ {\displaystyle \int _{0}^{2\pi }\int _{0}^{a}re^{-r^{2}}\,dr\,d\theta <I^{2}(a)<\int _{0}^{2\pi }\int _{0}^{a{\sqrt {2}}}re^{-r^{2}}\,dr\,d\theta } ,得到
π ( 1 − e − a 2 ) < I 2 ( a ) < π ( 1 − e − 2 a 2 ) . {\displaystyle \pi (1-e^{-a^{2}})<I^{2}(a)<\pi (1-e^{-2a^{2}}).} 使用夹擠定理 获得高斯积分
∫ − ∞ ∞ e − x 2 d x = π . {\displaystyle \int _{-\infty }^{\infty }e^{-x^{2}}\,dx={\sqrt {\pi }}.}
利用沃利斯积分计算 在这里,对于n 为自然数时,沃利斯积分 定义为:
I n = ∫ 0 π 2 sin n x d x = { n − 1 n ⋅ n − 3 n − 2 ⋯ 3 4 ⋅ 1 2 ⋅ π 2 2 | n n − 1 n ⋅ n − 3 n − 2 ⋯ 4 5 ⋅ 2 3 ⋅ 1 2 ∤ n {\displaystyle I_{n}=\int _{0}^{\frac {\pi }{2}}\sin ^{n}x\mathrm {d} x={\begin{cases}{\dfrac {n-1}{n}}\cdot {\dfrac {n-3}{n-2}}\cdots {\dfrac {3}{4}}\cdot {\dfrac {1}{2}}\cdot {\dfrac {\pi }{2}}&2|n\\{\dfrac {n-1}{n}}\cdot {\dfrac {n-3}{n-2}}\cdots {\dfrac {4}{5}}\cdot {\dfrac {2}{3}}\cdot 1&2\nmid n\end{cases}}} 因此有 n + 1 n + 2 = I n + 2 I n {\displaystyle {\frac {n+1}{n+2}}={\frac {I_{n+2}}{I_{n}}}} 的关系,并且根据 I n + 2 ⩽ I n + 1 ⩽ I n {\displaystyle I_{n+2}\leqslant I_{n+1}\leqslant I_{n}} 以及夹挤定理 得到 lim n → ∞ I n + 1 I n = 1 {\displaystyle \lim _{n\to \infty }{\frac {I_{n+1}}{I_{n}}}=1} ,另外也可以得到 ( n + 2 ) I n + 1 I n + 2 ( n + 1 ) I n I n + 1 = 1 {\displaystyle {\frac {(n+2)I_{n+1}I_{n+2}}{(n+1)I_{n}I_{n+1}}}=1} ,因此总有 ( n + 1 ) I n I n + 1 = I 0 I 1 = π 2 {\displaystyle (n+1)I_{n}I_{n+1}=I_{0}I_{1}={\frac {\pi }{2}}} ,于是可以得到:
lim n → ∞ ( n + 1 ) I n + 1 n I n = lim n → ∞ ( n + 1 ) I n I n + 1 n I n 2 = lim n → ∞ π 2 n I n 2 = 1 lim n → ∞ n I n = π 2 {\displaystyle {\begin{aligned}\lim _{n\to \infty }{\frac {(n+1)I_{n+1}}{nI_{n}}}&=\lim _{n\to \infty }{\frac {(n+1)I_{n}I_{n+1}}{nI_{n}^{2}}}=\lim _{n\to \infty }{\frac {\pi }{2nI_{n}^{2}}}=1\\\lim _{n\to \infty }{\sqrt {n}}I_{n}&={\sqrt {\frac {\pi }{2}}}\end{aligned}}} 考虑到 e t = ∑ k = 0 ∞ t k k ! {\displaystyle \mathrm {e} ^{t}=\sum _{k=0}^{\infty }{\frac {t^{k}}{k!}}} 以及 1 1 − t = ∑ k = 0 ∞ t k {\displaystyle {\frac {1}{1-t}}=\sum _{k=0}^{\infty }t^{k}} ,因此当 t ⩾ 0 {\displaystyle t\geqslant 0} 时该不等式成立:
1 1 − t ⩾ e t ⩾ 1 + t {\displaystyle {\frac {1}{1-t}}\geqslant \mathrm {e} ^{t}\geqslant 1+t} 当 t = x 2 {\displaystyle t=x^{2}} 并且不等式各边取倒数之后,变成:
1 − x 2 ⩽ e − x 2 ⩽ 1 1 + x 2 {\displaystyle 1-x^{2}\leqslant \mathrm {e} ^{-x^{2}}\leqslant {\frac {1}{1+x^{2}}}} 各边同时乘方运算与积分,并且最右边的部分积分区间大于左边与中间部分,变成:
∫ 0 1 ( 1 − x 2 ) n d x ⩽ ∫ 0 1 e − n x 2 d x ⩽ ∫ 0 ∞ d x ( 1 + x 2 ) n {\displaystyle \int _{0}^{1}(1-x^{2})^{n}\mathrm {d} x\leqslant \int _{0}^{1}\mathrm {e} ^{-nx^{2}}\mathrm {d} x\leqslant \int _{0}^{\infty }{\frac {\mathrm {d} x}{(1+x^{2})^{n}}}} 最左边变量代换为 x = sin θ {\displaystyle x=\sin \theta } 得 d x = cos θ d θ {\displaystyle \mathrm {d} x=\cos \theta \mathrm {d} \theta } ;当中变量代换为 x = y n {\displaystyle x={\frac {y}{\sqrt {n}}}} ;最右边变量代换为 x = tan θ {\displaystyle x=\tan \theta } 得 d x = sec 2 θ d θ = d θ cos 2 θ {\displaystyle \mathrm {d} x=\sec ^{2}\theta \mathrm {d} \theta ={\frac {\mathrm {d} \theta }{\cos ^{2}\theta }}} ,变成:
∫ 0 π 2 cos 2 n + 1 θ d θ ⩽ 1 n ∫ 0 n e − y 2 d y ⩽ ∫ 0 π 2 cos 2 n − 2 θ d θ {\displaystyle \int _{0}^{\frac {\pi }{2}}\cos ^{2n+1}\theta \mathrm {d} \theta \leqslant {\frac {1}{\sqrt {n}}}\int _{0}^{\sqrt {n}}\mathrm {e} ^{-y^{2}}\mathrm {d} y\leqslant \int _{0}^{\frac {\pi }{2}}\cos ^{2n-2}\theta \mathrm {d} \theta } 利用诱导公式 cos ( π 2 − θ ) = sin θ {\displaystyle \cos \left({\frac {\pi }{2}}-\theta \right)=\sin \theta } ,并且同时乘系数 n {\displaystyle {\sqrt {n}}} ,变成:
n ∫ 0 π 2 sin 2 n + 1 θ d θ ⩽ ∫ 0 n e − y 2 d y ⩽ n ∫ 0 π 2 sin 2 n − 2 θ d θ {\displaystyle {\sqrt {n}}\int _{0}^{\frac {\pi }{2}}\sin ^{2n+1}\theta \mathrm {d} \theta \leqslant \int _{0}^{\sqrt {n}}\mathrm {e} ^{-y^{2}}\mathrm {d} y\leqslant {\sqrt {n}}\int _{0}^{\frac {\pi }{2}}\sin ^{2n-2}\theta \mathrm {d} \theta } 此时即为 n I 2 n + 1 ⩽ ∫ 0 n e − y 2 d y ⩽ n I 2 n − 2 {\displaystyle {\sqrt {n}}I_{2n+1}\leqslant \int _{0}^{\sqrt {n}}\mathrm {e} ^{-y^{2}}\mathrm {d} y\leqslant {\sqrt {n}}I_{2n-2}} ,当 n → ∞ {\displaystyle n\to \infty } 时通过夹挤定理 可以得到共同极限为 π 2 {\displaystyle {\frac {\sqrt {\pi }}{2}}} ,最终有 ∫ − ∞ ∞ e − x 2 d x = 2 ∫ 0 ∞ e − x 2 d x = π {\displaystyle \int _{-\infty }^{\infty }\mathrm {e} ^{-x^{2}}\mathrm {d} x=2\int _{0}^{\infty }\mathrm {e} ^{-x^{2}}\mathrm {d} x={\sqrt {\pi }}} 。
与Γ函数的关系
推广
高斯函数的积分 任一高斯函数 的积分都可以用以下的公式计算:
∫ − ∞ ∞ e − a ( x + b ) 2 d x = π a {\displaystyle \int _{-\infty }^{\infty }e^{-a(x+b)^{2}}\,dx={\sqrt {\frac {\pi }{a}}}} 更为广泛的形式为:
∫ − ∞ ∞ e − a x 2 + b x + c d x = π a e b 2 4 a + c {\displaystyle \int _{-\infty }^{\infty }e^{-ax^{2}+bx+c}\,dx={\sqrt {\frac {\pi }{a}}}\,e^{{\frac {b^{2}}{4a}}+c}}
这一公式在计算有关正态分布 的一些连续概率分布 的数学期望值的时候特别有用,例如对数正态分布 。
n维和泛函推广 令 A {\displaystyle A} 为一个对称的、正定 的(因而可逆 ) n × n {\displaystyle n\times n} 精密矩阵 (即协方差矩阵 的逆矩阵),则
∫ − ∞ ∞ e ( − 1 2 ∑ i , j = 1 n A i j x i x j ) d n x = ∫ − ∞ ∞ e ( − 1 2 x T A x ) d n x = ( 2 π ) n det A = 1 det ( A / 2 π ) = det ( 2 π A − 1 ) {\displaystyle \int _{-\infty }^{\infty }e^{\left(-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}\right)}\,d^{n}x=\int _{-\infty }^{\infty }e^{\left(-{\frac {1}{2}}x^{T}Ax\right)}\,d^{n}x={\sqrt {\frac {(2\pi )^{n}}{\det A}}}={\sqrt {\frac {1}{\det(A/2\pi )}}}={\sqrt {\det(2\pi A^{-1})}}} 这里的积分是对R n 的。上式被用于研究多元正态分布 。
同样,
∫ x k 1 ⋯ x k 2 N e ( − 1 2 ∑ i , j = 1 n A i j x i x j ) d n x = ( 2 π ) n det A 1 2 N N ! ∑ σ ∈ S 2 N ( A − 1 ) k σ ( 1 ) k σ ( 2 ) ⋯ ( A − 1 ) k σ ( 2 N − 1 ) k σ ( 2 N ) {\displaystyle \int x^{k_{1}}\cdots x^{k_{2N}}\,e^{\left(-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}\right)}\,d^{n}x={\sqrt {\frac {(2\pi )^{n}}{\det A}}}\,{\frac {1}{2^{N}N!}}\,\sum _{\sigma \in S_{2N}}(A^{-1})_{k_{\sigma (1)}k_{\sigma (2)}}\cdots (A^{-1})_{k_{\sigma (2N-1)}k_{\sigma (2N)}}} 这里的 σ 表示的是有序集 {1, ..., 2N } 的不同排列 。等式右边的系数是对 N {\displaystyle N} 个重复的 A-1 的 {1, ..., 2N } 中所有的组合的求和(the sum over all combinatorial pairings of {1, ..., 2N } of N copies of A −1 )。[來源請求]
或者,
∫ f ( x → ) e ( − 1 2 ∑ i , j = 1 n A i j x i x j ) d n x = ( 2 π ) n det A e ( 1 2 ∑ i , j = 1 n ( A − 1 ) i j ∂ ∂ x i ∂ ∂ x j ) f ( x → ) | x → = 0 {\displaystyle \int f({\vec {x}})e^{\left(-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}\right)}d^{n}x={\sqrt {(2\pi )^{n} \over \det A}}\,\left.e^{\left({1 \over 2}\sum \limits _{i,j=1}^{n}(A^{-1})_{ij}{\partial \over \partial x_{i}}{\partial \over \partial x_{j}}\right)}f({\vec {x}})\right|_{{\vec {x}}=0}} 以上积分中的 f {\displaystyle f} 是解析函数 ,且函数值的增长必须满足某些边界条件以及另一些特定要求。微分算子的幂可以理解为幂级数 。
虽然泛函积分 没有严格的定义,但是我们仍然可以依照有限维的情况“定义”高斯泛函积分。[來源請求] 然而, ( 2 π ) ∞ {\displaystyle (2\pi )^{\infty }} 无穷大的问题依然存在,且大部分的泛函行列式 也是无穷大的。如果只考虑比例:
∫ f ( x 1 ) ⋯ f ( x 2 N ) e − ∬ 1 2 A ( x 2 N + 1 , x 2 N + 2 ) f ( x 2 N + 1 ) f ( x 2 N + 2 ) d d x 2 N + 1 d d x 2 N + 2 D f ∫ e − ∬ 1 2 A ( x 2 N + 1 , x 2 N + 2 ) f ( x 2 N + 1 ) f ( x 2 N + 2 ) d d x 2 N + 1 d d x 2 N + 2 D f = 1 2 N N ! ∑ σ ∈ S 2 N A − 1 ( x σ ( 1 ) , x σ ( 2 ) ) ⋯ A − 1 ( x σ ( 2 N − 1 ) , x σ ( 2 N ) ) . {\displaystyle {\frac {\int f(x_{1})\cdots f(x_{2N})e^{-\iint {\frac {1}{2}}A(x_{2N+1},x_{2N+2})f(x_{2N+1})f(x_{2N+2})d^{d}x_{2N+1}d^{d}x_{2N+2}}{\mathcal {D}}f}{\int e^{-\iint {\frac {1}{2}}A(x_{2N+1},x_{2N+2})f(x_{2N+1})f(x_{2N+2})d^{d}x_{2N+1}d^{d}x_{2N+2}}{\mathcal {D}}f}}={\frac {1}{2^{N}N!}}\sum _{\sigma \in S_{2N}}A^{-1}(x_{\sigma (1)},x_{\sigma (2)})\cdots A^{-1}(x_{\sigma (2N-1)},x_{\sigma (2N)}).} 则可以解决这个问题。在德维特标记法 下,此公式与有限维的情况一致。
带线性项的n维 如果A是一个对称的正定矩阵,则有(假设均为列向量)
∫ e − 1 2 ∑ i , j = 1 n A i j x i x j + ∑ i = 1 n B i x i d n x = ∫ e − 1 2 x → T A x → + B → T x → d n x = ( 2 π ) n det A e 1 2 B → T A − 1 B → . {\displaystyle \int e^{-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}+\sum \limits _{i=1}^{n}B_{i}x_{i}}d^{n}x=\int e^{-{\frac {1}{2}}{\vec {x}}^{T}\mathbf {A} {\vec {x}}+{\vec {B}}^{T}{\vec {x}}}d^{n}x={\sqrt {\frac {(2\pi )^{n}}{\det {A}}}}e^{{\frac {1}{2}}{\vec {B}}^{T}\mathbf {A} ^{-1}{\vec {B}}}.}
形式相似的积分 ∫ 0 ∞ x 2 n e − x 2 a 2 d x = π a 2 n + 1 ( 2 n − 1 ) ! ! 2 n + 1 {\displaystyle \int _{0}^{\infty }x^{2n}e^{-{\frac {x^{2}}{a^{2}}}}\,dx={\sqrt {\pi }}{\frac {a^{2n+1}(2n-1)!!}{2^{n+1}}}} ∫ 0 ∞ x 2 n + 1 e − x 2 a 2 d x = n ! 2 a 2 n + 2 {\displaystyle \int _{0}^{\infty }x^{2n+1}e^{-{\frac {x^{2}}{a^{2}}}}\,dx={\frac {n!}{2}}a^{2n+2}} ∫ 0 ∞ x 2 n e − a x 2 d x = ( 2 n − 1 ) ! ! a n 2 n + 1 π a {\displaystyle \int _{0}^{\infty }x^{2n}e^{-ax^{2}}\,dx={\frac {(2n-1)!!}{a^{n}2^{n+1}}}{\sqrt {\frac {\pi }{a}}}} ∫ 0 ∞ x 2 n + 1 e − a x 2 d x = n ! 2 a n + 1 {\displaystyle \int _{0}^{\infty }x^{2n+1}e^{-ax^{2}}\,dx={\frac {n!}{2a^{n+1}}}} ∫ 0 ∞ x n e − a x 2 d x = Γ ( n + 1 2 ) 2 a n + 1 2 {\displaystyle \int _{0}^{\infty }x^{n}e^{-ax^{2}}\,dx={\frac {\Gamma ({\frac {n+1}{2}})}{2a^{\frac {n+1}{2}}}}} 其中,n 为正整数,“!!”表示双阶乘 。这类积分的一种简单的计算方式是应用莱布尼兹积分规则 对参数进行微分:
∫ − ∞ ∞ x 2 n e − α x 2 d x = ( − 1 ) n ∫ − ∞ ∞ ∂ n ∂ α n e − α x 2 d x = ( − 1 ) n ∂ n ∂ α n ∫ − ∞ ∞ e − α x 2 d x = π ( − 1 ) n ∂ n ∂ α n α − 1 2 = π α ( 2 n − 1 ) ! ! ( 2 α ) n {\displaystyle {\begin{aligned}\int _{-\infty }^{\infty }x^{2n}e^{-\alpha x^{2}}\,dx&=\left(-1\right)^{n}\int _{-\infty }^{\infty }{\frac {\partial ^{n}}{\partial \alpha ^{n}}}e^{-\alpha x^{2}}\,dx~=\left(-1\right)^{n}{\frac {\partial ^{n}}{\partial \alpha ^{n}}}\int _{-\infty }^{\infty }e^{-\alpha x^{2}}\,dx\\&={\sqrt {\pi }}\left(-1\right)^{n}{\frac {\partial ^{n}}{\partial \alpha ^{n}}}\alpha ^{-{\frac {1}{2}}}~={\sqrt {\frac {\pi }{\alpha }}}{\frac {(2n-1)!!}{\left(2\alpha \right)^{n}}}\end{aligned}}} 也可以先分部积分 ,然后找出递推关系 之后求解。
另见
参考资料 埃里克·韦斯坦因 . Gaussian Integral . MathWorld . Griffiths, David. Introduction to Quantum Mechanics 2nd. Abramowitz, M.; Stegun, I. A. Handbook of Mathematical Functions. New York: Dover Publications.