# Need help finding joint distribution of uniform and exponential

Let X be an exponential random variable with parameter λ and Y be a uniform random variable on [0,1] independent of X. Find the probability density function of X + Y.

Now I have computed this integral for the last hour or more and at this point I really would like to now if I at least just set up the integral correctly. So here is my solution:

$$P(X+Y\le a)=\int_0^{a-1}\int_0^1dydx+\int_{a-1}^a\int_0^{a-x}\lambda e^{-\lambda x}dydx \space \space \text{for} \space \space a\ge 1$$ and for $0 \le a \le 1$ $$(f_x*f_y)(a)=f_{X+Y}(a)=\int_0^a \lambda e^{-\lambda x}dx=1-e^{-\lambda a}.$$

The solution is $$f_{X+Y}(a)= \begin{cases} 1-e^{-\lambda a} & 0 \le a \le 1 \\ e^{-\lambda a}(e^{\lambda}-1) & a \ge 1 \end{cases}$$

• So you are using the technique of finding the cdf and then differentiating. This is good, but significantly slower than convolutions. For $0\le a\le 1$, $\Pr(X+Y\le a)=\int_{y=0}^a\left(\int_{x=0}^{a-y}f(x,y)\,dx\right)\,dy$. Alternately one can integrate in the opposite order. After the integration work is done, differentiate for the density. There need to be corrections also in the $a\gt 1$ part. Do not have the time to write an answer, barbecue coming up. – André Nicolas Jul 17 '16 at 0:22
• @AndréNicolas Actually I used the convolution technique for $0 \le a \le 1$ edited to show it now, but I am uncertain how to use convolutions for second part of problem so went back to calc 3 technique of finding area. I will go search for some better convolutions notes to see if I can figure it out. Have fun barbecueing. Thanks for the help. – Andrew Jul 17 '16 at 0:39
• For cdf when $a\gt 1$, it is the integral from $y=0$ to $y=1$ of $\int_{x=0}^{a-y}f(x,y)\,dx$. Here integrating first with respect to $x$ saves us some breaking up. – André Nicolas Jul 17 '16 at 1:03

We calculate the cdf, dealing mainly with the case $a\ge 1$.

Draw the line $y=1$. The joint density function lives in the part of the first quadrant that is below the line $y=1$.

Draw the line $x+y=a$. Note that the geometry is a little different if $0\lt a\le 1$ than if $a\gt 1$, so making two diagrams is helpful.

To find the probability that $X+Y\le a$ we integrate $\lambda e^{-\lambda x}$ over the first quadrant region that is below $y=1$ and below $x+y=a$. It is convenient to integrate first with respect to $x$. We get $$F_{X+Y}(a)=\int_{y=0}^1 \left(\int_{x=0}^{a-y}\lambda e^{-\lambda x}\,dx\right)\,dy.$$ The inner integral is $1-e^{-\lambda(a-y)}$, that is, $1-e^{-\lambda a}e^{\lambda y}$.

Now integrating from $0$ to $1$ we get $$F_{X+Y}(a)=1-\frac{e^{-\lambda a}}{\lambda}(e^{\lambda}-1).$$

For the density function, differentiate. We get $$f_{X+Y}(a)=e^{-\lambda a}(e^{\lambda}-1).$$

The calculation for $0\lt a\lt 1$ is similar, except that in this case $$F_{X+Y}(a)=\int_{y=0}^a \left(\int_{x=0}^{a-y}\lambda e^{-\lambda x}\,dx\right)\,dy,$$ so $F_{X+Y}(a)=a-\frac{e^{-\lambda a}}{\lambda}(e^{\lambda a}-1)$, and now for the density we can differentiate.

Remark: If we just want the density, the second integration is in each case unnecessary if we know how to differentiate under the integral sign.

Comment: To help sort out differences of opinion, here is a simulation.

U ~ UNIF(0,1), V ~ EXP(1), X = U + V.

100,000 iterations of X. Your density below 1 fits nicely.

 m = 10^5
v = rexp(m, 1);  u = runif(m)
x = u + v
hist(x, br=50, prob=T, col="wheat")