# Simple harmonic motion equation [duplicate]

I don't really understand this equation and was wondering if someone could help.

The book says

when the restoring force is directly proportional to the displacement the oscillation is called SHM.

and this next part confuses me

the acceleration $a =d^2x/dt^2 = -kx/m$ so it makes sense since the second derivative of position is acc.

but how do they get that last expression?

## marked as duplicate by Rob Jeffries, ACuriousMind♦, Kyle Kanos, garyp, BMSNov 9 '14 at 4:43

For an ideal spring $F_{\text{spring}} = -kx.$
$$F_{\text{total}}=F_{\text{spring}}=ma\Rightarrow -kx =ma \Rightarrow a=-\dfrac{k}{m}x.$$