PDF of X/Y when X, Y are uniformly distributed The question is as follows:
Let $X$ and $Y$ be random variables uniformly distributed on $[0, 1]$. Find the PDF of $Z = Y/X$.
I approached it in the following manner:
$P(Z < z) = P(Y/X < z) = P(Y < zX)$
$ = ∫ [0, 1]  ∫[0, zx] dy dx$
Which results in $z/2$. Differentiating results in 1/2. However, the book's solution includes another function for the PDF, $1/2z^2$ if $z > 1$. I'm not sure how they arrived at that, so if someone could explain that to me, that would be great. Thank you.
 A: Basically, you need to find $\int_{}f_{X,Y}(x,y)dydx$ over {$(x,y):\frac{y}{x}<z$} with the obvious restriction $0<x,y<1$ in order to find $\mathbb{P}[\frac{Y}{X}<z]$.
Note, $0<Z=\frac{Y}{X}<\infty$.
When $\frac{y}{x}<z$, $0<y<zx$. Also, $0<y<1$. So, $0<y<min(zx,1)$. 


*

*Case $0<z<1$
$0<y<min(zx,1)$ reduces to $0<y<zx$ if $0<zx<1$. Thus combining $0<zx<1$ and $0<x<1$ reduces the range of $x$ to $0<x<1$
$0<y<min(zx,1)$ reduces to $0<y<1$ if $zx>1$. Thus combining $zx>1$ and $0<x<1$ reduces to no feasible range of $x$

*Case $z>1$
$0<y<min(zx,1)$ reduces to $0<y<zx$ if $0<zx<1$. Thus combining $0<zx<1$ and $0<x<1$ reduces the range of $x$ to $0<x<\frac{1}{z}$
$0<y<min(zx,1)$ reduces to $0<y<1$ if $zx>1$. Thus combining $zx>1$ and $0<x<1$ reduces the range of $x$ to $\frac{1}{z}<x<1$
Thus, $$\mathbb{P}[\frac{Y}{X}<z]=F_Z(z)=\begin{cases} \int_{x=0}^{1}{}\int_{y=0}^{zx}{}dydx, & \text{if $0<z<1$} \\ \int_{x=0}^{\frac{1}{z}}{}\int_{y=0}^{zx}{}dydx+\int_{x=\frac{1}{z}}^{1}{}\int_{y=0}^{1}{}dydx, & \text{if $z>1$} \\ 0, & \text{otherwise}\end{cases} $$
NB: $f_{X,Y}(x,y)=1$ for $0<x,y<1$ since $X$ and $Y$ are independently and uniformly distributed over (0,1)
From here on you should be able to find the distribution of $Z$ easily.
It is important to be careful about the ranges of integration wherein the pdf is defined and non-zero for such problems.
A: The problem is your limits of integration.
Y has to be in [0,min(zx,1)] since Y is always less than one.  If z>1, there are values of X such that zx>1
