Probability of Y, where $Y=X^2$ and $X \sim U[-1, 1]$ I'm trying to prove that if $X \sim U[-1, 1]$ and $Y = X^2$ then $p_Y(y)=\frac{1}{2} y^{-\frac{1}{2}}$, using the change of variables theorem.
The theorem states one can show that $p_Y(y) = \frac{dx}{dy} p_X(x)$.
Given the problem above, I find that $p_X(x) = \frac{1}{b-a} = \frac{1}{2}$. And that $\frac{dx}{dy} = \frac{d}{dy}\sqrt{y} = \frac{1}{2}y^{-\frac{1}{2}}$.
Therefore,
$$ p_Y(y) = \frac{dx}{dy}p_X(x) = \frac{1}{4}y^{-\frac{1}{2}} $$
But I know that it's not true, since $p_Y(y) = \frac{1}{2}y^{-\frac{1}{2}}$. So
where is the problem?

\begin{align}
F_Y(y) = P( Y \le y) = P(X^2 \le y) = P( - \sqrt{y} \le X \le \sqrt{y}) = \frac{\sqrt y + 1}{2} - \frac{-\sqrt y + 1}{2} = \sqrt y,
\end{align}
thus
$$
f_Y(y) = \frac{\partial }{\partial y}F_Y(y) = \frac{1}{2}y^ {-1/2}
$$
Namely, your formula works only for one-to-one functions. In this case, using the transformation formula is equivalent to considering only the positive side, i.e.,
$
P(X\le \sqrt y)
$, that gives you the $1/4$ instead of $1/2$ when you deriving the density function.
