An investor deposits USD 300 in a bank account at time 0, reinvests all interest payments and continuously invests USD 300 per annum, until the total value of the deposits reaches USD 3312. At that point the investor stops making additional deposits, but still lets the interest payments accumulate in the account.
The ODE for the value of the deposits, $V$, over time is then, $$\frac{dV}{dt}=r(t)V(t)+I(t),$$ where $I(t)=300$ until $V(t)$ reaches $V$=3312, at which point $I(t)$ instantaneously switched to $I(t)=0.$ Also, $r(t)=\frac{1}{20+\frac{t}{2}}$.
Derive an expression for the value of the asset as a function of time, $V(t)$, $t\geq 0.$
$\textbf{My Approach: }$
I tried the problem by using the formula, $$V(t)=e^{-P(T)}\Bigg{(}\int_{0}^{T}e^{P(t)}q(t)dt + c\Bigg{)}, \text{ } c\in \mathbb{R},$$ where $P(t)=\int_{0}^{t}r(t)dt$. I don't know how to progress any further. Any help will be greatly appreciated. Thanks in advance