[Math] Distribution of difference of iid Random Variables

probability

If X and Y are iid random variables with distribution $F(x)=e^{-e^{-x}}$ and we let $Z=X-Y$ find the distribution function of $F_Z(x)$. I get $F_Z(x)=\frac{e^x}{1+e^x}$ but that doesn't match the answer that the professor gave us. Is what I have correct? I used the standard approach where I integrate over a region the joint density which is just the product of the two densities. Nothing too fancy I did, its just I think my professor got it wrong.

Best Answer

$$ \begin{align} P(Z\leq z)&=P(X\leq z+Y)=\int_{-\infty}^\infty P(X\leq z+y) f(y)\,\mathrm dy\\ &=\int_{-\infty}^\infty\exp(-e^{-(z+y)})\exp(-y-e^{-y})\,\mathrm dy \\ &=\int_{-\infty}^\infty \exp(-y-e^{-y}(1+e^{-z}))\,\mathrm dy\\ &=\left[\frac{1}{1+e^{-z}}\exp(-(1+e^{-z})e^{-y})\right]_{-\infty}^\infty\\ &=\frac{1}{1+e^{-z}}. \end{align} $$