Formula for distribution of quotient of random variables, why is my derivation incorrect? Given two real valued independent random variables $X$ and $Y$, write their ratio as $R = \frac{X}{Y}$
I know various other ways of finding a formula for the distribution of $R$, but I'm specifically interested in understanding why the following derivation does not yield the correct result.
$$
P(R = r) = \int_{\mathbb{R}} P(\frac{X}{Y} = r | X = x)P(X = x)dx \\
= \int_{\mathbb{R}}P(Y = \frac{x}{r})P(X = x)dx \\
= \int_{\mathbb{R}}f_Y(\frac{x}{r})f_X(x)dx
$$
I can't see how this is wrong.
 A: Your posted computations seem to blur the distinctions between $Pr[X=x]$ and $f_X(x)$.  For example, $Pr[X=x]$ is a number in $[0,1]$, while $f_X(x)$ can be larger than 1 for some values of $x$.  

A correct way of obtaining the probability of an event by conditioning is: 
$$ Pr[R\leq r] = \int_{-\infty}^{\infty} Pr[R \leq r|X=x]f_X(x)dx \quad (Eq 1)$$
For a similar equation with densities, you can take a derivative of (Eq 1) with respect to $r$: 
$$ f_R(r) = \int_{-\infty}^{\infty} f_{R|X=x}(r|X=x)f_X(x)dx $$
The conditional density $f_{R|X=x}(r|X=x)$ is not the same as $f_Y(x/r)$. You can compute $f_{R|X=x}(r|X=x)$ by working with $Pr[R \leq r|X=x]$ before taking derivatives. 

Homework questions for you (can you post answers to them?): 
1) Give an example of a random variable $W$ with a density $f_W(w)$ that can be larger than 1 for certain values of $w$. 
2) Obtain an expression for $Pr[R\leq r]$ similar to (Eq 1), but this time conditioning on $Y=y$. 
3) Assume $Y$ is a positive random variable. Compute $f_{R|Y=y}(r|Y=y)$ by starting with $Pr[R\leq r|Y=y]$, manipulating this, and taking a derivative. 
4) Assume $Y$ is a positive random variable.  Compute $f_{R|X=x}(r|X=x)$ by starting with $Pr[R\leq r|X=x]$.  (Remember that multiplying by negative numbers flips inequalities. If it helps, at first you can assume that $r>0$.)  
A: 
Sol'n, written by original asker
1) $U([0, \frac{1}{2}])$, density is 2 for values on it's support
2) $P(R \le r) = \int_{\mathbb{R}}P(R \le r | Y = y)f_Y(y)dy = \int_{\mathbb{R}}P(X\le ry)f_Y(y)dy$, if $X$ and $Y$ are independent.
3) $f_{R|Y = y} = \frac{d}{dr}P(R \le r | Y = y) = \frac{d}{dr}P(X \le ry) = yf_X(ry)$
4) 
$$
f_{R|X = x}(r | X = x) = \frac{d}{dr}P(R \le r | X = x) = \\
\frac{d}{dr}P(X \le rY | X = x)
$$
if $r \gt 0$
$$
= \frac{d}{dr}P(Y \ge \frac{x}{r}) = \\
\frac{d}{dr}(1 - F_Y(\frac{x}{r}) = \frac{x}{r^2}f_Y(\frac{x}{r}) ; x \ge 0
$$
if $r \lt 0$
$$
= \frac{d}{dr}P(Y \le \frac{x}{r}) = \\
\frac{d}{dr}F_Y(\frac{x}{r}) = \frac{-x}{r^2}f_Y(\frac{x}{r}) ; x \le 0
$$
So finally it is $ \frac{|x|}{r^2}f_Y(\frac{|x|}{r})$
Is this okay?  Or am I hopeless :|
