# Pdf of $Z=XY$ where $X$ and $Y$ are independent uniform$(0,1)$ variables

Let's say I have two independent random variables $$X$$ & $$Y$$ that are uniformly distributed over $$0$$ and $$1$$, with pdf:

$$f_X(x) = \begin{cases}1 & 0

$$f_Y(y) = \begin{cases}1 & 0

These two random variables are related to random variable Z, according to the function:

$$Z=XY$$

Then, I'm given a general formula to apply that will solve for the PDF of Z, if given the pdf of X and Y:

$$f_Z(z) = \int \limits_{-\infty}^{\infty} \bigg|\frac{1}{x}\bigg|~f_{XY}\Big(x,\frac{x}{z}\Big)~dx$$

$$f_Z(z) = \int \limits_{-\infty}^{\infty} \bigg|\frac{1}{x}\bigg|~f_{X}(x)~ f_{Y}\Big(\frac{x}{z}\Big)~dx$$

when I apply this formula, I get:

$$f_Z(z) = \int \limits_{0}^{1} \bigg|\frac{1}{x}\bigg|~(1)(1)~dx$$

$$f_Z(z) = \bigg[\ln x\bigg]_{0}^{1} = (0 - \infty) = -\infty$$

When the textbook applies this formula they get:

$$f_Z(z) = \int \limits_{z}^{1} \bigg|\frac{1}{x}\bigg|~(1)(1)\Big)~dx$$

$$f_Z(z) = \bigg[\ln x\bigg]_{z}^{1} = \ln 1 - \ln z$$

$$f_Z(z) = -\ln z$$

I'm wondering, how did they get the y in the lower limited of the integral? • seems like there are two regions of integration? First you need to find point where y=1 and y=x/z intersect, then draw a vertical line through this point.... integrate square to left of this line and integrate curve starting at this point until x=1? Or, would you just integrate only to the right of the line and ignore the square of the left... – pico Apr 9 at 14:38

We have for a $$z\in(0,1)$$ (well, $$(0,1)$$ is the range of $$Z$$, we need information only on this interval): \begin{aligned} f_Z(z) &= \int_{-\infty}^{+\infty} \left|\frac{1}{x}\right|\; f_{(X,Y)}\left(x,\color{red}{\frac zx}\right)\; dx \\ &= \int_{-\infty}^{+\infty} \left|\frac{1}{x}\right|\; f_X(x)\; f_Y\left(\color{red}{\frac zx}\right)\; dx \\ &= \int_0^1 \frac{1}{x}\; (1)\; f_Y\left(\color{red}{\frac zx}\right)\; dx \\ &= \int_z^1 \frac{1}{x}\; (1)\; (1)\; dx \\ &=\Big[\ \ln x\ \Big]_{x=z}^{x=1} \\ &=-\ln z\ . \end{aligned} The limits of integration were changed according to $$0\le x\le 1$$, needed for $$f_X(x)\ne 0$$, and according to $$0\le \frac zx\le 1$$, needed for $$f_Y(z/x)\ne 0$$.