# Find the pdf of $Z=X+Y$

Let X and Y be jointly continuous with joint probability density function
$$f_{X,Y}(x,y)=\frac{1}{x},0\leq y\le x\le1$$
Find the pdf of $Z=X+Y$

Here is my solution:
$$F_Z(z)=P(Z\leq z)=P(X+Y\leq z)$$
$$=\int_{-\infty}^{\infty}P(X+Y\leq z|X=x)f_X(x)dx$$
$$=\int_{-\infty}^{\infty}P(Y\leq z-x)f_X(x)dx$$
$$=\int_{-\infty}^{\infty}F_Y(z-x)f_X(x)dx$$
since $f_X(x)=1$, $f_Y(y)=-ln(y)$, and $F_Y(y)=y-yln(y)$,
$$=\int_{0}^{1}(z-x)-(z-x)ln(z-x)dx$$ $$=\frac{z}{2}-\frac{1}{2}+\frac{1}{2}\biggl((z-1)^2ln(z-1)-zln(z)\biggl)$$ So here is the answer I got:
$$f_Z(z)=\frac{d}{dz}F_Z(z)$$ $$=(z-1)ln(z-1)+\frac{z}{2}-\frac{1}{2}ln(z)-\frac{1}{2}$$

I don't think my answer is correct since $0\leq z\leq2$, when I plug 2 into $F_Z(z)$, it doesn't show 1. I'm not sure which part I did wrong.

• What is the support for $f_{X,Y}$? Always indicate the support for these functions. – Graham Kemp Sep 6 '18 at 23:50
• I fixed it, thank you! – Yibei He Sep 6 '18 at 23:54

Notice, $x,y$ are not independent, so stick with the joint functions. Use the Jaccobian transformation.
$$\begin{split}f_Z(z) &=\int_\Bbb R f_{X,Z}(x,z)\mathsf d x\\ &= \int_\Bbb R f_{X,Y}(x,z-x) \begin{Vmatrix}\dfrac{\partial (x,z-x)}{\partial (x,z)}\end{Vmatrix}\mathsf d x \\ &=\int_\Bbb R \dfrac 1{x}\mathbf 1_{0\leq (z-x)\leq x\leq 1}\mathsf d x~\\ &= \int_{\max(0,z/2)}^{\min(1,z)} \dfrac 1x \mathbf 1_{z\in(0;2]}\mathrm d x\\ &= \mathbf 1_{z\in(0;1)}\int_{z/2}^{z} \dfrac 1x \mathrm d x+\mathbf 1_{z\in[1;2]}\int_{z/2}^{1} \dfrac 1x \mathrm d x\end{split}$$
• It's a chain rule for multivariate change of variables:$f_{U,V}(u,v) = f_{X,Y}(x(u,v), y(u,v))\cdot \left\lvert \dfrac{\partial x(u,v)}{\partial u}\dfrac{\partial y(u,v)}{\partial v}-\dfrac{\partial x(u,v)}{\partial v}\dfrac{\partial y(u,v)}{\partial u}\right\rvert$ \begin{align}f_{X,Z}(x,z) &= f_{X,Y}(x, z-x)\cdot \left\lvert \dfrac{\partial x}{\partial x}\dfrac{\partial (z-x)}{\partial z}-\dfrac{\partial x}{\partial z}\dfrac{\partial (z-x)}{\partial x}\right\rvert\\ &= f_{X,Y}(x,z-x)\cdot 1\end{align} – Graham Kemp Sep 7 '18 at 3:34