Let $X\sim N(0,1)$, i want to determine the distribution of $Y=X^2$.
By definition, the density of $X$ is $f_X(x)=\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{1}{2\sigma^2}(x-\mu)^2},\forall x\in \mathbb{R}$. I also know that i can't apply the law of transformation of random variables because $Y$ is not a monotonic function. So, i write:
$F_Y (y)=\mathbb{P}(Y\leq y)=\mathbb{P}(X^2\leq y)=\mathbb{P}(X\leq \pm \sqrt{y})=\mathbb{P}(-\sqrt{y}\leq X \leq\sqrt{y})$
Then, i observe that if $X\sim N(0,1)$ can be applied the following equivalences:
1) $\mathbb{P}(-\sqrt{y}\leq X\leq \sqrt{y})=\mathbb{P}(-\sqrt{y}\leq X \leq0)+\mathbb{P}(0\leq X\leq \sqrt{y})$
2) $\mathbb{P}(-\sqrt{y}\leq X \leq0)=\mathbb{P}(0\leq X\leq \sqrt{y})$
So, i can write that
$\mathbb{P}(-\sqrt{y}\leq X\leq \sqrt{y})=2\mathbb{P}(0\leq X\leq \sqrt{y})=2[\mathbb{P}(X\leq \sqrt{y})-\mathbb{P}(X\leq 0)]=2[F_X(\sqrt{y})-F_X(0)]=2[\Phi (\sqrt{y})-\Phi (0)]=2\Phi (\sqrt{y})-2\Phi (0)=2\Phi (\sqrt{y})-2(0,5)=2\Phi (\sqrt{y})-1$
On this way, i have to find the density of $Y$:
$f_Y(y)=\frac{d}{dy}F_Y(y)=\frac{d}{dy}(2\Phi (\sqrt{y})-1)$
but now i'm stuck. My book is not quite clear on this point so much so that it has to go straight to the solution, that is $f_Y(y)=\frac{1}{\sqrt{2\pi y}}e^{-\frac{1}{2}y}\Rightarrow Y\sim \chi ^2_1 $.
The demonstration is correct? How can calculate that derivative? Why $\chi ^2$ has $1$ degree of freedom?
Thanks for any help!
Use the chain rule. Let $\phi$ be the density of a standard normal. Then we have that $$ \Phi'=\phi $$ and so $$ \frac{d}{dy}(2\Phi (\sqrt{y})-1)=2\phi(\sqrt y)\times \frac{1}{2\sqrt y}=\frac{1}{\sqrt{2\pi y}}e^{-y/2} $$