Calculating the integral $ \int_0^t \int_{-s}^s f(y) \,dy\,ds$ . I want to calculate the integral $\displaystyle \int_0^t \int_{-s}^s f(y) \, dy\,ds$ where $f(x)=\begin{cases}  1-x^2 & |x| \leq 1, \\ 0 & |x|>1. \end{cases}$
However, because $f(x)$ is defined separately for different intervals, I am having trouble calculating the integral associated with $dy$. I think I should divide the integrating interval by comparing $s$ and $1$ but because the outer integral is associated with $s$, I am confused about how should I proceed further.
 A: HINT: first consider
$$ \int_{-s}^{s} f(y) dy $$
see if you can write an expression for this in "two pieces" i.e. over two intervals for s
A: Because $f(y)$ is an even function in a symetric interval $[-s,s]$ you can write
$$\int_0^t \int_{-s}^s f(y) \,dy\,ds=2\int_0^t \int_0^s f(y) \,dy\,ds$$
and changing the order of integration
$$2\int_0^t \int_0^s f(y) \,dy\,ds=2\int_0^t f(y) \int_y^t \,ds\,dy=2\int_0^t f(y)(t-y)\,dy$$
Now,


*

*If $1\leq t$ you have $\displaystyle 2\int_0^t f(y)(t-y) \,dy=2\int_0^1 (1-y^2)(t-y)\,dy=\frac{4 t}{3}-\frac{1}{2}$

*If $-1<t<1$ then $\displaystyle2\int_0^t f(y)(t-y) \, dy=2\int_0^t (1-y^2)(t-y)\,dy=t^2-\frac{t^4}{6}$

*If $t\leq -1$ you have $\displaystyle 2\int_0^t f(y)(t-y) \,dy=2\int_{0}^{-1} (1-y^2)(t-y)\,dy=-\frac{4 t}{3}-\frac{1}{2}$
$$\boxed{\displaystyle \int_0^t \int_{-s}^s f(y) \, dy \, ds = \begin{cases}  \frac{4 t}{3}-\frac{1}{2} & 1\leq t \\ t^2-\frac{t^4}{6} & -1<t<1 \\-\frac{4 t}{3}-\frac{1}{2} & t\leq -1\end{cases}}$$
Edit: About change order of integration
The $s$ variable varies from $0$ to $t$ (two fixed values) and the variable $y$ varies from line $y=0$ to line $y=s$. That is, your domain is a triangle with vertices in $(0,0),(0,t),(t,t)$. Now, if you consider the inverse order: $y$ varies from $0$ to $t$ (two fixed values)  and $s$ varies from line $s=y$ to line $s=t$.
