# Density function of product of random variables.

I've got the next question:

Let $$X,Y$$ independent random variables such that:

$$X \sim Unif(-1,0) \quad \mbox{ and } \quad Y \sim Unif(0,1).$$

Find the density function of $$Z=XY$$ using the density product formula for independent random variables. Repeat the exercise using the fact that

$$X \sim Unif(0,1) \quad \mbox{ and } \quad Y\sim Exp(\lambda).$$

My attempt:

If $$Z = XY$$ then:

\begin{align*} f_Z(z) &= \int_{-\infty}^{\infty} \dfrac{1}{|x|}f_X(x)\cdot f_Y(z/x)dx\\ &= \int_{-1}^{0} \dfrac{1}{|x|}1 \cdot 1 dx\\ &= \int_{-1}^{0} -\dfrac{1}{x} dx \end{align*}

Clearly so far I have come to a problem since that integral does not converge. Then I just tried the other exercise first, so, if $$X\sim Unif(0,1)$$, $$Y\sim Exp(\lambda)$$ and $$Z=XY$$ then:

\begin{align*} f_Z(z) &= \int_{-\infty}^{\infty} \dfrac{1}{|x|}f_X(x)\cdot f_Y(z/x)dx\\ &= \int_{0}^{1} \dfrac{1}{|x|}1 \cdot \lambda e^{-\lambda (z/x)} dx\\ &= \int_{0}^{1} \dfrac{\lambda}{x} e^{-\lambda (z/x)} dx \end{align*}

Here, I face another problem because I tried to compute that integral and got stuck, I checked in wolfram and that integral is equal to $$\lambda\cdot \Gamma(0,\lambda z)$$ and I don't know how to compute that.

My first thought was that I was making mistakes applying the formula, but I don't so the only conclusion that seems reasonable to me is that the limits of integration are wrong. I would appreciate if someone can guide me to correct those limits.

• $f_Y(z/x)=1$ is wrong. YOu have the restriction $z/x<1$, then the correct expression is $[z<x]$ or $1_{z<x}$ (using either Iverson brackets or indicator function, as you prefer). And that results in changing your integration limits. – leonbloy Jun 3 at 18:56
• @leonbloy You're right, I totally miss that, but instead $z < x$ shouldn't it be $z >x$? Since both $x$ and $z$ take values ​​at $(-1,0)$. – frl93 Jun 3 at 20:33
• Yes, I missed that. – leonbloy Jun 4 at 1:07

Using the Iverson bracket notation, $$f_X(x)= [-1 < x < 0]$$, $$f_Y(y)=[0
Then $$f_X(x) f_Y(z/x)=[-1
This is equivalent to $$[-1. Hence
\begin{align*} f_Z(z) &= \int_{-\infty}^{\infty} \dfrac{1}{|x|}f_X(x)\cdot f_Y(z/x)dx\\ &= \int_{-1}^{z} \dfrac{1}{|x|} dx \quad [-1