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, N, independent of t, is still a solution.
In our mathematical toolbox we have the exponential function, which has the property that its derivative is equal to the function itself multiplied by the derivative of the exponent.
For the second derivative we can write, using the chain rule,

Thus we can propose the function u = N et as the solution we are looking for. All we need to do now is determine what t should be. From the equation of motion we see that the part between the square brackets has to be independent of t. This means that the first derivative of t to t needs to be independent of t, so we use t = Wt + f. Now we can write for our solution
Filling this out in the equation of motion we get
and we find that

where i2 = -1, and
Note that we have found two possible solutions to the differential equation, one for which W is positive, and another one for which it is negative. We will denote these solutions with subscripts of + and - respectively:
Since we now have a complex exponential, we should allow f to be complex valued as well. So we set f+ = g+ + ij+. Since j can be any value, we can arbitrarily choose its sign and use for f- = g- - ij- . This way we can write
Each of these solutions is a solution to the differential equation we set out to solve. This means that any linear combination of these two is a solution also. Since our physical world consists of real valued observations, we should combine these two solutions so as to give a function that is only real. Thus we should select a linear combination that makes the imaginary parts cancel.
Making use of Euler's formula
In solving our second order differential equation we implicitly integrate the equation two times to get the solution. This means that we need to have two constants of integration, and two boundary or initial conditions that will fix the values of these constants. At the moment we have four constants, two for each of the two functions we have. Thus we can force relationships between them, as long as we keep two variables. For these we choose j+= j- = j0 and N'+= N'- = A/2, and add u-to u+ to get u

and we finally get
We could also have subtracted the two equations and divided by 2i to get rid of the imaginary parts. This would have given us a sine in stead of the cosine. This is really the same solution, since by choosing j to be 90o different, the cosine can be transformed into a sine, and the initial condition will really determine what that phase angle should be.
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.