# Thread: Mass on a spring problem

1. ## Mass on a spring problem

Can someone explain how to solve this? Cheers.

2. 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.

3. 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.

4. 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.

5. 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.