[Math] A question about second moment of gaussian

conditional-expectationprobabilityprobability theory

Let $b \in \mathbb{R}$ and $X \sim \mathcal{N}(\mu,\sigma^2)$ be a Gaussian distribution with mean $\mu$ and variance $\sigma^2$. I am trying to evaluate
$$
\mathbb{E}(X^2 I(X \geq b)),
$$
where $I(X \geq b)$ is the indicator random variable which equals $1$ whenever the event $\{X \geq b\}$ happens. Is there any closed form expression for the above quantity in terms of some known functions?

My attempt: For simplicity I took $\mu=0,\sigma^2=1$ and thus
$$
\mathbb{E}(X^2 I(X \geq b)) = \frac{1}{\sqrt{2 \pi}} \int_{b}^\infty x^2e^{\frac{-x^2}{2}} dx.
$$
Since we don't have any closed form expressions for the integral I took the expansion of $e^{-\frac{x^2}{2}}$ and integrated term by term but this is not yielding any useful information.

Best Answer

By parts,

$$\int_{b}^\infty x^2e^{-x^2/2} dx=-\left.xe^{-x^2/2}\right|_b^\infty+\int_{b}^\infty e^{-x^2/2}dx,$$ so that

$$\mathbb{E}(X^2 I(X \geq b))=\frac{be^{-b^2/2}}{\sqrt{2\pi}}+\mathbb{E}(I(X \geq b)).$$

The term on the right is the complimentary of the Gaussian cdf, i.e. the error function.

Related Question