# How does one get the solution to the differential equation for SHM?

1. Apr 6, 2013

### mahrap

I understand the derivation for the simple harmonic motion equation:

F = -kx ( in a 1-D case)

acceleration = x''(t) = (-k/m)x

so x''(t) + (k/m)x = 0

But why is the solution to this equation

x = A cos (wt + ∅ )

How does one come up with this solution? I tried understanding this by reading my textbook however I get very confused. Any help is appreciated. Thank you.

Last edited: Apr 6, 2013
2. Apr 6, 2013

### Staff: Mentor

I think initially

ei k θ

Is the real basis of the solution.

That's because e^x is its own derivative.

Euler's equation relates e^i theta to sin and cos functions hence the solution you see.

3. Apr 6, 2013

4. Apr 7, 2013

### HomogenousCow

You basically guess that the solution is an exponential because of the form of the DE. So something along the lines of A_e^-wx+B_e^wx, and then you discover that w is complex and you rewrite those complex exponentials into sines and cosines with eulers equation.

5. Apr 7, 2013

### Staff: Mentor

Guess and check. Unfortunately, that is one of the most effective ways of coming up with solutions to differential equations. Computers can be helpful with that, they aren't as good at the guessing part, but they can do the checking part very quickly.

6. Apr 7, 2013

### BruceW

@mahrap: You don't have to guess. If you enjoy eigenvectors and all that stuff, then it follows naturally. But if you are learning this the first time, then maybe it is too long a detour. That is probably why your textbook is giving a weird explanation. They want to reassure you that there is a proper way to get the answer, but it would take up too much writing to actually explain it.