$$f_X(x)=\begin{cases}
1- \frac{x}{2} & 0\leq x\leq 2\\
0 & \text{otherwise}
\end{cases}
\ \hspace{20pt} f_Y(y)=\begin{cases}
2-2y & 0\leq y\leq 1\\
0 & \text{otherwise}
\end{cases}$$
1) by finding the joint distribution function for $f_{X+Y} =f_X (x)\cdot f_Y (y)$ and then integrating the areas using double integrals
You mean $f_{X,Y}(x,y)=f_X (x)\cdot f_Y (y)$, because they are independent. Plus, you don't need double integrals. See below.
2) using the marginal $f_X (x)$, $f_Y (y)$ and applying the convolution concept. Is it correct to think that the convolution is represented here by the line $x+y=z$ sliding from down left to upper right ?
I guess the first method seems to be more computational intensive so the convolution should be easier, therefore I am trying to solve it using the convolution.
The first method is the second method, because $f_X(x)f_Y(z-x)=f_{X,Y}(x,z-x)$ (see above).
tl;dr Convolution is the way to go.
$$\begin{align}f_{X+Y}(z) & = \int_\Bbb R f_X(x)f_Y(z-x) \operatorname d x
\\[1ex] ~ & = \int_\Bbb R (1-\tfrac x 2)\mathbf 1_{0<x<2}\;(2-2(z-x))\mathbf 1_{0<z-x<1)}\operatorname d x
\\[1ex] ~ & = \int_\Bbb R (2-x)(1-z+x)\mathbf 1_{0<x<2, z-1<x<z, 0<z<3}\operatorname d x
\\[1ex] ~ & = \mathbf 1_{0<z<3}\int_{\max(0,z-1)}^{\min(2,z)} -x^2+(z+1)x+2(1-z) \operatorname d x
\\[1ex] ~ & = {\quad\mathbf 1_{0<z\leq 1}\int_{0}^{z} -x^2+(z+1)x+2(1-z) \operatorname d x +\ldots \\\quad +\mathbf 1_{1<z\leq 2}\int_{z-1}^{z} -x^2+(z+1)x+2(1-z) \operatorname d x +\ldots \\\quad +\mathbf 1_{2<z<3}\int_{z-1}^{2} -x^2+(z+1)x+2(1-z) \operatorname d x}
\end{align}$$
Thus:
$$f_{X+Y}(z) =\begin{cases}\int\limits_{0}^{z} -x^2+(z+1)x+2(1-z) \operatorname d x & : 0<z\leq 1 \\[0ex] \int\limits_{z-1}^{z} -x^2+(z+1)x+2(1-z) \operatorname d x & : 1<z\leq 2\\[0ex]\int\limits_{z-1}^{2} -x^2+(z+1)x+2(1-z) \operatorname d x & : 2<z<3\\[0ex] 0 & :\text{otherwise}\end{cases}$$
Now integrate to complete.
Addendum:
How do we know that the corresponding limit to the $0≤z≤1$ is from $z-1$ to $z$ and for $2≤z≤3$ from $z-1$ to $2$. Could you explain how you derived it? I don't understand this moment. – Michal
Can anyone explain in an accessible way what determines the limits for the integrals? – Michal
Firstly, we know the support for $X$ is $0\leq X\leq 2$, and the support for $Y$ is $0\leq Y\leq 1$. These are (by definition) the regions within which the density functions are non-zero.
We wish to determine the density function for $Z=X+Y$ by using the convolution method. So we must take $0\leq X\leq 2$ and $0\leq Z-X\leq 1$ and separate out the intervals for $X$ and $Z$. One being the bounds of the integral, the other the support for $Z$.
Firstly, the support for $Z$ is clearly:
$$\begin{align}(0\leq X\leq 2)\; \wedge \;(0\leq Z-X \leq 1)
& \iff (0\leq X \,\leq Z \leq\, 1+X \leq 1+2)
\\ & \iff (0\leq Z\leq 3)
\end{align}$$
Secondly, the integration for $X$ is over:
$$\begin{align}(0\,\leq\, X\,\leq\, 2) \;\wedge\; (0\,\leq (Z-X) \leq\, 1)
& \iff (0\,\leq\, X\,\leq\, 2)\; \wedge \; (Z-1\,\leq\, X\, \leq\, Z)
\\ & \iff \big(\max(0, Z-1)\,\leq \,X\,\leq\, \min(2, Z)\big)
\end{align}$$
Now, when $Z\leq 1$ then $\max(0, Z-1)=0$ and when $Z > 1$ then $\max(0,Z-1)=Z-1$
Likewise, when $Z\leq 2$ then $\min(2, Z)=Z$ and when $Z > 2$ then $\min(2,Z)=2$
Thus, the convolution integral will have three different bounds depending on where in the support $Z$ lies.
$$ \mathbf 1_{0\leq Z\leq 3} \int_{\max(0, Z-1)}^{\min(2, Z)} \ldots\operatorname d x = \begin{cases}\int_0^Z\ldots\operatorname d x & : 0\leq Z\leq 1\\[1ex]\int_{Z-1}^{Z} \ldots\operatorname d x & : 1< Z\leq 2\\[1ex]\int_{Z-1}^{2} \ldots\operatorname d x & : 2< Z\leq 3\\[1ex] 0 & :\text{elsewhere}\end{cases}$$
Best Answer
Think of the joint pdf being a cheese-cube flushed against axes in the first octant. Now, imagine the line $y = z- x$ being a long blade cutting the cheese-cube from the top. The part of cheese-cube cut off by the blade on the bottom-left corner is the CDF of $X+Y$. For $z < 1$, the part of cheese-cube cut off by the blade on the bottom-left corner is a triangular prism. For $z > 1$, the shape is different (in this case, it is the cube with a triangular prism taken out). Hopefully, this helps you see why the integral needs to be split at $z=1$.