Suppose that $X$ and $Y$ are independent random variables that follow an exponential distribution with mean $1$ and let $W = Y - X$.
(i) Using the cumulative distribution function (cdf), find the probability density function (pdf) of $W$, $f_W(w)$ for $w > 0$. (No need to compute $w \leq 0$).
(ii) Determine the moment generating function (mgf) of $W$ by finding the mgfs of $Y$ and $-X$. Justify where the mgf is defined.
I'm not quite sure how to do this problem but here is what I did:
(i)
Suppose $X, Y$ have means $\lambda_1$ and $\lambda_2$. If $W = Y - X$ then (I think)
$$P(W \leq w) = \int_0^\infty \int_{0}^{x+z} \lambda_1 e^{-\lambda_1 x} \lambda_2 e^{-\lambda_2 y}\,dy \ \ dx$$
If we substitute $\lambda_1 = \lambda_2 = 1$ then
$$P(W \leq w) = \int_0^\infty \int_{0}^{x+z} e^{-x - y}\,dy \ \ dx$$
(ii)
The moment generating function for an exponential distribution is $M(t) = \frac{1}{1- \theta t}$ where $\theta > 0$ and $t < \frac{1}{\theta}$.
If the mean $\theta = 1$ then we know that for $Y$
$M_Y(t) = \frac{1}{1-t}$
As for $-X$, I'm not sure.
I'm not sure about the formula in (i) or how to derive it, and I'm confused on finding the mgf of $-X$ in (ii). But in any case I am stuck. Any assistance will be much appreciated.