We are looking for a function whose second derivative to time is proportional to the function itself
Note that any solution to this expression multiplied by a constant, A, independent of t, is still a solution.
In our mathematical toolbox we have the trigonometric functions sine and cosine, which have the property that their derivative are a trigonometric function multiplied by the derivative of the argument, i.e.,

For the second derivative we can write, using the chain rule,

By comparing either of these two second derivative expressions with the second order differential equation we are trying to solve, we see that the requirements for these functions to be solutions are:
where w is an angular velocity (frequency) and f0, the constant of the integration, an initial phase. The naming of angular velocity and initial phase reflect the use of this expression in the oscillatory sine and cosine functions.
Combining these requirements with the earlier observation that any solution may be muliplied by an arbitrary constant, A, and still be a solution, we find that both
are valid solutions, as long as
The subscripted label s and c in the initial phase, f0 serve to distinguish between the two, at this point, freely choosable constants of integration.
It seems that we now have two different solutions to the problem. Closer inspection of the behavior of the sine and cosine functions shows that this is not really the case. The relationship
conveys the fact that the sine function and cosine function are really the same function but only have an inherent phase offset of p/2 radians (or 90 degrees). This means that we can choose f0,s = f0+ p/2 so that we can rewrite the sine solution as
which is equation to the cosine solution, in which we use f0,c= f0.
The amplitude and initial phase angle can be determined from two independent initial conditions of the system. Since we are looking at the time evolution of the position, it makes sense to use the initial position at t = 0 and the velocity, du/dt at t = 0. Thus by simultaneously solving

the values for A and j0 can be found.