Suppose we have $\bar{x}$ $\sim$ $N(\mu, 1/n)$, its pdf then is $f(\bar{x}) = \sqrt{\frac{n}{2\pi}}e^{-n(\bar{x}-\mu)^2/2}$
Let $T = (\bar{x})^2$, we want to calculate its pdf.
My first thought is:
$P(T \le t) = P(\bar{x}^2 \le t) = P(-\sqrt{t} \le \bar{x} \le \sqrt{t}) = \Phi(\sqrt{t}) - \Phi(-\sqrt{t}) = 2\Phi(\sqrt{t}) -1 $
where $t \ge 0$
Therefore, its pdf is:
$f(t) = \frac{1}{\sqrt{t}}\sqrt{\frac{n}{2\pi}}e^{-n(\sqrt{t}-\mu)^2/2}$
However, if I use calculator, the integral is not equal to 1.
The correct pdf should be:
$f(t) = \frac{1}{2\sqrt{t}}\sqrt{\frac{n}{2\pi}}(e^{-n(\sqrt{t}-\mu)^2/2} + e^{-n(-\sqrt{t}-\mu)^2/2})$
This integral is 1.
Any thoughts how to get the correct pdf?