This should be a relatively easy problem but I think I am missing something somewhere. This problem consists of a object that is being thrown into the air at $t = 4s$ at a velocity $v_0$
here is my acceleration function: $a(n) = \begin{cases} 0, & t<t_1 \\ g, & t≥t_1 \end{cases} $
Where
$g = - 9.8m/s^2$
$t_1 = 4s$
$x_0=0m$
$v_0$ is the velocity at which the object is being thrown up in the air at.
When I derive the velocity function it seems to be correct from what I could find, $v(n) = \begin{cases} 0, & t<t_1 \\ gt-gt_1+v_0, & t≥t_1 \end{cases} $
But when I go to derive the position function I get lost.
$y(t) - x_0= \int_{t_1}^tv(t)dt => [\frac{1}{2}gt^2-gt{t_1}+v_ot]_{t_1}^t =>\frac{1}{2}gt^2-gt{t_1}+v_ot -(\frac{1}{2}g{t_1}^2-g{t_1}^2+v_ot_1) $
When I then go apply this to the rest of the problem I get nonsense answers.
Can someone please let me know where I've gone wrong. Sorry if this is an easy problem, I am a beginner to physics.
PS: I know you can solve for this algebraically, you get $y(t) = \begin{cases} 0, & t>t_1 \\ \frac{1}{2}g(t+t_1)+v_0(t+t_1), & t≥t_1 \end{cases}$ but I would like to know the derivation based on the calculus of the problem as it is more relevant to the course I am following.