How to solve integral over $z^2 e^{-z^2/2}$

209 Views Asked by At

I want to solve the following integral $$\int_0^{\infty} x^2 \cdot N(x;\mu_x, \sigma^2_x) dx$$.

How far I've come with my knowledge

First I standardized the distribution with $z=\frac{x-\mu}{\sigma}$. This gives me: $$\frac{1}{\sqrt{2\pi}}\int_{-\mu/\sigma}^{\infty}(\sigma z+\mu)^2e^{-z^2/2}dz$$.

Then i multiplied out the equation and split it into three integrals.

$$\frac{\sigma^2}{\sqrt{2\pi}}\int_{-\mu/\sigma}^{\infty}z^2 e^{-z^2/2}dz+ \frac{2\sigma\mu}{\sqrt{2\pi}}\int_{-\mu/\sigma}^{\infty}z e^{-z^2/2}dz + \mu^2\int_{-\mu/\sigma}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-z^2/2}dz$$.

Knowing that $\int xe^{-cx^2}dx = -\frac{1}{2c}e^{-cx^2}$, the second integral can be solved:

$$\frac{2\sigma\mu}{\sqrt{2\pi}} \cdot e^{-\frac{\mu^2}{2\sigma^2}}$$.

The third integral can be solved by using the cummulative distribution and thus gives: $$\mu^2 \cdot \Phi(\frac{\mu}{\sigma})$$.

First of all - are my calculations correct so far? If yes, how to solve the first integral and simplify the total equation? Is there a antiderivative of the term in order to solve it directly?

Thanks!

EDIT - Idea

Including $\frac{1}{\sqrt{2\pi}}$ into to first integral gives

$$\sigma^2\int_{-\mu/\sigma}^{\infty}z^2 \frac{1}{\sqrt{2\pi}}e^{-z^2/2}dz$$. Then it can be exploited that $\Phi(x) - x\phi(x) +C$ is the indefinite integral of $\int x^2\phi(x)$. Inserting the upper and lower bound of the integral gives $$\sigma^2\left(\left[1 - \infty\cdot\phi(\infty) - \left(\Phi\left(-\frac{\mu}{\sigma}\right) +\frac{\mu}{\sigma} \cdot \phi(\frac{-\mu}{\sigma})\right)\right]\right) = \sigma^2\left(\left[1 - 0 - \left(1-\Phi\left(\frac{\mu}{\sigma}\right) +\frac{\mu}{\sigma} \cdot \phi(\frac{-\mu}{\sigma})\right)\right]\right) = \sigma^2 \Phi(\mu/\sigma) - \sigma\mu \phi(-\mu/\sigma)$$

1

There are 1 best solutions below

6
On

Integration by Parts is essentially the reverse of the product rule:

$$\frac{d}{dx}(UV) = U \frac{dV}{dx} + V \frac{dU}{dx}$$ so $$\int_a^b\frac{d}{dx}(UV) dx = \int_a^b U \frac{dV}{dx} dx + \int_a^b V \frac{dU}{dx} dx$$ or $$UV|_a^b = \int_a^b U dV + \int_a^b V dU$$ giving finally the rule: $$\int_a^b U dV = UV|_a^b - \int_a^b V dU$$

To use the rule, you take your integral and factor it into your $U$ piece and your $dV$ piece. You choose them so that a) you know how to integrate the $dV$, b) you can differentiate the $U$, and you expect the product $VdU$ to be easier to integrate than $UdV$. If you have a polynomial times something else, very often (not always) the polynomial is a good choice for $U$. Looking at your integral, if you want to integrate $e^{-z^2/2}$ you will want to grab a factor of $z$ from the $U$ part to make a better choice. So $U = z$ and $dV = ze^{-z^2/2}$ would be a good starting point.