How to compute U = X/Y of a pdf I know that similar questions have been posted before but I don't understand how to solve them, especially because this very type of question is never explained in our textbook. 
Assume that we are given 
$f_x(x) = xe^{-x}$
$f_y(y) = \frac{1}{6}y^{3}e^{-y}$
And have to compute $U = X/Y$
I am not directly interested in this specific result, I am looking for an explanation on how it is done. I also appreciate a link to somewhere this type of operation is explained step by step.
Also it does not have to be this specific operation. It can also be $U = X+Y$ or similar, as I suspect them all to be solvable in a similar manner. 
Thank you.
Edit: I am given the distribution $f(x,y) = x(y-x)e^{-y}$ for $0<x<y<\infty$ and calculated the marginal distributions.
 A: When transforming random variables, it's usualy a lot easier to argue when working with CDFs rather than PDFs.
So, we want the CDF of $U$. Clearly, $U$ lies between $0$ and $1$ with probability $1$, so we don't have to worry about any values outside of that.
Consider $U\leq u$ for some $u\in [0,1]$. This means that $X/Y\leq u$, or that $Y\geq X/u$, which is to say that the point $(X, Y)$ lies in the first quadrant, above the line $Y = X/u$. The probability of this happening is given by
$$
\int_0^\infty\left(\int_{x/u}^\infty x(y-x)e^{-y}dy\right)dx\\
= \int_0^\infty xe^{-x/u}\left(\frac xu - x + 1\right)dx\\
= 3u^2-2u^3
$$
The pdf of $U$ is gotten by differentiating this. We get $f_U(u) = 6u(1-u)$ for $0\leq u\leq 1$ and $0$ otherwise.
A: To start with, we need joint distribution. In our case, we are given one $f(x,y) = x(y-x)e^{-y}$ for $0<x<y<\infty$. Sometimes you may be given the pdf of $X$ and $Y$ separatelly but with additional information that they are independent ( yet you can form a vector $(X,Y)$ with joint density function being a product of densities of $X$ and $Y$)
Take for example $U= \frac{X}{Y}$. It is a good idea to try to find CDF of that "new" variable.
$F_U(t) = \mathbb P(U \le t) = \mathbb P( \{ \omega \in \Omega : \frac{X(\omega)}{Y(\omega)} \le t \})$.
Now, taking into consideration that almost surely we have $Y > 0 $, we can multiply by $Y$ without changing sign, so:
$F_U(t) = \mathbb P(\{ \omega \in \Omega : X(\omega) \le Y(\omega)t \}) = \mu_{(X,Y)}(A_t) $, where:
$\mu_{(X,Y)}$ is probability distribution of vector $(X,Y)$ that is for a borel set $A \in \mathcal B(\mathbb R^2)$, we have $\mu_{(X,Y)}(A) = \int_A f(x,y) d\lambda_2(x,y)$
$A_t$ is our set: $A_t = \{ (x,y) \in \mathbb R^2 : x \le yt \} $ 
(Now to mention, if you would work with $W=X+Y$ you will have for example $F_W(t) = \mu_{(X,Y)}(B_t)$, where $B_t = \{ (x,y) \in \mathbb R^2 : x \le t-y \}$)
So we have $$F_U(t) = \int_{A_t} f(x,y)d\lambda_2(x,y)$$
When $t \le 0$, we don't have really anything to integrate (due to $X,Y > 0$ almost surely), so $F_U(t) = 0$ for $t \le 0$
Taking $t>0$, we have:
$$F_U(t) = \int_{A_t} f(x,y)d\lambda_2(x,y) = \int_0^\infty \int_0^{\min\{y,yt\}}x(y-x)e^{-y}dxdy$$
We have two cases, when $t\in(0,1)$, $\min\{y,yt\} = yt$ (due to $y > 0$)
And when $t \ge 1$ we have $\min\{y,yt\} = y$
So take $t \in (0,1)$, then $$F_U(t) = \int_0^\infty e^{-y} \int_0^{yt} x(y-x) dx dy = \int_0^\infty e^{-y} \frac{y^3t^2}{2} - \frac{y^3t^3}{3}dy = \frac{3t^2-2t^3}{6} \int_0^\infty e^{-y}y^3 dy$$
Doing the latter for example by parts, you arrive with $F_U(t) = 3t^2 - 2t^3$ for $t \in (0,1)$
And for $t\ge 1$, we just have $$F_U(t) = \int_0^\infty \int_0^y f(x,y)dxdy = \int_{\mathbb R^2} f(x,y)d\lambda_2(x,y) = 1 $$ (because we are integrating PDF over whole space).
So our CDF of $U$ is : $F_U(t) = 3t^2 - 2t^3$ for $t \in (0,1)$, $0$ for $t \le 0$ and $1$ for $t \ge 1$. That is piece-wise continuous so we can get PDF by simply differentiating it where we can ( we don't have to bother about finitelly many points, because they are of measure $0$ ).
So we get $f_U(u) = 6u - 6u^2 = 6u(1-u)$ for $ u \in (0,1)$
