This is a homework question, I feel like I'm doing it right, but I can't seem to get the answer to match up. I have a uniform RV from 2 to 4, and an exponential with mean 4, so $X \sim \text{UNI}(2,4)$, $Y \sim \text{EXP}(4)$.
I'm looking for the density of $U=\dfrac{Y}{X}$. So $f(x)=\dfrac{1}{2}$, $f(y)=\dfrac{e^{-y/4}}{4}$, and $f(x,y)=\dfrac{e^{-y/4}}{8}$.
Now if I substitute $Y=Ux$, and multiply in a Jacobian ($\dfrac{\text{d}}{\text{d}u}ux=x$, this might be a mistake, I'm not completely clear on this), I can get $f(x,u)=\dfrac{xe^{-xu/4}}{8}$. The marginal density $f(u)$ is found then by integrating out the $x$, which I can do by turning that joint density into a gamma function, where I need to get a $\dfrac{16}{u^2}$ on the bottom, so I end up with $\dfrac{2}{u^2}$ outside of the gamma integral, and after the gamma integrates to 1, f(u)=$\dfrac{2}{u^2}$. Anyone see a mistake here?
Your answer is clearly wrong since the density does not integrate to $1$ across the positive reals, as Dilip Sarwate.
The way I would approach this would be to take your $f(x,y)=\dfrac{e^{-y/4}}{8}$ and look at $$\Pr\left(\frac{Y}{X} \le u\right)=\int_{x=2}^{4} \int_{y=0}^{ux} \dfrac{e^{-y/4}}{8} dy\, dy= \int_{x=2}^{4}\left(\frac12- \dfrac{e^{-ux/4}}{2}\right) dx $$ $$=1-\frac{2}{u}\left({e}^{-\frac{u}{2}}-{e}^{-{u}}\right),$$ which has the correct limits as $u \to 0$ and $u \to \infty$, and then take the derivative for the density.