# Derivation of the density function of product of two random variables

I am looking for distribution of product of two random variables. Best I could found so far was this formula from the relevant Wikipedia page:

$$f_Z(z) = \int_{-\infty}^{+\infty} \frac{1}{|x|} f_{XY}(x, \frac{z}{x}) dx$$

However, when I try to derive it myself, I find a different result.

The work I have done so far is below.

$X$: The first random variable
$X$: The second random variable
$Z$: The product of these two random variables; that is:

$$Z = XY$$

$$F_Z(z) = P(Z \leq z) = \iint\limits_{D_z} f_{XY}(x, y) dx dy$$

Region of $Z$, $D_Z$, depends on the sign of $Z$:

So I decided to solve it in the situations; for $z<0$ and $z>0$.

• Case #1 - $(z>0)$

$$F_Z(z) = \int_{y=-\infty}^{y=0} \int_{x=\frac{z}{y}}^{x=0} f_{XY}(x, y) dx dy + \int_{y=0}^{y=+\infty} \int_{x=0}^{x=\frac{z}{y}} f_{XY}(x, y) dx dy$$ $$f_Z(z) = \frac{d F_Z(z)}{dz} = \int_{y=-\infty}^{y=0} (-\frac{1}{y}) f_{XY}(\frac{z}{y}, y) dy + \int_{y=0}^{y=+\infty} (\frac{1}{y}) f_{XY}(\frac{z}{y}, y) dy$$

• Case #2 - $(z<0)$

$$F_Z(z) = \int_{y=-\infty}^{y=0} \int_{x=0}^{x=\frac{z}{y}} f_{XY}(x, y) dx dy + \int_{y=0}^{y=+\infty} \int_{x=\frac{z}{y}}^{x=0} f_{XY}(x, y) dx dy$$ $$f_Z(z) = \frac{d F_Z(z)}{dz} = \int_{y=-\infty}^{y=0} (\frac{1}{y}) f_{XY}(\frac{z}{y}, y) dy + \int_{y=0}^{y=+\infty} (-\frac{1}{y}) f_{XY}(\frac{z}{y}, y) dy$$

By combining these two cases, I find the general partial equation:

$$f_Z(z) = \left\{ \begin{array}{ll} + \int_{y=-\infty}^{y=0} \frac{1}{y} f_{XY}(\frac{z}{y}, y) dy - \int_{y=0}^{y=+\infty} \frac{1}{y} f_{XY}(\frac{z}{y}, y) dy & \mbox{if } z < 0 \\ ??? & \mbox{if } z = 0 \\ - \int_{y=-\infty}^{y=0} \frac{1}{y} f_{XY}(\frac{z}{y}, y) dy + \int_{y=0}^{y=+\infty} \frac{1}{y} f_{XY}(\frac{z}{y}, y) dy & \mbox{if } z > 0 \end{array} \right.$$

Why is my solution SO different from the one in Wikipedia? What am I doing wrong? Can you please fix any mistakes in my derivation, or make the derivation in your own way?

-
Actually, it seems that your formula for $z>0$ coincides with the formula in the wikipedia page. So I guess your solution is not SO different from the wikipedia one. Are you familiar with the transformation theorem of random variables with density? –  Stefan Hansen Jan 19 '13 at 11:51