How to solve first order differential equation where coefficient are depended on depended variable. For example, $$\frac {dy}{dt}+ay=bt$$
where $a$ is $1$ if $(y\lt 3)$, and $a$ is $2$ if $(y\gt 3)$, and $b$ is $3$ for $(y\lt 3)$ and $b$ is $4$ for $(y\gt 4) $
This is just an equation of the form
$$y'(t) + ay(t) = f(t)$$
And the solutions is given by
$$\large y(t) = \frac{1}{e^{\int a\ dt}}\left(\int e^{\int a\ dt}\ f(t)\ dt + C\right)$$
You can then adapt the solution to your cases.