Law of $Y=X(2-X)$ Let $X$ a random variable with density $f_X(x)=\frac{1}{2}x,x\in [0,k]$. For it to be a density $k=2$. Now I have to find the cdf of $Y=X(2-X)$. To apply $f_Y(y)=f_X(x)|\frac{dy}{dx}|$ with $|\frac{dy}{dx}|=2-2x$ I have to find the transformation of $Y$, and I obtain $x=\pm \sqrt{2x-y}$. I consider only the positive solution because $x>0$, but remains $x$ under the square root. What is the inverse transformation of $Y$?
 A: Let $X$ be a random variable with density function $f_X(x) = \frac{1}{2}x\cdot 1_{(0,2)}(x)$.
Let $Y=X(2-X) = 2X-X^2$. Note that when $X \in (0,2)$, then $Y \in (0,1)$. Knowing that, we can find the CDF of $Y$. We calculate for $t \in (0,1)$ for which $X$ holds $2X-X^2 \le t$. Delta of $-X^2 + 2X - t =0$ is given by $4(1-t)$, so that $-X^2 + 2X \le t$ if and only if $X \in (0,1 - \sqrt{1-t}) \cup (1 + \sqrt{1-t},2)$. So that the CDF of $Y$ is given by:
$$ F_Y(t) = \begin{cases} 0 & t \le 0 \\ \mathbb P(X \in (0,1-\sqrt{1-t})) + \mathbb P(X \in (1+\sqrt{1-t},2)) & t \in (0,1) \\ 1 & t \ge 1 \end{cases} $$
Which can be calculated, since u know the density of $X$.
We get:
$\mathbb P(X \in (0,1-\sqrt{1-t})) = \frac{1}{4}(1-\sqrt{1-t})^2$
$ \mathbb P(X \in (1+\sqrt{1+t},2)) = \frac{1}{4}(4 - (1+\sqrt{1+t})^2)$
So that for $t \in (0,1)$ we get:
$$ F_Y(t) = 1 + \frac{1}{4}(1 - 2\sqrt{1-t} + (1-t)) - \frac{1}{4}(1+2\sqrt{1-t} + (1-t))= 1 - \sqrt{1-t} $$
It can be done by finding the density of $Y$ via transformation $\phi: \mathbb R \to \mathbb R$ given by $\phi(x) = x(2-x)$, however it isn't that easy, since it isn't incjective, and you have to split the domain of $X$ (that is split $(0,2)$) into two pieces, on which $\phi$ is injective. A good choice might be $(0,1)$ and $(1,2)$ (you can forget about point $x=1$, since it's of $\mu_X$ measure $0$).
