integrate moments normal distribution between finite limits

226 Views Asked by At

Can somebody help me to evaluate the following integral: $$\frac{1}{\sqrt{2\pi}\sigma}\int_a^b x^2 \exp\left(\frac{-x^2}{2\sigma^2}\right)\mathrm dx$$

Answer involving cumulative normal (erf) would be perfectly acceptable.

1

There are 1 best solutions below

0
On

The change of variable $x=t\sigma\sqrt2$ shows that the integral $I$ to be computed is $$ I=\frac{\sigma^2}{\sqrt\pi}J\left(\frac{a}{\sigma\sqrt2},\frac{b}{\sigma\sqrt2}\right),\qquad J(x,y)=\int_x^y2t^2\mathrm e^{-t^2}\mathrm dt. $$ By an integration by parts using the functions $u(t)=-t$ and $v(t)=\mathrm e^{-t^2}$, $$ J(x,y)=\left.-t\mathrm e^{-t^2}\right|_x^y+\int_x^y\mathrm e^{-t^2}\mathrm dt=x\mathrm e^{-x^2}-y\mathrm e^{-y^2}+\frac12\sqrt{\pi}(\mathrm{erf}(y)-\mathrm{erf}(x)). $$ Thus, the value of the integral to be computed is $$ I=\frac{\sigma}{\sqrt{2\pi}}\left(a\mathrm e^{-a^2/(2\sigma^2)}-b\mathrm e^{-b^2/(2\sigma^2)}\right)+\frac12\sigma^2\left(\mathrm{erf}\left(\frac{b}{\sigma\sqrt2}\right)-\mathrm{erf}\left(\frac{a}{\sigma\sqrt2}\right)\right). $$