How to deal with the integral of function given by "piecewise" expressions? You need to break interval into subintervals. F.e. if $f(x)= 1-x^2$ as $|x|\le 1$ and $f(x)=0$ otherwise, consider $F(x)=\int _{-\infty}^x f(y)\,dy$. Then
As $x\le -1$ $F(x)=\int_{-\infty}^x 0\,dy=0$.
As $|x|\le 1$ $F(x)=\int_{-\infty}^{-1}0\,dy +\int _{-1}^x (1-y^2)\,dy = y-\frac{1}{3}y^3|_{y=-1}^{y=x}=x-\frac{1}{3}x^3 +\frac{2}{3}$.
As $x>1$ $F(x)=\int_{-\infty}^{-1}0\,dy +\int _{-1}^1 (1-y^2)\,dy + \int_0^x 0\,dy = \frac{4}{3}$:
\begin{equation*}
F(x)=\left\{ \begin{aligned}
& 0 && x<-1\\
&x-\frac{1}{3}x^3 +\frac{2}{3} &&-1\le x\le 1\\
&\frac{4}{3} &&x\ge 1
\end{aligned}\right.
\end{equation*}