Determine the Density Function of $(X_1/X_2)$ Problem: Let $X_1$ and $X_2$ be independent and uniformly distributed random variables over (0,2). Determine the Density Function of $(X_1/X_2)$.
Here are my thoughts on the problem:
$\vec{x}=(x_1,x_2)$:$(0,2)\times(0,2)$. So $f_1(x_1)=2, f_2(x_2)=f_1(x_2)=2$ for $\forall x_1,x_2\in(0,2)$ such that $f(x_1,x_2)=\frac{f_1(x_1)}{f_1(x_2)}=1$
$y_1=\frac{x_1}{x_2}$ and $y_2=x_2\Rightarrow x_2y_1=x_1, y_2=x_2$. Let $v_1=(x_2y_1)$ and $v_2=y_2$. 
Using $g(y_1,y_2)=f(v(y_1,y_2))|J_v(y_1,y_2)|$, (where $J_v$ is the $2\times2$ Jacobian Matrix)$=y_2$
$$g_{y_1}=\int g(y_1,y_2) \,dY_2=\int\limits_y_1^1y_2 \, dy_2=\frac{1-y_1^2}{2},0<y_1<1$$
I'm not feeling confident in my solution. I would greatly appreciate any feedback on my attempt. Thank you.
 A: Let $R=\frac{X_1}{X_2}$. Let's find the cumulative distribution function of $R$. For $r>0$
$$
   F_R(r) = \Pr\left(R \leqslant r\right) = \Pr\left(\frac{X_1}{X_2} \leqslant r \right) = 
   \Pr\left(X_1 \leqslant r X_2\right) = \mathbb{E}\left( \min\left(1, \frac{r}{2} X_2\right) \right)
$$
The last equality follows because $F_{X_1}(x) = \frac{1}{2} \min\left(2, \max\left(0,x\right)\right)$. Now, explicitly writing out the expectation as integral:
$$
  F_R(r) = \mathbb{E}\left( \min\left(1, \frac{r}{2} X_2\right) \right) = \int_0^2 \min\left(1, \frac{r}{2} x_2\right) f_{X_2}\left(x_2\right) \mathrm{d}x_2
$$
Since $f_{X_2}(x_2) = \frac{1}{2} [0 <x_2<2]$, we have
$$
  F_R(r) = \int_0^2 \min\left(1, \frac{r}{2} x_2\right) \frac{1}{2} \mathrm{d}x_2\stackrel{u=x_2/2}{=} \int_0^1 \min\left(1, r u\right)  \mathrm{d}u
$$
Now, consider separate cases of $0<r\leqslant 1$ and $r>1$, getting
$$
   F_R(r) = \begin{cases} \frac{r}{2} & 0 <r \leqslant 1 \cr 1- \frac{1}{2 r} & r > 1 \cr 0 & r \leqslant 0\end{cases}
$$
Differentiating the cumulative distribution function we can recover the PDF:
$$
  f_R(r) =  \begin{cases} \frac{1}{2} & 0 <r \leqslant 1 \cr \frac{1}{2 r^2} & r > 1 \cr 0 & r \leqslant 0\end{cases}
