The Question that I need to solve is:
Let $X\sim~\text{Unif}[-1,2]$. Find the probability density function of the random variable $Y = X^2$.
Now I have solved it as follows, but the steps I have to take after that are unclear to me. I need to find some kind of range and take 'certain?' steps, and I just do not know how big of steps I have to take or what is most logical.
$F_Y(y) = P(Y \leq y) = P(X^2\leq y) = P(\sqrt y \leq x \leq \sqrt -y) = F_X(\sqrt y) - F_X(\sqrt-y) $
Now you take derivative and you get
$f_y(y) = \frac{1}{2 \sqrt y} f_X(\sqrt y) + \frac{1}{2 \sqrt y} f_X(\sqrt -y) $.
So, I made a drawing of the uniform distribution and because of $Y=X^2$ it goes from $[0,2]$. I know that for $y < 0, f_Y(y) = 0.$ But what do I need to do next? How do I know how much steps I need to take (in this case two more, but why?) and how big must those steps be? Which ranges are important? How do I find those?
We have that $X \in [-1, 2]$.
Consider the graph $Y = X^2$. This is not a one-to-one function. (Observe that for $X \in [-1, 1]$ that there are two $X$ values that yield the same $Y$ value.)
Now, by definition, for each $y \in \mathbb{R}$, $$F_{Y}(y) = \mathbb{P}(Y \leq y) = \mathbb{P}(X^2 \leq y)\text{.}$$ Partition the values of $Y$ into the following:
Hence, the density is given by the derivative of $F_Y$, or $$f_{Y}(y) = \begin{cases} \dfrac{1}{3\sqrt{y}}, & 0 \leq y \leq 1 \\ \dfrac{1}{6\sqrt{y}}, & 1 < y \leq 4 \\ 0, & \text{otherwise.} \end{cases}$$