# 2nd order ODE

## Main Question or Discussion Point

greetings

Is there any way how to analytically solve the differential equation for harmonic oscillations ?

x'' + (kx)/m=0
where m is the mass and k is the spring constant

thanks

Related Differential Equations News on Phys.org
I would substitute x(t)=A*e^(rt) into the ode factor out x(t) and solve for r.

Thanks for the advice .... after five minutes of playing with it I figured out that we should substitute x(t)=A*e^(i*omega*t) and than all fits perfectly the equation is satisfied, the angular f turns out to be Sqrt(k/m) and the solution x(t)=Acos(omega*t)+iAsin(omega*t) .... However I'm still not sure about that i in the front of the sine. does it change anything ?

you have it pretty much solved. Just two "minor" things. When you take the square root there should be a plus minus sign in front of the square root. Therefore, it should be x(t)=A*e^(i*omega*t)+B*e^(-i*omega*t). After some minor manipulation this can be rewritten as x(t)=a*cos(omega*t)+b*sin(omega*t)

i is just another constant. So you can rewrite i*A = constant. It's no different from multiplying an arbitrary constant by 2. For example, let's say i*A=-2...then to make that happen A=-2/i. The presence of the i doesn't prevent i*A from equalling an arbitrary constant. I hope I didn't make that sound more complicated than it actually is.

thanks ... I've done it that way (with the square root of a square) when I was trying to substitute x(t)=A*e^(rt) unfortunately I'm too lazy and forgot about that later :D .... thanx anyway