Assuming $X$ and $Y$ are i.i.d. random variables let $Z = X + Y$
$$ f_X(x) = f_Y(y) = \begin{cases} 1/2 & -1 \le x \le 1 \\ 0 & \text{else} \end{cases} $$
Find the density $f_z$ of $Z$.
I am attempting to do this using the convolution of $f_X(x) * f_Y(y)$.
$$ f_X(x) * f_Y(y) = \int_{-\infty}^{\infty} f_X(x)f_Y(z-x) dx \\ = \int_{0}^{2} \frac{1}{2}(z - \frac{1}{2}) dx \\ = \frac{1}{2} \left[ zx - \frac{1}{2}x \right]_{0}^2 \\ = \frac{2z - 1}{2} $$
I understand the intuitive approach to this problem. i.e. the signals & systems geometric approach. And (I think) I also understand what the integral in the definition of convolution is actually doing. That being said I know the answer should be a piecewise function separated at intervals $[-2,0]$ and $[0,2]$. And I know my answer cannot be correct as it has a positive slope for the interval $[0,2]$ which should most certainly have negative slope.
Does anyone know what I am doing wrong here? Additionally, does anyone have any tips for understanding how to change the limits of integration other than imagining the graphical convolution?