determine $f_Y$ given $f_X$, cdf then pdf or inverse function? I have this problem to determine a density function $f_{Y}(y)$ of $Y$ given $X$ as a random variable with uniform distribution on $[−1, 1]$ and $Y = X^2$. So: $f_X(x) = \frac{1}{2}$ for $x \in [-1, 1]$. I approached this problem with two different ways, 1) through determining first the $F_Y$ as the $CDF$, then derive from it $PDF$ 2) by transformation.
For the first method I got $f_Y(y) =  \frac{1}{2\sqrt(y)}$ for $y \in ]0, 1]$ This seems correct. However, for transformation method, I tried the following:
$g(x) = x^2$ and $g'(x) = 2x$
$x_1 = g^{-1}(y) = \sqrt(y)$
so $f_Y(y) = \frac{f_X(x_1)}{|g'(x_1)|} = \frac{1/2}{2\sqrt(y)} = \frac{1}{4\sqrt(y)}$
 A: Let $Z=X^2$, $z \geq 0$, $$P(Z \leq z) = P(X^2 \leq z) = P(X \leq \sqrt{z}, -X \leq \sqrt{z})$$ $$= P(X \leq \sqrt{z}, X \geq -\sqrt{z}) = F_X(\sqrt{z})-F_X(-\sqrt{z})$$
$$f_Z(z) = \frac{\partial P(Z \leq z)}{\partial z} = \frac{f_X(\sqrt{z})+f_X(-\sqrt{z})}{2\sqrt{z}}$$
If you derive the density of $Z$ directly using density of $X$, then u will get the same answer where $\frac{1}{2\sqrt{z}}$ is the jacobian.
For $Z = g(X)$ with $g^{-1}$ continuously differentiable and $g$ is continuous, the density:
$$f_Z(z) dz = P(Z \in [z,z+dz]) = P(X \in g^{-1}([z,z+dz]))$$ $$= \sum f_X(g^{-1}(z)) \times length(g^{-1}([z,z+dz]) = \sum_{x_i \in g^{-1}(z)} f_X(x_i) |\frac{\partial{g_i^{-1}(z)}}{\partial z}| dz$$
Where $g_i^{-1} = g|_{S_i}^{-1}, S_i = [x_i,x_i+\epsilon)$.
The last step in the above derivation uses the mean value theorem and continuous differentiability of $g^{-1}(z)$.
Now directly deriving the density, using above formula:
$$f_Z(z) = (f_X(\sqrt{z})+f_X(-\sqrt{z})) |\frac{\partial \sqrt{z}}{\partial z}| =  (f_X(\sqrt{z})+f_X(-\sqrt{z})) |\frac{1}{2\sqrt{z}}|$$.
So both gives the same answer.
