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.