TITLE: Probability density function of a product of uniform random variables
QUESTION [8 upvotes]: Let $z = xy$ be a product of two uniform random variables, with $x$ having the range $[a, b)$ and $y$ the range $[c, d)$.
What is the probability density function of $z$, and how is it calculated?

REPLY [10 votes]: There are different solutions depending on whether $a > 0$ or $a < 0$, $c > 0$ or $c < 0$ etc. If you can tie it down a bit more, I'd be happy to compute a special case for you.
In the case of: $a > 0$ and $c > 0$, there are three special sub-cases:

Case 1: $a d > b c$
Case 2: $a d < b c$
Case 3: $a d = b c$

Here is the output for Case 1 using the mathStatica/Mathematica combo ...
Case 1: $a  > 0$, $c > 0$, $a d > b c$
Given $X \sim \text{Uniform}(a,b)$ with pdf $f(x)$, and $Y \sim \text{Uniform}(c,d)$ with pdf $g(y)$ and parameters $a>0$ and $c>0$, we have:
f = 1/(b-a);    domain[f] = {x, a, b} && {0 < a < b, a d > b c};
g = 1/(d-c);    domain[g] = {y, c, d} && {0 < c < d};

Find pdf of the product $Z = X * Y$, say $h(z)$:
h = TransformProduct[{f, g}, z]


with domain of support (just define it on the real line):
domain[h] = {z, -∞, ∞};

Here is a plot of the pdf for Case 1:
PlotDensity[h /. {a -> 2, b -> 4, c -> 1/2, d -> {6, 7, 8}}]


update ...
Case 3: $a  > 0$, $c > 0$, $a d == b c$
Case 3 is really just a special case of case 1 ...
Given $X \sim \text{Uniform}(a,b)$ with pdf $f(x)$, and $Y \sim \text{Uniform}(c,d)$ with pdf $g(y)$,  and parameters $a>0$  and $c>0$, we have:
f = 1/(b-a);    domain[f] = {x, a, b} && {0 < a < b, a d == b c};
g = 1/(d-c);    domain[g] = {y, c, d} && {0 < c < d};

Find pdf of the product $Z = X * Y$, say $h(z)$:
h = TransformProduct[{f, g}, z]


with domain of support (just define it on the real line):
domain[h] = {z, -∞, ∞};

Here is a plot of the pdf for Case 3, for your set-up, with $a = c$, and $b = d$:
PlotDensity[h /. {a -> Range[5], b -> 12, c -> Range[5], d -> 12}]


... and you are all done :) I might update the mathStatica code to automatically output all the special cases ... for the next version :)