Modify from this problem, if I have:
$X$ has a uniform distribution with PDF $f(x) = 1/2$, $x \in [0, 2]$, zero elsewhere.
Find the PDF of $Y = X^2 - 6X$, with $y\geq -9$.
---------------------------------------------------------------------------------
How do I do substitution between $X$ and $Y$ in this case? Thanks.
$P(Y\leq y)=P(X^2-6X\leq y)=P(X^2-6X-y\leq 0)$. Now the term on the left is an upward opening parabola. It is negative in between any possible roots. Looking at the roots, by quadratic formula,
$x^2-6x-y=0\implies x=\frac{6\pm\sqrt{36+4y}}{2}$. Real roots occur when $36+4y\geq 0$ or $y\geq -9$. Hence, based on your assusmptions, you can assume real roots always occur. There is a double root at $y=-9$ and two real roots when $y>-9$.
Going back to the original problem, $P(X^2-6-y\leq 0)=P(\frac{6-\sqrt{36+4y}}{2}\leq X\leq \frac{6+\sqrt{36+4y}}{2}).$
From here, you should be to solve this. Then just differentiate to get the PDF.