Suppose a unit of mass moves on a straight line (in one dimension). The position of the mass at time $t$ (in seconds) is denoted by $s(t)$, and its derivatives, velocity and acceleration, by $s'(t)$ and $s''(t)$ respectively. The position as a function of time can be determined from Newton’s second law $$s''(t) = F(t)$$ where $F(t)$ is the force applied at time $t$, and the initial conditions are $s(0), s'(0)$. We assume $F(t)$ is piecewise-constant, and is kept constant in intervals of one second. Let $f_{k}=F(t)$ for $k-1 \le t < 3$. Find an expression for $s(3)$.
What I've done so far:
$$s(t)-s(0) = \int_{0}^{t} s'(u) \,d u$$
I'm supposed to use $$\displaystyle{\int_{0}^{3}} s'(u) \,du = \int_{0}^{1} s'(u) \,du + \int_{1}^{2} s'(u) \,du + \int_{2}^{3} s'(u) \,du$$
but I'm not exactly sure what to set $s'(u)$ equal to
Hint:
If $F(t)=f_k$ for all $t$ such that $k-1\leq t < k$, $k\in \{1,2,3\}$, then $$s(t) = 0.5f_k t^2 + g_kt +h_k$$ on that interval, for some constants $g_k$ and $h_k$.
Initial conditions give: $$ h_1 = s(0),$$ $$ g_1 = s^\prime(0).$$
Also, as $s$ and $s^\prime$ are continuous at $k$, we have
$$\lim_{t \rightarrow k^-}s(t) = s(k),$$ $$\lim_{t \rightarrow k^-}s^\prime(t) = s^\prime(k),$$ for $k\in \{1,2\}$. These equalities provide $g_2, h_2$ and $g_3, h_3$.
Finally, using continuity of $s$ at $3$, we get:
$$ s(3) = \lim_{t \rightarrow 3^-}s(t) =4.5f_3 + 3g_3 +h_3.$$