<s>[INST] Finding the pdf of $U=X+Y$ $(X,Y)$ has the following joint pdf:
$f_{X,Y}(x,y)=x+y$ if $0<x<1, 0<y<1$
If $U=X+Y$, find the marginal pdf of $U$.
I have tried to do it using transformation.
I have considered the transformation $(X,Y)\rightarrow (U,Y)$ where $U=X+Y$.
Clearly, $0<U<2$.
Now, $x=u-y$.
The jacobian is $J(\frac{x,y}{u,y})=\frac{\delta x}{\delta u}=1$, so $|J|=1$.
So, joint pdf of $(U,Y)$ is:
$f_{U,Y}(u,y)=f_{X,Y}(u-y,y)|J|$
But $-1<u-y<2$, whereas $0<x<1$, so I don't think I can write $f_{X,Y}(u-y,y)=u-y+y=u$. I am getting stuck here.
Please anyone help me solve it. Thanks in advance. 
 [/INST] $x, y\in [0,1]$ so $u=x+y\in [0,2]$. 
\begin{eqnarray*}
F_U(u)
&=&
P(X+Y \leq u)\\
&=&
\int_{x=0}^{x=1}\int_{y=0}^{y=1}(x+y){\bf 1}_{\{x+y \leq u\}}(x,y)dydx\\
&=&
\int_{x=0}^{x=1\wedge u}\int_{y=0}^{y=1\wedge (u-x)}(x+y)dydx\\
\end{eqnarray*}
When $u\in [0,1]$ the integral becomes
\begin{eqnarray*}
F_U(u)
&=&
P(X+Y \leq u)\\
&=&
\int_{x=0}^{x=u}\int_{y=0}^{y=u-x}(x+y)dydx\\
&=&
\int_{x=0}^{x=u}\Big(xy+\frac{1}{2}y^2\Big)\Big|_{y=0}^{y=u-x}dx\\
&=&
\int_{x=0}^{x=u}\Big(x(u-x)+\frac{1}{2}(u-x)^2\Big)dx\\
&=&
\int_{x=0}^{x=u}\Big( xu-x^2+\frac{1}{2}u^2-ux+\frac{1}{2}x^2\Big)dx\\
&=&
\frac{1}{2}\int_{x=0}^{x=u}\Big(u^2-x^2\Big)dx\\
&=&
\frac{1}{2}\Big(xu^2-\frac{1}{3}x^3\Big)\Big|_{x=0}^{x=u}\\
&=&
\frac{1}{2}\Big(u^3-\frac{1}{3}u^3\Big)\\
&=&
\frac{1}{3}u^3\\
\end{eqnarray*}
Thus, for $u\in [0,1]$ $f_U(u)=F'_U(u)=u^2$.
When $u\in [1,2]$ the integral becomes
\begin{eqnarray*}
F_U(u)
&=&
P(X+Y \leq u)\\
&=&
\int_{x=0}^{x=1}\int_{y=0}^{y=1\wedge (u-x)}(x+y)dydx\\
&=&
\int_{x=0}^{x=u-1}\int_{y=0}^{y=1}(x+y)dydx
+\int_{x=u-1}^{x=1}\int_{y=0}^{y=u-x}(x+y)dydx\\
&=&
\int_{x=0}^{x=u-1}\Big(xy+\frac{1}{2}y^2\Big)\Big|_{y=0}^{y=1}dx
+\int_{x=u-1}^{x=1}\Big(xy+\frac{1}{2}y^2\Big)\Big|_{y=0}^{y=u-x}dx\\
&=&
\int_{x=0}^{x=u-1}\Big(x+\frac{1}{2}\Big)dx
+\int_{x=u-1}^{x=1}\Big(x(u-x)+\frac{1}{2}(u-x)^2\Big)dx\\
&=&
\Big(\frac{1}{2}x^2+\frac{1}{2}x\Big)\Big|_{x=0}^{x=u-1}
+\int_{x=u-1}^{x=1}\Big(xu-x^2+\frac{1}{2}u^2-xu+\frac{1}{2}x^2\Big)dx\\
&=&
\Big(\frac{1}{2}(u-1)^2+\frac{1}{2}(u-1)\Big)
+\frac{1}{2}\int_{x=u-1}^{x=1}\Big(u^2-x^2\Big)dx\\
&=&
\frac{1}{2}u^2-u+\frac{1}{2}u
+\frac{1}{2}\Big(xu^2-\frac{1}{3}x^3\Big)\Big|\int_{x=u-1}^{x=1}\\
&=&
\frac{1}{2}u^2-\frac{1}{2}u
+\frac{1}{2}\Big(u^2-\frac{1}{3} - (u-1)u^2+\frac{1}{3}(u-1)^3\Big)\\
&=&
u^2-\frac{1}{3}-\frac{1}{3}u^3
\end{eqnarray*}
Thus, for $u\in [1,2]$ $f_U(u)=F'_U(u)=2u-u^2$.
Hence, overall, the density is $f_U(u) = u^2{\bf 1}_{\{0\leq u\leq 1\}}+(2u-u^2){\bf 1}_{\{1< u\leq 2\}}$
</s>