After some hours without a solution I came here to ask how to integrate directly this equation:
$$ m{\frac {\mathrm {d} ^{2}x}{\mathrm {d} t^{2}}} = -kx $$
The conditions are: $$ x(0) = 0 $$
and
$$ \frac{\mathrm {d}x}{\mathrm {d}t}\Big|_{t=0} = 0 $$
This is about physics, but I what I can not handle is the mathematical part, so I came to ask here.
Would you help me?
Let's multiply both sides by $x'$, then
$$x'(t)x''(t) = -\frac{k}{m} x(t)x'(t).$$
This can be realized as
$$ \frac{1}{2}\frac{d}{dt} (x'(t))^2 = -\frac{k}{2m} \frac{d}{dt}(x(t))^2. $$
Integrating, using your initial conditions, and canceling the factor of $\frac{1}{2}$ this becomes
$$ (x'(t))^2 = -\frac{k}{m} (x(t))^2. $$
Moving the $(x(t))^2$ to the other side, we get
$$\left(\frac{x'(t)}{x(t)}\right)^2 = -\frac{k}{m}.$$
Square rooting,
$$\frac{x'(t)}{x(t)} = \pm i\sqrt{\frac{k}{m}}.$$
The left hand side can be recognized as $\frac{d}{dx} \log(x(t))$ so we can rewrite this as
$$ \frac{d}{dx} \log(x(t)) = \pm i \sqrt{\frac{k}{m}}.$$
Integrating both sides, then exponentiating we get
$$ x(t) = A\exp\left(\pm i \sqrt{\frac{k}{m}}\right).$$
There are details left out ensuring that things are well-defined in places which you are more than welcome to work out. This is meant as a guide, not a full foolproof proof.