$$
A: This is the kind of problem where beginners can benefit greatly by drawing a diagram instead of trying to do it all via symbolic manipulation. It takes
a lot more time to type in the detailed instructions (given below)
of what to do than to simply work with a diagram.
Consider that the joint density has value $\frac 14$ on the interior
of the square with opposite
corners at $(0,0)$ and $(2,2)$. So draw $x$ and $y$ axes and mark off this
square.  The random point $(X,Y)$ lies somewhere inside this square.
What values can $Z = \frac YX$ take on? Obviously the values of $Z$ are in $(0,\infty)$. For any fixed real number $r \in (0,\infty)$, what is the value of
$$F_Z(r) = P\{Z \leq r\} = P\left\{\frac YX \leq r\right\}
= P\{Y \leq rX\}?$$
We are asking for the probability that the point $(X,Y)$ lies below
the line $y = rx$ in the plane that you are sketching. So, pick
your favorite real number $r$ and draw the line $y=rx$ on your
diagram. (This line necessarily passes through the origin, a.k.a. the
lower left corner of the square). Now, depending on your choice of $r$, 
this line will cross either the horizontal side $y=2$ of the square
at the point $\left(\frac 2r,2\right)$, or the vertical side $x=2$
at $(2,2r)$, and if you think about it just a bit, you will realize
that which of these two cases occurs depends on whether $r > 1$ or $r < 1$.
So, for any $r, 0 < r \leq 1$, $P\{Y \leq rX\}$ is the probability that
the random point $(X,Y)$ lies in the interior of the triangle with
vertices $(0,0), (2,0), (2,2r)$ which can be found in general by
integrating the joint pdf over this triangle. In this case, if we
put our brain in gear before putting pen to paper, we realize that
the answer can be obtained by simple mensuration. The triangle has
area $\frac 12\times 2\times 2r = 2r$ and since the pdf has constant
value $\frac 14$ on this triangle, we have that 
$$F_Z(r) = P\{Y \leq rX\} = \frac r2, ~ 0 < r \leq 1. \tag{1}$$
We can do a similar computation for the case $1 \leq r < \infty$ with
the slight twist that it is just a little easier to calculate
$P\{Y > rX\} = 1-F_Z(r)$, which is the probability
that the random point lies in the interior of the triangle
with vertices $(0,0), (0,2), \left(\frac 2r,2\right)$. This triangle has
area $\frac 12 \times 2 \times \frac 2r = \frac 2r$ and so
$$F_Z(r) = P\{Y \leq rX\} = 1-\frac{1}{2r}, ~ 1 \leq r < \infty. \tag{2}$$
As a sanity check, note that $(1)$ and $(2)$ both claim that
$F_Z(1) = \frac 12$, and of course, the result matches Sasha's answer.
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
Lets $\ds{z \equiv {X_{1} \over X_{2}}}$. The answer $\ds{\pp\pars{z}}$ is given by:
\begin{align}
\pp\pars{z}&=\int_{0}^{2}\half\int_{0}^{2}\half\delta\pars{z - {X_{1} \over X_{2}}}
\,\dd X_{1}\,\dd X_{2}
={1 \over 4}\int_{0}^{2}\int_{0}^{2}
{\delta\pars{X_{2} - X_{1}/z} \over \verts{X_{1}/X_{2}^{2}}}
\,\dd X_{2}\,\dd X_{1}
\\[5mm]&={1 \over 4z^{2}}\int_{0}^{2}X_{1}\int_{0}^{2}
\delta\pars{X_{2} - {X_{1} \over z}}\,\dd X_{2}\,\dd X_{1}
=\left.{1 \over 4z^{2}}\int_{0}^{2}X_{1}\,\dd X_{1}\right\vert
_{\, 0\ <\ X_{1}/z\ <\ 2}
\\[5mm]&=\left.{1 \over 4z^{2}}\int_{0}^{2}X_{1}\,\dd X_{1}\right\vert
_{z\ >\ 0 \atop{\vphantom{\LARGE A}X_{1}\ <\ 2z}}
=\left.{1 \over 4z^{2}}\int_{0}^{\min\pars{2,2z}}X_{1}\,\dd X_{1}
\right\vert_{\, z\ >\ 0}
=\left.{\bracks{\min\pars{2,2z}}^{2} \over 8z^{2}}\right\vert_{\, z\ >\ 0}
\\[5mm]&=\color{#66f}{\large\left\{\begin{array}{lcl}
{1 \over 2} & \mbox{if} & 0 < z < 1
\\[2mm]
{1 \over 2z^{2}} & \mbox{if} & z \geq 1
\\[2mm]
0 && \mbox{otherwise}
\end{array}\right.}
\end{align}

