# Density of product of two uniform RVs

1. Oct 16, 2012

### obesogen

1. The problem statement, all variables and given/known data
If X,Y are independent RVs ~ U[-1,1], and W=X*Y, find the density of W.

2. Relevant equations

3. The attempt at a solution
I feel my approach is right, but the bounds of my final integral don't make sense.
$$F_{XY}(w)=P(XY \leq w)=\int_{-\infty}^{\infty} P(XY \leq w | Y=y)*f_Y(y)dy \\ =\int_{-\infty}^{\infty}P(X*y \leq w)*f_Y(y)dy \\ =\int_{-1}^{1}P(X*y \leq w)*f_Y(y)dy \\ =\int_{-1}^{1}P(X \leq w/y)*f_Y(y)dy \\ =\int_{-1}^{1}F_X(w/y)*f_Y(y)dy \\$$
For some RV Z, Z~U[-1,1], $F_Z(z)=(z+1)/2$
And the density of Y is constant (1/2).
So the integral becomes
$$\int_{-1}^{1} \frac{\frac{w}{y}+1}{2}*\frac{1}{2}dy \\ =\int_{-1}^{1} \frac{w}{4y}+\frac{1}{4} dy \\ =\frac{w}{4}log(y)+\frac{y}{4} \rvert_{-1}^1 \\$$

which obviously has a problem.

Last edited: Oct 16, 2012
2. Oct 16, 2012

### Ray Vickson

W can range from -1 to +1. To disentangle signs I think it is easiest to look at P{W > w} for 0 < w < 1 and P{W < w} for -1 < w < 0. For example, for 0 < w < 1, what is the event {W > w} in (X,Y) space?

RGV

3. Oct 17, 2012

### obesogen

Thank you for the reply, although I am not sure I understand your suggestions. I thought the general strategy to these types of problems was to find the cdf and differentiate. In this way, I don't know how P(W>w) can be of particular use. Are you suggesting a different approach? I tried taking the double integral of W<=w for each case (quadrant), but it seems like since the function is symmetric, it would either evaluate to 0 or (taking the integral of |W| when y<0), just 2...

*Small note: my original calculation was also a bit incorrect, since I need to break up the integral into two components, since the inequality flips when y is negative--although I run into similar limit problems there.

4. Oct 17, 2012

### Ray Vickson

G(w) = Pr(W > w) = 1 - F(w) = 1 - P(W <= w), so the density f(w) = dF/dw = -dG/dw. That is used in lots of places, and you should get familiar with it.

RGV

Last edited: Oct 17, 2012
5. Oct 17, 2012

### obesogen

Ok, that makes sense, but I don't see how it helps my integral problem, since I still have to compute essentially the same integral. Also, I realized that the reason I was having a lot of trouble was that log|x| actually cannot be integrated using those bounds.

6. Oct 17, 2012

### Ray Vickson

Well, the suggestion I made helped ME a lot; the integration regions are easier, etc. However, if you don't care to do that, use whatever method you want---just be really careful about the integration limits.

As you say, log |x| cannot be integrated directly, but it is a piecewise-smooth function what can be integrated with no problem within the two separate regions x < 0 and x > 0. That's all you need.

RGV

7. Oct 18, 2012

### obesogen

I must still be missing something here. Here's what I'm getting for 0<w<1, for example. Thanks for your patience.

$$G(w)=P(XY>w)=\int P(Xy>w|Y=y)f_Y(y)dy \\ =\int_0^1 P(X>w/y)f(y)dy+\int_{-1}^0 P(X<w/y)f(y)dy \\ =\int_0^1 \left(1-\frac{w/y+1}{2}\right)*\frac{1}{2}+\int_{-1}^{0}\frac{w/y+1}{2}f(y)dy \\ =1/4\int_0^1 dy-1/4 \int_0^1 w/y dy +1/2\int_{-1}^{0}w/y dy + 1/4 \int_{-1}^{0}dy \\ = \frac{1}{2}-\frac{1}{4}\int_0^1\frac{w}{y}dy+\frac{1}{4}\int_{-1}^{0}\frac{w}{y}dy \\$$

Also, I misspoke in my last comment about integrating ln|x|. I actually meant integrating 1/x, as you can see above.

8. Oct 19, 2012

### Ray Vickson

That seems complicated to me. For 0 < w < 1 the region {X*Y>w} consists of two right-triangular shapes (with a curved hypotenuse), one with its right angle at the top right and one with its right angle at the bottom left of the square [-1,1]^2. The two areas are equal, and the probability is the sum of the areas divided by the normalization factor 4, So, the probability is
$$P(W > w) = 2 \frac{1}{4} \int_{x=w}^1 \int_{y=w/x}^1 dy \, dx = \frac{1}{2} \int_{w}^1 \left(1-\frac{w}{x}\right) \,dx = \frac{1}{2} \left[ 1-w +w \ln(w) \right].$$
For -1 < w < 0, P(W < w) is the same as P(W > |w|); just look at the geometric figures involved.

RGV

9. Oct 20, 2012

### obesogen

Ah, now I understand the use of 1-F(w), etc. A very useful trick, indeed. Thanks a lot, this was very helpful.