Background
A 1D vertical spring subject to gravity satisfies Hook'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(\frac{\sqrt{k}t}{\sqrt {m}})c_1+\cos(\frac{\sqrt {k}t}{\sqrt {m}})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(\frac{\sqrt{k}}{\sqrt{m}}t) + \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.
You need a minus sign on your $kx(t)$ which will make your solutions sinusoidal instead of exponentially growing. You will then have terms in $\cos \sqrt {\frac km}t$ and $\sin \sqrt{\frac km}t$ The reason you get $\frac gk$ is because the right place to measure $x$ from is the equilibrium position where the spring force balances gravity. You are measuring $x$ from the natural point where the spring force is zero. As $k \to 0$ the balance position gets farther and farther from the natural point of the spring in order to make $mg=kx$. Of course you can put the zero anywhere you want, but you get that $\frac gk$ term when you put it where you do. As $k$ gets small, another reasonable thing is to imagine it is zero and use your $k=0$ solution and see the spring as a small perturbation. I would switch over to this when you stop having oscillatory behavior because there isn't room or time for you to complete a cycle.