I have random variable X with uniform law of distribution in the interval $[0;1]$ . Also I have random variable Y and its density function with triangle distribution(or Simson distribution) is following: $$f(y) = \begin{cases}y&:&0\le y \lt 1 \\2-y &:& 1\le y\le2 \\0&:&\text{otherwise} \end{cases}$$
$X$ and $Y$ are independent. Let $Z = X+Y$. The question is how to find density function of $Z$?
As I've known, I have to use convolution method , but I could not figure out what to write on intervals of integral.
Use indicators to keep track. $$\begin{align} f_X(x) ~&=~ \mathbf 1_{x\in[0;1]} \\[2ex] f_Y(y) ~&=~ y\,\mathbf 1_{y\in[0;1)}+(2-y)\,\mathbf 1_{y\in[1;2]} \end{align}$$
Because the supports for $X,Y$ are $[0;1]$ and $[0;1)\cup[1;2]$, then the support for their sum is $[0;1)\cup[1;2)\cup[2;3]$.
$$\begin{align} f_{X+Y}(z) ~&=~ \mathbf 1_{z\in[0;3]}\int_\Bbb R f_X(x)\;f_Y(z-x)\operatorname dx \\[1ex] &=~\mathbf 1_{z\in[0;3]} \int_\Bbb R \mathbf 1_{x\in[0;1]}\cdot\big((z-x)\mathbf 1_{z-x\in[0;1)}+(2-z+x)\mathbf 1_{z-x\in[1;2]}\big)\operatorname d x \\[1ex] &=~\mathbf 1_{z\in[0;3]} \int_\Bbb R {(z-x)\mathbf 1_{x\in[\max\{0,z-1\};\min\{1,z\})}}+{(2-z+x)\mathbf 1_{x\in[\max\{0,z-2\};\min\{1,z-1\}]}}\operatorname d x \\[1ex] &=~{\int_\Bbb R {(z-x)(\mathbf 1_{z\in[0;1)}\mathbf 1_{x\in[0;z)}+\mathbf 1_{z\in[1;2)}\mathbf 1_{x\in[z-1;1)})}+{(2-z+x)(\mathbf 1_{z\in[1;2)}\mathbf 1_{x\in[0;z-1]}+\mathbf 1_{z\in[2;3]}\mathbf 1_{x\in[z-2;1]})}\operatorname d x} \\[1ex] &=~{{\mathbf 1_{z\in[0;1)}\int_0^z(z-x)\operatorname d x}+{\mathbf 1_{z\in[1;2)}\left(\int_0^{z-1}(2-z+x)\operatorname d x+\int_{z-1}^1(z-x)\operatorname d x\right)}+{\mathbf 1_{z\in[2;3]}\int_{z-2}^{1}(2-z+x)\operatorname d x}} \end{align}$$