I have this joint pdf $f_{ab} = r_1(x)r_1(y-x)$ where $r_1(x)$ is the rectangular function with width 1. I want to calculate the marginal density $f_b$.
This is how far I've gotten: $$ \int_{-\infty}^{+\infty}f_{ab}dx=\int_{-\infty}^{+\infty}r_1(x)r_1(y-x)dx=\int_{-1/2}^{+1/2}r_1(y-x)dx$$
but I don't know how to continue now
The easiest way is probably a change of variables: Let $t = y-x$ therefore $"dt = -dx"$
$$\int_{-1/2}^{1/2} r_1(y-x)dx = \int_{y+1/2}^{y-1/2} - r_1(t) dt = \int_{y-1/2}^{y+1/2} r_1(t) dt =: (*)$$
Now note that $R_1(x) := \int_{-\infty}^x r_1(t)dt = \begin{cases} 0 & x \leq -1/2 \\ x+1/2 & x \in (-1/2,1/2) \\ 1 & x \geq 1/2\end{cases} $ so
$$(*) = R_1(y+1/2) - R(y-1/2)$$