Example 2.11. Integrating a step function.
Consider the step function
\begin{equation*}
f(t)=
\begin{cases}
2, & 0 \le t \lt 1,\\[4pt] -1, & 1 \le t \lt 3,\\[4pt] 1,
& 3 \le t \le 4.
\end{cases}
\end{equation*}
By finding the area of rectangles, one checks easily that the function \(F_0(x) = \int_0^x f(t)\, dt\) is given by
\begin{equation*}
F_0(x) =
\begin{cases}
2x, & 0 \le x \lt 1,\\
3 - x, & 1 \le x \lt 3,\\
x - 3, & 3 \le x \le 4,\\
\end{cases}
\end{equation*}