You see that the whole thing oscillates with a period of . That is after time , the mass returns to its initial state. Without any friction this motion will persist indefinitely. After a while it gets a bit boring just staring at it, and you might want to know in more detail how the position of the mass varies with time, and how the period depends on the spring constant and the mass .
Well let's try to figure that out. We start from .
Here . So
The problem with this equation is that the acceleration is not constant, in fact it even changes sign when x changes direction. So we cannot apply to this problem because that formula only applies for constant acceleration. What we'll first do is guess the solution and then after that I'll go through some other ways of getting it that at first might seem a bit tricky but informative.