Background
A 1D vertical spring subject to gravity satisfies Hooke's Law:
$$m x''(t) = -kx(t) + g$$
where $m$ is the mass at the end of the spring, $x(t)$ is the position of the mass at time $t$, $x''(t)$ is its acceleration, $k$ is the stiffness coefficient, and $g$ is the gravitational force.
Solving this ODE (I used Maple, shame on me), I get:
$$x \left( t \right) =\sin \left(\frac{\sqrt{k}t}{\sqrt {m}}\right)c_1+\cos \left(\frac{\sqrt {k}t}{\sqrt {m}}\right)c_2 + {\frac {g}{k}},$$
where $c_1$ and $c_2$ are integration constants.
If my mass were detached from the spring, then this amounts to setting $k=0$ and the mass falls according to:
$$mx''(t) = g$$
and solving this produces–as expected–a quadratically increasing displacement:
$$x(t) = \frac{g}{2m}t^2 + c_3 t + c_4$$
where $c_3$ and $c_4$ are integration constants.
With initial conditions: We can simplify this problem further by assuming homogenous initial conditions in both cases: $x(0) = x'(0) = 0$. For the spring solution we get:
$$x(t) = -\frac{g}{k}\cos \left(\frac{\sqrt{k}}{\sqrt{m}}t \right) + \frac{g}{k}$$
and for the falling object we get:
$$x(t) = \frac{g}{2m}t^2.$$
Question
Because of the divide by $k$ I cannot simply consider $k=0$ to get from the spring solution to the falling object solution. Naively taking the limit seems to produce $x(t) = \infty$.
Is there a correct way to take the limit or to solve the ODE so that I get a solution that transitions from the oscillatory spring into the falling object as $k\rightarrow 0$?
Note: the conversation in the comments here mention similar behavior but without a solution to the specific question.
Bonus points for convincing maple to do this since my actual problem is a more complicated of this simple scenario.