Given joint pdf find $f(z)$, where $Z=X+Y$ Let $f_{X,Y}(x,y)=\frac{1}{8}$ for $-2<x<2$, $0<y<2$. Find $f(z)$ where $Z=X+Y$. 
I am having difficulty solving the above problem. My attempt at a solution relies on a convolution formula, which says that the $pdf$ of $Z=X+Y$, given the joint $pdf$ $f(x,y)$ is given by $$f_Z(z)= \int_{s+t=z} f(s,t)ds=\int_{-\infty}^{\infty} f(s,z-s)ds$$. So first note that $f(s,z-s)=\frac{1}{8}$ if $-2<s<2$ and $0<z-s<2$. Then note that $0<z-s<2$ is the same as $z-2<s<z$. But these regions depend on the value of $z$. Hence,
  $$\begin{equation}
    f_Z(z)=
    \begin{cases}
      \int_{-2}^{z} \frac{1}{8}ds, & \text{if}\ 0\leq z \leq2\\
      \int_{z-2}^{2} \frac{1}{8}ds, & \text{if}\ 2<z\leq4
    \end{cases}
  \end{equation}$$. After evaluating the integrals, I get 
$$\begin{equation}
    f_Z(z)=
    \begin{cases}
      \frac{z-2}{8}, & \text{if}\ 0\leq z \leq2\\
      \frac{4-z}{8}, & \text{if}\ 2<z\leq4
    \end{cases}
  \end{equation}$$.
I have solved similar problems like this one but all of them have been defined over the intervals $0<x<1$ and $0<y<1$. In this problem, however, we have the intervals $(-2,2)$ for $x$ and $(0,2)$ for $y$.I have graphed these regions but I have no intuition on how to divide it. Any help would be appreciated. Thanks. 
 A: The joint distribution of $(X,Y)$ is uniform on a rectangle with
corners at $(-2,0)$ and $(2,2),$ and with area 8. So just by geometry, you should
be able to find the CDF of $S = X + Y.$ For example, draw the rectangle
and the line $x + y = 1.5.$ Then what is the value of $F_S(s) = P(S \le s = 1.5)?$ 
(Consider three cases: $s < 0,\, 0 < s < 2,\, s > 2.$)
Here is a simulation in R statistical software of the distribution of $S$
based on a million realizations. The histogram suggests the shape of the PDF
and the ECDF (empirical CDF) suggests the shape of the CDF. In one dimension, itegrate the CDF
over three separate regions to get the (piecewise) PDF. (The CDF is linear
between 0 and 2.)
m = 10^6
x = runif(m, 0, 2);  y = runif(m, -2, 2)
s = x + y 
mean(s)
## 0.9980456  # aprx E(S) = 1

# plots
par(mfrow=c(1,2))  # 2 panels per figure
  hist(s, prob=T, col="wheat", main="Simulated Distribution of S = X + Y")
  plot(ecdf(s)); abline(v=c(0,2), col="green")
par(mfrow=c(1,1))  # returns to default single-panel plotting


A: First note that when $X\in[-2..2]$ and $Y\in[0..2]$, then $X+Y\in[-2..4]$, thus this is the support for the pdf of $Z$.
You have obtained that: $$f_{\small Z}(z)=\int_\Bbb R \tfrac 18\mathbf 1_{-2\leqslant s\leqslant 2, 0\leqslant z-s\leqslant 2}\,\mathrm d s$$
With a little rearangment, and the afformentioned note, we shall obtain:$$f_{\small Z}(z)=\tfrac 18\mathbf 1_{-2\leqslant z\leqslant 4}\int_\Bbb R \mathbf 1_{\max(-2,z-2)\leqslant s\leqslant \min(2,z)}\,\mathrm d s$$
So, $-2=z-2$ and $2=z$ are the points we partition the support for $Z$'s pdf. ($z=0$ and $z=2$, obvs.)
$$f_{\small Z}(z)=\tfrac 18\left(\mathbf 1_{-2\leqslant z\lt 0}\int_{-2}^{z}\mathrm d s+\mathbf 1_{0\leqslant z\lt 2}\int_{z-2}^z\mathrm d s+\mathbf 1_{2\leqslant z\leqslant 4}\int_{z-2}^2\mathrm d s \right)$$
Of course those integrals are trivial.
$$f_{\small Z}(z)=\tfrac{z+2}{8}\mathbf 1_{-2\leqslant z\lt 0}+\tfrac{2}{8}\mathbf 1_{0\leqslant z\lt 2}+\tfrac {4-z}{8}\mathbf 1_{2\leqslant z\leqslant 4}$$
Or if you prefer:$$f_{\small Z}(z)=\begin{cases}(z+2)/8&:& -2\leqslant 2<0\\1/4&:&0\leqslant z\lt 2\\(4-z)/8&:&2\leqslant z\leqslant 4\\0&:&\textsf{elsewhere}\end{cases}$$
NB: This pdf is in the shape of a trapezoid.
