(D2)x/dt ^ 2+(k/m)x = 0。 Solve this differential equation to get the displacement x, then take the derivative of x to get the velocity v, and finally take the derivative of v to get a.
If a is known, the velocity v can be obtained by integrating a, and then the displacement x can be obtained by integrating v.