# Finding the PDF of a linear function of 2 random variables

Given:

$X_1, X_2 \overset{iid}{\sim} Unif(0,60)$

Find the PDF of $Y$ where:

$Y = X_1 - X_2$

I want to use the formula for the linear function of two random variables, which is stated in Kadane's book, Probability & Statistics, as:

Where:

$Y=a_1X_1+a_2X_2+b$ and $f$ is the joint pdf of $X_1, X_2$

The PDF of Y is given by the formula:

$g(y)=\int_{-\infty}^\infty f\left(\frac{y-b-a_2x_2}{a_1}, x_2\right) \frac{1}{|a_1|} dx_2$

I initially attempted the following use of the formula:

$f(x_1,x_2) = \frac{1}{60} \cdot \frac{1}{60} = \frac{1}{3600}$ for $x_i \in [0,60]$

Therefore, since Y varies from -60 to +60 as $X_1$ and $X_2$ vary between $(0,60)$:

$g(y) = \int_{-60}^{60} \frac{1}{3600} \cdot 1 = \frac{1}{30}$ for $y \in (-60, 60)$

But that is wrong. So I thought I might misunderstand the use of the bounds in the integral. I note that:

$\int_{-\infty}^\infty \frac{1}{3600} = \infty$

So either I don't understand how to set the bounds with this formula, or perhaps the above result tells me that I cannot use this formula with the uniform distribution, but I wouldn't understand why not.

• Uniform plus uniform should be triangle. Hint: try letting $W = -X_2$ and set up for a convolution. – Sean Roberson Dec 10 '17 at 5:38