Calculating the third non-central moment of the normal distribution

normal distribution

I have some difficulties in understanding how the third non-central moment of the normal distribution is calculated (see picture). I got two questions:

  1. Number I in the picture: What is the mathematical rule allowing me to do this transformation? I am probably missing something here as I can't figure out how I get to the line the red arrow is pointing to.
  2. Number II in the picture: How can I immediately recognise the integral is equal to zero? Is it because it's an uneven function?

Picture of the calculations & the questions I have

$$\begin{align}
X &\sim \operatorname{Normal}(\mu, \sigma^2) \\
\operatorname{E}[X^3]
&= \int_{x=-\infty}^\infty x^3 \frac{1}{\sqrt{2\pi} \sigma} e^{-\frac{1}{2} (\frac{x-\mu}{\sigma})^2} \, dx \\
&= \int_{y=-\infty}^\infty \frac{(\sigma y + \mu)^3}{\sqrt{2\pi} \sigma} e^{-\frac{1}{2} y^2} \sigma \, dy \\
&= \frac{1}{\sqrt{2\pi}} \int_{y=-\infty}^\infty (\sigma^3 y^3 + 3 \mu \sigma^2 y^2 + 3 \mu^2 \sigma y + \mu^3 ) e^{-\frac{1}{2}y^2} \, dy \\
&= \frac{\sigma^3}{\sqrt{2\pi}} \int_{y=-\infty}^\infty \underset{= y^2 \cdot y e^{-\frac{1}{2} y^2}}{\underbrace{y^3 e^{-\frac{1}{2} y^2}}} \, dy + 3 \mu \sigma^2 \cdot 1 + 3 \mu^2 \sigma \cdot 0 + \mu^3 \cdot 1 \tag{I} \\
&= \frac{\sigma^3}{\sqrt{2\pi}} \left[ \underset{ = 0}{\underbrace{\left. -y^2 e^{-\frac{1}{2}y^2} \right|_{y=-\infty}^\infty}} + 2 \underset{=0}{\underbrace{\int_{y=-\infty}^\infty ye^{-\frac{1}{2}y^2} \, dy }} \right] + 3\mu \sigma^2 + \mu^3 \tag{II}
\end{align}$$

Best Answer

Both steps utilize the property that the family of functions

$$f(z;n) = z^n e^{-z^2/2}, \quad n \in \{0, 1, 2, \ldots \}$$

has the property that when $n$ is even,

$$f(-z;n) = f(z;n)$$

and when $n$ is odd,

$$f(-z;n) = -f(z;n).$$ That is to say, $f$ is an even function when $n$ is even, and $f$ is an odd function when $n$ is odd. In particular, when $n$ is odd and the Riemann integral is well-defined,

$$\begin{align} \int_{z=-\infty}^\infty f(z;n) \, dz &= \int_{z=-\infty}^0 f(z;n) \, dz + \int_{z=0}^\infty f(z;n) \, dz \\ &= \int_{z=-\infty}^0 -f(-z;n) \, dz + \int_{z=0}^\infty f(z;n) \, dz \\ &= -\int_{z=0}^\infty f(z;n) \, dz + \int_{z=0}^\infty f(z;n) \, dz \\ &= 0. \end{align}$$

So this is what justifies the claim that $$\int_{y=-\infty}^\infty y^n e^{-\frac{1}{2}y^2} \, dy = 0$$ for each odd integer $n$.

It is not so clear why $$\int_{y=-\infty}^\infty y^2 e^{-\frac{1}{2} y^2} \, dy = \sqrt{2\pi},$$ as suggested by (I). This is not a difficult calculation; e.g., integration by parts with the choice $$u = y, \quad du = \, dy, \\ dv = y e^{-y^2/2} \, dy, \quad v = -e^{-y^2/2}$$ yields

$$\int_{y=-\infty}^\infty y^2 e^{-y^2/2} \, dy = \left[-y e^{-y^2/2} \right]_{y=-\infty}^\infty + \int_{y=-\infty}^\infty e^{-y^2/2} \, dy.$$ Since the first term is $0$, and the remaining integral term may be written as $$\sqrt{2\pi} \int_{y=-\infty}^\infty \frac{1}{\sqrt{2\pi}} e^{-y^2/2} \, dy,$$ which is the integral of a standard normal density over its support, the result follows.

As for Step (II), this is unnecessary once we have established that $y^3 e^{-y^2/2}$ is an odd function. The integration by parts is redundant.