distribution of X*Y with X and Y both i.i.d. with a U(0,1) distribution [duplicate]

I have two random variables $$X$$ and $$Y$$ both being i.i.d. with a $$U(0,1)$$ distribution. I am trying to calculate the cumulative distribution function of $$Z=X*Y$$. Which would be the most efficient way to do this? Until now, I tried t put something together from here and try a similar approach: Finding distribution function of $Y/X$ and probability density function of $X+Y$

However, I am really unsure if I can work similarly in my case. So this is my approach:

$$F_{Z}(z) = P(X*Y \leq z) = \int_0^1 P \left( Y \leq \frac{z}{x} \right)*\frac{1}{f_X(x)}dx$$

Is this approach still correct? Furthermore I am quite unsure how to continue from here, so any help is really appreciated.

• I would integrate the joint distribution over the region $0\le x\le 1$, $0\le y\le 1$, $xy\le z$. It is a simple double integral. – GReyes Jan 21 at 17:18
• since $f_X(x)=1$ this will give the correct answer, but for other distributions, I believe you need to multiply by $f_X(x)$. – robjohn Jan 21 at 17:18

The law of total probability states that $$P(XY \leq z) = \int_0^1 P(XY \leq z \: | \: X=x) f_X(x) \: dx,$$ where $$f_X(x)=1$$ for $$x \in [0,1]$$, since $$X \sim \operatorname{Uniform}(0,1)$$, and by independence we get that $$P(XY \leq z \: | \: X=x) = P(xY \leq z \: | \: X=x) = P(Y \leq \frac{z}{x}).$$ Now by definition of the uniform CDF we get, that $$P(Y \leq \frac{z}{x}) = \begin{cases} 1 & \text{ if \frac{z}{x} \geq 1} \\ \frac{z}{x} & \text{ if \frac{z}{x} \in (0,1)} \\ 0 & \text{ if \frac{z}{x} \leq 0 } \end{cases}.$$ And since we only need to consider $$z,x \in (0,1)$$ we get, that $$P(Y \leq \frac{z}{x})=1$$ for $$x \leq z$$ and $$P(Y \leq \frac{z}{x}) = \frac{z}{x}$$ for $$x> z$$. Plugging this into the integral we get that \begin{align*} P(XY \leq z) &= \int_0^z \: dx + \int_z^1 \frac{z}{x} \: dx \\ &= z - z \ln(z) \\ &= z \ln(\frac{e}{z}) \end{align*}