Solution (source code)

= Solution

For the <damped harmonic oscillator>, the <characteristic polynomial> is $r^2+2\gamma r+\omega_0^2$. When $0\le\gamma<\omega_0$, its roots are $-\gamma\pm i\Omega$, with $\Omega=\sqrt{\omega_0^2-\gamma^2}$. Thus
$$
\boxed{x(t)=e^{-\gamma t}\bigl(A\cos\Omega t+B\sin\Omega t\bigr).}
$$
Here $A$ and $B$ are arbitrary real constants. The frequency is $\Omega$, and the amplitude envelope decays with time constant $1/\gamma$ when $\gamma>0$; the zero-damping limit recovers <simple harmonic motion>.