Variance of a squared random variable with nonzero mean

probabilityrandom variablesstatisticsvariance

I am trying to compute $V(X^2)$, with $X$ being a random variable with variance $\sigma^2$ and mean $\mu$.

Generally, based on what I red here you can use:
\begin{equation}
V(X^2) = \mathbb{E}(X^4) – \sigma^4 – \mu^4 – 2\sigma^2\mu^2
\end{equation}

Of which all terms seems pretty straightforward, except for $\mathbb{E}(X^4)$. Assuming a normal distribution (which is an acceptable approximation in my case), this term becomes:
\begin{equation}
\mathbb{E}[X^4] = \int_{-\infty}^\infty X^4 f(X) \, \mathrm{d}x
= \frac{1}{\sqrt{2 \pi \sigma^2}} \int_{-\infty}^\infty X^4 \mathrm{e}^{-\frac{(X-\mu)^2}{2\sigma^2}} \, \mathrm{d}X.
\end{equation}

If I conveniently change my variables so that $Y=X-\mu$, with jacobian 1, I can borrow the integration by part trick from one of the answer and get
\begin{equation}
\mathbb{E}[Y^4]=\int_{-\infty}^\infty Y^4 \mathrm{e}^{-\frac{Y^2}{2\sigma^2}} \, \mathrm{d}Y.
\end{equation}

by part
\begin{equation}
\mathbb{E}[Y^4] =\frac{3\sigma^2}{\sqrt{2 \pi \sigma^2}} \int_{-\infty}^\infty Y^2 \mathrm{e}^{-\frac{Y^2}{2\sigma^2}} \, \mathrm{d}Y
=3\sigma^4
\end{equation}

so that I am left with
\begin{equation}
V(X^2) = 2\sigma^4 – \mu^4 – 2\sigma^2\mu^2
\end{equation}

Which does not match my data. Moreover, this expression does not make a lot of sense because the only terms containing $\mu$ are negative: if you have a variable with a large $\mu$ and small $\sigma$ this expression would lead to negative values in the variance.

Evidently, I misunderstood something.
Don't hesitate to ask in case you need clarifications.

Best Answer

$Var(X^2) = E(X^4)-E(X^2)^2$

Let $Y = X-\mu.$

$E(X^4) = E((Y+\mu)^4) = E(Y^4)+6\mu^2E(Y^2)+\mu^4 = 3\sigma^4+6\mu^2\sigma^2+\mu^4$

$E(X^2) = E((Y+\mu)^2) = E(Y^2)+\mu^2 = \sigma^2+\mu^2$

$E(X^2)^2 = \sigma^4+2\mu^2\sigma^2+\mu^4$

$Var(X^2) = 2\sigma^4+4\mu^2\sigma^2$