Question: Let $X$ be continuous random variable with pdf $f(x)=\frac{2}{9}(x+1)$ for $-1<x<2$. Determine the pdf of $Y=X^2$. Now do the same with $-2<x<1$
The solution says:
Observe that $Y=X^2$ has support in $(0,4)$. We divide the problem into two cases. If $y\in (0,1]$ we have that $\{Y\leq y\}=\{-\sqrt{y}\leq X \leq \sqrt{y}\}$
Therefore, the CDF in this case is equal to
$$F_{y}(y) = \int_{-\sqrt{y}}^{\sqrt{y}} \frac{2}{9}(x+1) dx$$
On the other hand, if $y\in (1,4)$, we have that
$\{Y\leq y\}=\{-1\leq X \leq \sqrt{y}\}$. Therefore the CDF in this case is equal to
$$F_{y}(y) = \int_{-1}^{\sqrt{y}} \frac{2}{9}(x+1) dx$$
Then they take the derivative to get the pdf. I'm mainly confused about the first case when $0<y<1$
I don't really understand this. If $-1<x<2$ then $1<X^2=Y<4$.
I guess the only thing I'm thinking is that if $X=0$ then obviously $X^2=Y=0$ but that is not included in the interval (1,4). Even still, I don't understand how they get the bounds $-sqrt{y} \leq X \leq \sqrt{y}$
Similarly, for the interval $-2<x<1$ should I split it up into two cases as well? When $y\in (0,1]$ and $y \in (1,4)$. so when $y in (1,4) then
$$F_y (y) = \int_{-2}^{\sqrt{y}} \frac{2}{9}(x+2) dx$$
and when $y\in (0,1]$ then
$$F_y (y) = \int_{-\sqrt{y}}^{\sqrt{y}} \frac{2}{9}(x+2) dx$$
If $f_X(x) = \frac29(x+1)\cdot\mathsf 1_{(-1,2)}(x)$ then $Y=X^2$ takes values in $(0,4)$. For $0<y<1$ we have \begin{align} \mathbb P(Y\leqslant y) &= \mathbb P(X^2\leqslant y)\\ &= \mathbb P(X\leqslant \sqrt y)\\ &= \int_{(-\sqrt y,\sqrt y)} f_X(x)\ \mathsf dx\\ &= \int_{-\sqrt y}^\sqrt y \frac29(x+1)\ \mathsf dx\\ &= \frac49\sqrt y, \end{align} and for $1<y<4$ we have $$ \mathbb P(Y\leqslant y) = \int_{-1}^{\sqrt y} \frac29 (x+1)\ \mathsf dx = \frac 19(1+\sqrt y)^2. $$ The map $x\mapsto \frac29(x+1)$ does not integrate to one over $(-2,1)$, so the second part of the question doesn't make sense.