# Mass on a spring problem

• December 4th 2009, 11:41 AM
Haris
Mass on a spring problem
http://img207.imageshack.us/img207/1980/ode.png
Can someone explain how to solve this? Cheers.
• December 4th 2009, 02:59 PM
lvleph
You will need to solve the homogeneous problem
$\frac{d^2x}{dt^2} + w^2x = 0$
Then you will find a particular solution you can do this using the method of undetermined coefficients. Then you add the two solutions together.
• December 5th 2009, 07:31 AM
Haris
Can you explain how to find the C.F.? Apparently its x=cos(wt)+sin(wt) ? I don't know how they got that answer though.
• December 5th 2009, 08:02 AM
lvleph
Okay, I will go through the particular solution first. I will let $x_p$ denote the particular solution. Since the nonhomogeneous part is a trigonometric function we will let the particular solution be of the form $x_p = A\sin \gamma t + B\cos \gamma t$. Now we must determine the coefficients $A,B$. To do this we will plug $x_p$ back into the original DEQ.
$x''_p = -\gamma^2 A \sin \gamma t - \gamma^2 B \cos \gamma t$
and so
$-\gamma^2 A \sin \gamma t - \gamma^2 B \cos \gamma t + w^2 \cdot \left( A\sin \gamma t + B\cos \gamma t \right) = \cos \gamma t$
$\left(w^2 -\gamma^2\right) A \sin \gamma t + \left(w^2 - \gamma^2\right) B \cos \gamma t = \cos \gamma t$.
Thus we have
$\left(w^2 - \gamma^2\right)A \sin \gamma t = 0$
and
$\left(w^2 - \gamma^2\right)B \cos\gamma t = \cos \gamma t$.
Therefore, we have
$\left(w^2 - \gamma^2\right)A = 0$
and
$\left(w^2 - \gamma^2\right)B = 1$,
so
$A = 0$
$B = \frac{1}{w^2 - \gamma^2}$.
Finally, we see that our particular solution is
$x_p = \frac{1}{w^2 - \gamma^2} \cos \gamma t$.

Deleted mistake see following post.
• December 5th 2009, 08:15 AM
lvleph
Sorry I made a mistake. The homogeneous solution is wrong. The solution of the characteristic equation is not $\lambda = \pm w$. The solution is $\lambda = \pm w i$.
Therefore, the homogeneous solution is of the form
$x_h = C_1\cos w t + C_2 \sin w t$.
Finally, the general solution should be
$x(t) = C_1\cos w t + C_2 \sin w t + \frac{1}{w^2 - \gamma^2} \cos \gamma t$.
To determine the constants $C_1,C_2$ we must have initial conditions.