# Differential equation of a mass on a spring

I have the following differential equation which is motivated by the dynamics of a mass on a spring: $$my'' - ky = 0$$

I split this into a system of equations by letting $x_1=y$ and $x_2=y'$

$$x' = \begin{pmatrix} 0&1\\\dfrac{k}{m}& 0\end{pmatrix}x$$

Find an Eigenvalue: \begin{align} \det(A-\lambda I) =& 0 \\ \det\begin{pmatrix} -\lambda&1\\\dfrac{k}{m}&-\lambda\end{pmatrix} =& 0 \\ \lambda^2 - \dfrac{k}{m} =& 0 \\ \lambda = \pm\sqrt{\dfrac{k}{m}} \end{align}

Find the matching eigenvector:

\begin{align} (A-\lambda I)x =& 0 \\ \begin{pmatrix} -\sqrt{\frac{k}{m}}&1\\\dfrac{k}{m}&-\sqrt{\frac{k}{m}}\end{pmatrix}x =& 0 \end{align}

This matrix is similar to:

$$\begin{pmatrix}-\sqrt{\frac{k}{m}}&1\\0&0\end{pmatrix}x = 0$$

$x_2$ is free so let $x_2$ = 1. We have: \begin{align} -\sqrt{\frac{k}{m}}x_1 + 1 =& 0 \\ x_1 =& \dfrac{1}{\sqrt{\dfrac{k}{m}}} \end{align}

So the corresponding eigenvector is $\begin{pmatrix}\dfrac{1}{\sqrt{\dfrac{k}{m}}}\\1\end{pmatrix}$. Any solution to the vector differential equation $x'=Ax$ is $x = e^{\lambda t}x_0$ where $\lambda$ is an eigenvalue and $x_0$ is the corresponding eigenvector. Our solution is then $$e^{\sqrt{\frac{k}{m}} t}\begin{pmatrix}\dfrac{1}{\sqrt{\dfrac{k}{m}}}\\1\end{pmatrix}$$

I am just using technique I learned in a differential equations book. This doesn't make sense from a physics stand point where solutions should be periodic and thus would have solutions in terms of sines and cosine. Perhaps I did not setup the system correctly, because if I got imaginary eigenvalues then I could have had sines and cosine in my solution.

I want to know what I did wrong, let me know what you think.

• Actually, I just realized it should by $my'' +ky=0$ This would give me imaginary eigenvalues... – CodeKingPlusPlus Jul 5 '13 at 0:17
• Yes, and then you get complex exponentials, which lead to sines and cosines. – André Nicolas Jul 5 '13 at 0:20
• To expand on André's point, if the solution to a homogeneous linear ODE is complex, the real and imaginary parts both form real solutions, as $p(D)[u(t) +iv(t)] = 0$ implies that $p(D)u(t) = 0$ and $p(D)v(t) = 0$ – Matthew Hampsey Jul 5 '13 at 1:59

If we have $$mt^2+k=0, ~~m>0,k>0$$ instead so $t=\pm\sqrt{\frac{k}{m}}i$ which lead us to have $$y_c(x)=C_1\exp\left(\sqrt{\frac{k}{m}}ix\right)+C_2\exp\left(-\sqrt{\frac{k}{m}}ix\right)$$ Now Euler's formula $e^{it}=\cos(t)+i\sin(t)$ can help us to convert the resulted solution to the following tolerable form: $$y_c(x)=C_1\cos\left(\sqrt{\frac{k}{m}}~x\right)+C_2\sin\left(\sqrt{\frac{k}{m}}~x\right)$$
• I agree with Amz...! $\;\;\oplus + \boxplus$ – Namaste Jul 6 '13 at 1:34