# Calculating $X^2$ of a Maxwell-distributed RV

I'm trying to calculate $X^2$, where $X$ is a Maxwell-distributed RV; which means it has the density function $\phi$ with

$$\phi(x) = \frac{2}{d^3 \sqrt{2\pi}} x^2 \exp\left(- \frac{x^2}{2d^2}\right) \text{ for } x \ge 0.$$

In the lecture we proved that the density function $\psi$ of $X^2$ can be calculated via the following formula:

$$\psi(x) = \frac{\phi(\sqrt{x}) + \phi(-\sqrt{x})}{2\sqrt{x}} \text{ for } x \ge 0$$

But when I apply this formula I get:

\begin{align} \psi(x) & = \frac{\phi(\sqrt{x}) + \phi(-\sqrt{x})}{2\sqrt{x}} \\[10pt] & = \frac{\frac{2}{d^3\sqrt{2\pi}} (\sqrt{x})^2 \exp\left(- \frac{(\sqrt x)^2}{2d^2} \right) + \frac{2}{d^3\sqrt{2\pi}} (-\sqrt{x})^2 \exp\left(- \frac{(-\sqrt{x})^2}{2d^2}\right)}{2\sqrt{x}} \\[10pt] & = \frac{\frac{4}{d^3 \sqrt{2\pi}} x \exp\left(- \frac{x}{2d^2}\right)}{2\sqrt{x}} \\[10pt] & = \frac{2}{d^3 \sqrt{2\pi}} \sqrt{x} \exp\left(- \frac{x}{2d^2}\right) \end{align}

But according to the solution I should get:

$$\frac 1 {d^3 \sqrt{2\pi}} \sqrt{x} \exp\left(- \frac{x}{2d^2}\right)$$

Could you tell me what I'm doing wrong?

• In this case $\varphi(-\sqrt x)$ is $0.$ That's the mistake. – Michael Hardy Apr 7 '18 at 19:05
• You said $\varphi(x) = \text{something, when } x\ge 0.$ But then you apply that formula when the argument is not $\ge0. \qquad$ – Michael Hardy Apr 7 '18 at 19:06
• Many thanks to both of you, I got it now. – 3nondatur Apr 8 '18 at 17:21

## 1 Answer

When the distribution of $X$ has support $X \ge 0$, the transformation $Y = X^2$ is already one-to-one, thus we can simply write $$f_Y(y) = \frac{f_X(\sqrt{y})}{2\sqrt{y}}, \quad y > 0.$$ That is why you have an extra factor of $2$: you have presumed that $X$ has negative support when it does not.