Computation of density function of $Y=\frac1X-X$ where $X\stackrel{\mathrm d}= U[0,1]$ 
Calculate the density function of $Y=\frac1X-X$, where $X\stackrel{\mathrm d}= U[0,1]$.

I am confused about the technique to deal with the problem like this when after the transformation, I can not express the density of $Y$ in terms of $X$

$1/X-X$ is a decreasing function of $X$ so $Y\in(0,\infty)$ for $X\in(0,1)$.
$$P(Y\le y)=\begin{cases}0,&y\le0\\P(1-X^2\le yX),&y>0\end{cases}$$
Now $X^2+yX-1$ is an upward opening parabola with zeroes at  $\frac{-y\pm\sqrt{y^2+4}}2$, and thus $$\begin{align*}P(X^2+yX-1\ge0)&=\underbrace{P\left(X\le\frac{-y-\sqrt{y^2+4}}2\right)}_{0}+P\left(X\ge \frac{-y+\sqrt{y^2+4}}2\right)\\&=1-P\left(X\le\frac{-y+\sqrt{y^2+4}}2\right)\\&=1-\min\left\{1,\frac{-y+\sqrt{y^2+4}}2\right\}\end{align*}$$
Can you simplify this?

 Rationalizing$$\frac{-y+\sqrt{y^2+4}}2\left[\frac{\sqrt{y^2+4}+y}{\sqrt{y^2+4}+y}\right]=\frac2{\sqrt{y^2+4}+y}$$Call it $g(y)$. It is decreasing for $y>0$ so $g(y)<g(0)=1$, giving $\min\{1,g(y)\}=g(y)$.

