Find the probability density function of the random variable y=y(x)=x^2, x with known probability density function,
$f(x) = \begin{cases} 0 &\quad\text{if} \; \infty \lt x \lt -1 \\ \frac{1}{2} &\quad\text{if} \; -1 \le x \lt 0 \\ \frac{1}{2}e^{-x} &\quad\text{if} \; 0 \le x \lt \infty \\ \end{cases}$
I want to use the theorem that says $g(y)=\lvert \frac{dx}{dy} \rvert f(x)$ but since y=x^2 is not bijective I don't know how to proceed. I know that I have to work with $x=-\sqrt{y}$ separately from $x=\sqrt{y}$ but don't know in wich way. Any other method to solve this is fine. Thanks
We can write $f_X$ as a mixture, namely $f_X(x) = f_{X_1}(x) + f_{X_2}(x)$, where $f_{X_1}(x) = \frac{1}{2} \mathbb 1(-1 \le x < 0)$ and $f_{X_2}(x) = \frac{1}{2}e^{-x} \mathbb 1 (x \ge 0)$. Then the transformed density is $$\begin{align} f_Y(y) &= \frac{1}{2\sqrt{y}}\left( f_{X_1}(-\sqrt{y}) + f_{X_2}(\sqrt{y})\right) \\ &= \frac{1}{2\sqrt{y}} \left( \frac{1}{2} \mathbb 1 (0 < y \le 1) + \frac{1}{2} e^{-\sqrt{y}} \mathbb 1 (y \ge 0) \right) \\ &= \frac{1}{4 \sqrt{y}} \begin{cases} 1 + e^{-\sqrt{y}} , & 0 \le y \le 1 \\ e^{-\sqrt{y}}, & 1 < y < \infty. \end{cases} \end{align}$$ This approach works because $f_X$ is a mixture of two densities for which the transformation $Y = X^2$ is monotone on their individual supports.