# Simple harmonic motion about an unstable equilibrium position?

In the typical scenario for simple harmonic motion, we have a spring providing a restoring force back to the equilibrium position. This gives rise to the equation (for undamped SHM)

$$\ddot x +\frac {k}{m}x =0$$

Where here $k$ is a positive quantity.

This gives rise to the solution $x=A\cos(\omega t + \phi )$ where $A$ is a positive quantity and $\omega$ is the angular frequency.

My question is, if we had a force where $k$ was negative, so the force acting on the particle displaced from equilibrium pushed it back further from equilibrium, mathematically we would still get the same solution and get SHM, or graph would just be flipped in the y axis but would still be a cosine graph. Why does the mathematics not reflect the fact that we would actually have a particle linearly accelerating away from the equilibrium and not undergoing any kind of oscillatory motion?

If $k$ is negative, $\omega=\sqrt{k/m}$ becomes complex and the oscillatory functions become (real) exponential functions, correctly describing the unstable situation.
When k is negative, the potential is an "upside down" parabola, with unstable equilibrium at $x=0$. When the particle is displaced from $x=0$ it rolls down the potential. The solutions are not sine or cosine but some linear combination of real exponentials.
The EOM is $$\ddot{x}=\lambda^2 x\hspace{0.3cm} \text{with} \hspace{0.3cm} -k/m\equiv \lambda^2>0$$ whose solution with the initial conditions $x(0)=0$ and $\dot{x}(0)=v_0$, is \begin{equation}x(t)=\frac{v_0}{\lambda}\text{sinh}(\lambda t). \end{equation} This shows that if the particle was initially at $x=0$, and be given a positive (negative) velocity $v_0$ at $t=0$, it will roll down to $x\to+\infty$ ($-\infty$). If the particle starts with zero initial velocity, the particle will stay there forever because $x(t)=0$ for $v_0=0$.