# Deriving the equation for simple harmonic motion.

I am trying to derive the solution to the equation of simple harmonic motion without guessing the sin/cos result. I know I have seen this proof somewhere, but I can't find anything about it online. All I can find are sources using the guessing technique.

In a nutshell, I would be grateful if someone could point me in the direction of a proof that the most general solution to

$$\frac{d^2x}{dt^2} - k^2x =0$$

is

$$x(t)= A \cos(kt+\phi) = B\cos(kt) + C\sin(kt)$$

Hint: A good start should be writing the simple harmonic motion equation correctly

$$\frac{d^2}{dt^2} x(t) + \frac{k}{m} x(t) = 0$$

Thus writing $x(t) = e^{rt}$ you should find $r^2 + k/m = 0$ which implies $r = \pm i\sqrt{\frac{k}{m}}$. Now remember that $$e^{\mu it} = \cos (\mu t ) + i \sin (\mu t)$$ and that combinations of such are also solutions.

• Thank you for your reply! Is there a reason why we would write $x(t)=e^{rt}$? Is that not already guessing some solutions? – Meep Dec 9 '16 at 17:36
• @21joanna12 yep, it's totally guessing. Educated guessing that is. Note that differentiating the exponential gives itself up to constant factor, which matches the form your differential equation is (look at the left hand side). A lot of solving differential equations is guessing and checking! For example, look up the Method of Undetermined Coefficients. Educated guesses of course, but still guesses :) – Brevan Ellefsen Dec 9 '16 at 17:56
• The reason is how the derivative of $e^{rt}$ behaves. And yes, you work out different methods to give solutions to each ODE. Most of which are based on good guesses. – Aaron Maroja Dec 9 '16 at 17:56

If $x'' + ax = 0$, multiplying by $x'$, $x'x'' + axx' = 0$, or $2x'x'' + 2axx' = 0$, or $(x'^2)' + a (x^2)' = 0$.

Integrating, $x'^2+ax^2 = c$.

There a number of ways to solve this.

• Hi Marty Cohen, thank you for your reply! Could you give some names of techniques used to solve the above so I can look them up? I have never seen an equation like this with derivatives being squared before. – Meep Dec 9 '16 at 18:21