Difficulty understanding the solutions to $x'' = -\omega^2 x$ For some reasons involving physics, I'm supposed to consider the equation $x'' = -\omega^2 x$.
Normally, I would say the solutions are of the form $x = A \cos(\omega t + \phi)$. But when $\omega = 0$, the equation degenerates to $x'' = 0$, which gives an entirely different set of solutions: $x = ct + d$.
What stumps me is how these two cases aren't in the same form. No matter what I try to do to the cosine (splitting it as sin + cos, writing it as complex exponentials, etc), I can't seem to get it in a form where plugging in $\omega = 0$ gets me a linear solution.
So my question is this: If I were to prove that the solutions of $x'' = -\omega^2 x$ were exactly those of the form $x = A \cos(\omega t + \phi)$, where and why would the case $\omega = 0$ be eliminated? I'm familiar with the process of solving first-order diffeqs, but I've never actually gone through a proof with a second-order one.
 A: To get a linear solution you need to fix the boundary or initial conditions, for example $x(0)=p, x'(0)=q$
Then if $x''=-\omega^2 x$, your solution for general $\omega \neq 0$ is of the form $A\cos \omega t+B \sin \omega t$
Then we have $A=p, \omega B=q$ so the solution is $$x(t)=p\cos \omega t+\frac q{\omega}\sin \omega t$$
Now using that $\lim _{\omega\to 0} \frac {\sin \omega t}{\omega}=t$, the limit as $\omega \to 0$ is $p+qt$

Let's try the case $x(0)=p, x(1)=q$ from which we derive $A=p$ and  $B=\frac {q-p\cos \omega}{\sin \omega}$ so that $$x(t)=p\cos \omega t+\frac {q-p\cos \omega}{\sin \omega} \sin \omega t$$
Taking the limit as $\omega \to 0$ gives $x(t)=p+(q-p)t$

Note that the case with $+\omega^2$ can be solved straightforwardly with exponentials and limits, or by using the alternative form of solution $x(t)=A\cosh \omega t+B\sinh \omega t$ which is wholly analogous to the trigonometric case with the usual adjustments for the hyperbolic functions.
A: The point is that $0$ is a double root of the characteristic polynomial 
$\lambda^2 + \omega^2$ when $\omega = 0$.  For more on this, you might try
this page of mine
