# if $X\sim\exp\left(1\right)$ and $Y\sim\exp\left(1\right)$ independent, find $f_{X|Z}(x|z)$ where $Z=X+Y$ [duplicate]

Given that $$X\sim\exp\left(1\right)$$ and $$Y\sim\exp\left(1\right)$$ independent, find $$f_{X|Z}(x|z)$$ where $$Z=X+Y$$.

What I did: if $$Z=X+Y$$ then $$f_{Z,X}(z,x)=f_{X}(x)f_{Y}(z-x)$$ so we get: $$f_{Z,X}(z,x)=f_{X}(x)f_{Y}(z-x)=\left(e^{-x}I_{\left\{ x\geq0\right\} }\right)\left(e^{-(z-x)}I_{\left\{ z-x\geq0\right\} }\right)=e^{-z}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} }$$ Then we can use $$f_{X,Z}(x,z)=f_{Z|X}(z|x)f_{X}(x)$$ and get: $$f_{Z|X}(z|x)=\frac{f_{X,Z}(x,z)}{f_{X}(x)}=\frac{e^{-z}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} }}{e^{-x}I_{\left\{ x\geq0\right\} }}=e^{-z}e^{x}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} }$$ But the solution should be $$z^{-1}$$. What did I do wrong? I used those two formals from: How can I detemine the joint p.d.f. of $(X,Y)$, i.e., $f_{X,Y}(x,y)$? and I think they are valid.

Edit: I didn't use $$f_{X,Z}(x,z)=f_{Z|X}(z|x)f_{X}(x)$$ right. I need to calculate $$f_Z(z)$$ instead of $$f_X(x)$$. I calculated $$f_{X,Y}(x,y)$$: $$f_{X,Y}(x,y)=f_{X}(x)\cdot f_{Y}(y)=e^{-x}e^{-y}I_{\left\{ x\geq0\right\} }I_{\left\{ y\geq0\right\} }=e^{-x-y}I_{\left\{ x\geq0\right\} }I_{\left\{ y\geq0\right\} }$$ Then we get: \begin{align*} f_{Z}(z)&=\int_{-\infty}^{\infty}f_{X,Z}(x,z-x)dx=\int_{-\infty}^{\infty}e^{-x-(z-x)}I_{\left\{ x\geq0\right\} }I_{\left\{ z-x\geq0\right\} }dx\\&=\int_{-\infty}^{\infty}e^{-z}I_{\left\{ x\geq0\right\} }I_{\left\{ z\geq x\right\} }dx=\int_{z}^{\infty}e^{-z}dx \end{align*} Which does not converges. What's the issue?

• I think this math.stackexchange.com/questions/4003690/… might be of some help Feb 9 at 15:30
• @lorenzo there is a comment there saying $f_{Z|X}(z|x)=f_{Y+x|X}(Y+x=z|x)=f_{Y|X}(z-x|x)=f_{Y}(z-x)$. Is that true? because I then get $f_{Z|X}\left(z|x\right)=e^{-(z-x)}I_{\left\{ z-x\geq0\right\} }$ and not $z^{-1}$. Feb 9 at 15:37
• Feb 10 at 10:31