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, 2020 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$$.

dan_fulea gives a good answer and my answer is in conjunction with theirs. I'll use a picture.

We have $${Z}={X}{Y}\longrightarrow {Y}=\frac{Z}{X}$$ so $${Y}=f(x)$$ for fixed $${z}$$'s

Our $$\tt probability$$ only exists over the $$\color{gray}{\bf GRAY}$$ SQUARE. I have graphed $$Y=\frac{Z}{X}$$ for $${Z}=\{.5,.9,1.1\}$$. For $${Z}=1.1$$ it misses the region we can about. So any integration to $${Y}=\frac{11}{10X}$$ will give bogus $$\tt probability$$.

The $$\color{purple}{purple}$$ region is under the graph $$Y=\frac{.5}{X}$$. In fact, every $${Z}\in(0,1)$$, $$X=Z$$. Why? Well the graph $$Y=\frac{Z}{X}$$ always intersects the line $${y}={1}$$ so $${1}=\frac{Z}{X}\Rightarrow {Z}={X}$$ Hence $$\displaystyle\int_{z}^{1}$$. $$\bf IF$$ one integrates from $${0}$$, $$\bf THEN$$ one will get $$\infty$$. You can plug in $$X$$ values really close to $$0$$ and see the graph shoot to $$\infty$$

$$\bf IF$$ there are any questions, $$\bf THEN$$ comment below or email me at $$\tt TheGreatJRB@Berkeley.edu$$

Thanks,
Jason