Calculating the convolution of piecewise constant functions Let $f(x) = \frac{1}{2}$ on $[-1,1]$. Find $f*f*f$
$(f*g)(x)=\int\limits_{-\infty}^\infty f(t)g(x-t)\,dt$. 
So $(f*f)(x)=\begin{cases} \frac{1}{4}x+\frac{1}{2} & -2\le x \le 0 \\ \frac{-1}{4}x+\frac{1}{2} & 0 < x \le 2 \\ 0 & \text{otherwise} \end{cases}$ 
This is almost identical to this question
Which this answer in this questions does now clearly explain how to find the limits of integration. I figured it out for $f*f$, but I am now lost in trying to calculate $f*f*f$.
I know that $(f*f*f)(x)$ will be in three pieces on $[-3,-1],[-1,1],$ and $[1,3]$, but I do not know how to set up my integrals.
 A: The convolution is $f*f*f(w)=\int_{x}\int_{y} f(x)f(y)f(w-x-y) dydx$. We seek the integration limits, firstly for $x$ given $w$ (with $-3\lt w\lt 3$), then for $y$ given $w,x$.
Limits for $x$ given $w$:


*

*$-1\lt x\lt 1$

*$w-2\lt x\lt w+2\qquad \text{(lower bound comes from $x=w-y-z\;$ with $y=z=1$)}$
$\qquad\qquad\qquad\qquad\qquad\text{(upper bound comes from $x=w-y-z\;$ with $y=z=-1$)}$


So the limits for $x$: $\qquad\max\{-1,w-2\}\lt x\lt\min\{1,w+2\}$
Note:


*

*$-1\lt w-2$ iff $w\gt 1$

*$1\lt w+2$ iff $w\gt -1$


Hence, we split the interval $w\in [-3,3]$ at points $-1,1$.
$\\$
Limits for $y$ given $w,x$:


*

*$-1\lt y\lt 1$

*$w-x-1\lt y\lt w-x+1\qquad \text{(lower bound comes from $y=w-x-z\;$ with $z=1$)}$
$\qquad\qquad\qquad\qquad\qquad\qquad\text{(upper bound comes from $y=w-x-z\;$ with $z=-1$)}$


So the limits for $y$: $\qquad\max\{-1,w-x-1\}\lt y\lt\min\{1,w-x+1\}$
$\\$
For interval $w\in(-3,-1)$:


*

*$-1\lt x\lt w+2$


$\\$


*

*$\max\{-1,w-x-1\} = -1$

*$\min\{1,w-x+1\} = w-x+1$


$\qquad\therefore\quad -1\lt y\lt w-x+1$
$\\$
For interval $w\in(-1,1)$:


*

*$-1\lt x\lt 1$


$\\$


*

*$\max\{-1,w-x-1\} = -1 \text{ only when $x\gt w$}$

*$\min\{1,w-x+1\} = 1 \text{ only when $x\lt w$}$


So if $-1\lt x\lt w$ then $w-x-1\lt y\lt 1$.
And if $w\lt x\lt 1$ then $-1\lt y\lt w-x+1$.
$\\$
For interval $w\in(1,3)$:


*

*$w-2\lt x\lt 1$


$\\$


*

*$\max\{-1,w-x-1\} = w-x-1$

*$\min\{1,w-x+1\} = 1$


$\qquad\therefore\quad w-x-1\lt y\lt 1$
$\\$
So our integrals are:
For $-3\lt w\lt -1$:
\begin{align}
f*f*f(w) &= \int_{x=-1}^{w+2}\int_{y=-1}^{w-x+1} f(x)f(y)f(w-x-y)\;dydx \\
&= \left(\dfrac{w+3}{4} \right)^2
\end{align}
For $-1\lt w\lt 1$:
\begin{align}
f*f*f(w) &= \int_{x=-1}^{w}\int_{y=w-x-1}^{1} f(x)f(y)f(w-x-y)\;dydx \\
&\qquad + \int_{x=w}^{1}\int_{y=-1}^{w-x+1} f(x)f(y)f(w-x-y)\;dydx \\
&= \dfrac{3-w^2}{8}
\end{align}
For $1\lt w\lt 3$:
\begin{align}
f*f*f(w) &= \int_{x=w-2}^{1}\int_{y=w-x-1}^{1} f(x)f(y)f(w-x-y)\;dydx \\
&= \left(\dfrac{w-3}{4} \right)^2
\end{align}
It might help to see the limits of integration by looking at how the plane $x+y+z=w$ moves through the cube $[-1,1]^3$ as $w$ varies from $-3$ to $3$.
