# PDF of X,Y uniform on (0,1) [duplicate]

If $X \sim Unif(0,1) \sim Y$. How can I calculate the PDF of $Z=XY$.

I tried $P(XY < t) = P(X < t/Y) = \int_{-\infty}^{\infty}(P[X<t/Y] f_{y})dy = \int_{0}^{1} \int_{0}^{t/y} f_{x} f_{y} dxdy$ $= \int_{0}^{1} \frac{t}{y}dy = t[log(y)]_{0}^{1}$.

Which doesn't really make sense. Can some one help me with this problem?

Let $$X,Y$$ be independent random variables.

Suppose that $$X,Y \sim U(0,1)$$

the pdf for a uniform random variable $$Z \sim \textrm{Uniform}(a,b)$$

f(z) =\begin{align}\begin{cases} \frac{1}{b-a} & \textrm{ for } a \leq z \leq b \\ 0 & \textrm{ for } z b \end{cases} \end{align}

then we have

f(x) =\begin{align}\begin{cases} 1 & \textrm{ for } 0 \leq x \leq 1 \\ \\ 0 & \textrm{ for } x <0 \textrm{ or } x > 1 \end{cases} \end{align} f(y) =\begin{align}\begin{cases} 1 & \textrm{ for } 0 \leq x \leq 1 \\ \\ 0 & \textrm{ for } x <0 \textrm{ or } x > 1 \end{cases} \end{align}

then we have

$$P(XY < t) = \int_{0}^{t} \int_{0}^{1} f(x) f(y) dx dy + \int_{t}^{1} \int_{0}^{\frac{t}{y}} f(x) f(y) dx dy$$ computing the left side $$\int_{0}^{t} \int_{0}^{1} 1 \cdot 1 dx dy = \int_{0}^{1} x \Big|_{0}^{1} = \int_{0}^{t} 1 dy = t \Big|_{0}^{1} = t$$ Computing the right $$\int_{t}^{1} \int_{0}^{\frac{t}{y}} f(x) f(y) dxdy = \int_{t}^{1}\int_{0}^{\frac{t}{y}} 1 \cdot 1 dx dy = \int_{t}^{1} x \Big|_{0}^{\frac{t}{y}} = \int_{t}^{1}\frac{t}{y} dy$$ $$t\int_{t}^{1} \frac{1}{t} dy = t \ln(y) \Big|_{t}^{1}$$ $$t \ln(1) - t \ln(t) =t\ln(\frac{1}{t})$$

adding $$t + t\ln(\frac{1}{t})$$

The region $\{XY<t\}$ you are integrating over is defined by the inequalities $$0\le x\le 1,\qquad 0\le y\le 1,\qquad xy\le t$$ When integrating $dx$, this means that the lower bound is $0\le x$, but you have to take into account both of the upper bounds $x\le 1$ and $x\le t/y$. Whichever is smaller is the one that matters, so you need two integrals, one where $t/y\le1$ and one where $t/y\ge 1$. Something like $$P(XY<t) = \int_0^t\int_0^1f_x(x)f_y(y)\,dx\,dy +\int_t^{1}\int_0^{t/y}f_x(x)f_y(y)\,dx\,dy$$ If you wanted to do things with a single integral, you could instead compute $P(XY\ge t)$, then subtract from one.