<s>[INST] Finding the pdf of $Y=X^2-X$ given that the pdf of $X$ is $f_X(x) = 3x^2I_{(0,1)}(x)$ 
Consider a random variable $X$ having pdf 
$$f_X(x) = 3x^2I_{(0,1)}(x)$$
Give the pdf of $Y=X^2−X$ and the value of $E(Y)$.

I have from an inverse calculator that if $Y=X^2−X$ then $X = {1\over2}(1\pm \sqrt{4Y+1})$. We have,
$F_Y(y)=P(Y\leq y)$
$=P(X^2-X\leq y)$
$=P(X\leq{1\over2}(1\pm \sqrt{4Y+1}))$
$=P(({1\over2}(1- \sqrt{4Y+1}) \leq X \leq {1\over2}(1 + \sqrt{4Y+1}))$.
$=F_X({1\over2}(1 + \sqrt{4Y+1}))$ $-$ $F_X({1\over2}(1- \sqrt{4Y+1})$
$=\frac{1}{8}\left(\sqrt{4y+1}-1\right)^3+\frac{1}{8}\left(\sqrt{4y+1}+1\right)^3$
I do not think I am doing this correctly. Based on other similar problems that I am looking at, this was much more tedious in comparison, and so I think I might have made an error. I am new to these kind of problems, so any help would be much appreciated. 
 [/INST] Sketch the graph $Y=X^2-X$, one can see that
$$0 \ge Y \ge -\frac{1}{4}$$
and there are two values of $X$ corresponding to each $Y$, except for $Y=-\frac{1}{4}$.
By transformation method formula
$$f_Y(y)=f_X(x_1)\bigg|\frac{dx_1}{dy}\bigg|+f_X(x_2)\bigg|\frac{dx_2}{dy}\bigg|$$
$$=\frac{3}{8}(1-\sqrt{4y+1})^2\bigg|\frac{d}{dy}(1-\sqrt{4y+1})\bigg|+\frac{3}{8}(1+\sqrt{4y+1})^2\bigg|\frac{d}{dy}(1+\sqrt{4y+1})\bigg|$$
$$=\frac{3}{8}(2+4y-2\sqrt{4y+1})\frac{2}{\sqrt{4y+1}}+\frac{3}{8}(2+4y+2\sqrt{4y+1})\frac{2}{\sqrt{4y+1}}$$
$$=3\frac{1+2y}{\sqrt{1+4y}}$$
</s>