Trouble solving a second-order differential equation I've solved some first-order equations and now, in physics, I came across such an equation for the harmonic motion.
$\frac{d^2x}{dt^2} = -\omega^2x$ 
How can I find all functions $x = f(t)$ satisfying this equation? I tried the usual first-order methods, but I failed.
Thanks!
 A: Assuming, as you state, that you can solve first degree equations, here is a way of converting one second degree equation into two first degree ones.
Note that:
$$x''-i\omega x'=-i\omega x'-\omega^2 x$$ so setting $y=x'-i\omega x$ this gives the linear equation $y'=-i\omega y$ with the solution $y=Ae^{-i\omega t}$
Also note:$$x''+i\omega x'=i\omega x'-\omega^2 x$$ and set $z=x'+i\omega x$ to obtain $z'=i\omega z$ and $z=Be^{i\omega t}$
Then note that $$z-y=2i\omega x = Be^{i\omega t}-Ae^{-i\omega t}$$
Incorporating $2i\omega$ into the constants this gives $$x=Ce^{i\omega t}+De^{-i\omega t}=E\sin \omega t+F\cos \omega t$$
(the last formulation arises from the formulae for sin and cos in terms of complex exponentials)

Note that in general the second degree equation $$x''=(a+b)x'-abx$$ can be rewritten as $$x''-ax'=bx'-abx$$ and $$x''-bx'=ax'-abx$$
and the same technique can be applied. This does not work when $a=b$ (you get one linear equation repeated twice) and you might want to investigate this possibility further.
A: The characteristic equation $r^2=-\omega^2$ has the roots $r=\pm i\omega$ so the solutions of the ODE is
$$x(t)=a\cos(\omega t)+b\sin(\omega t)$$ 
A: $$\frac{d^2x}{dt^2} = -\omega^2x$$ Substitute $$\frac{dx}{dt}=y$$ then $$\frac{d^2x}{dt^2} =\dfrac{dy}{dt}=\dfrac{dy}{dx}\dfrac{dx}{dt}=y\dfrac{dy}{dx}.$$ Hence $$y\dfrac{dy}{dx}=-\omega^2x.$$ I think you can solve this separable first order equation for $y.$ Then use it for obtaining $x$ in terms of $t.$
EDIT: Suppose when $x=a,$ we have  $y=0.$ Then $$y^2=\omega^2(a^2-x^2)$$ $$y=\omega\sqrt{a^2-x^2}$$ Her I omitted the $-$ sign of square root. If you want you can add it to your calculations. Now $$\frac{dx}{dt}=\omega\sqrt{a^2-x^2}.$$ Again a separable first order differential equation.
CASE $1:$ $a\not=0$ $$\dfrac{dx}{\sqrt{a^2-x^2}}=\omega dt$$ $$\arcsin \dfrac{x}{a}=\omega t+b$$  $$x=a\sin(\omega t+b)$$  
CASE $2:$ $a=0$ $$\dfrac{dx}{x}=i\omega dt$$ $$\ln x=i\omega t+\ln b$$  $$x=be^{i\omega t}$$
More generally, Always you have a solution of the form $$x=A\sin \omega t+B\cos \omega t.$$
