Remember that all linear differential equations can be solved by guessing $x=e^{\omega t}$ then doing a superposition of all solutions. The main reason this works is that when the real part of the equation is satisfied, so will the imaginary part. Do note that when calculating non-linear quantities (like energy), you have to take the real part first.

A mass on a spring still undergoes SHM when hung vertically, but has a center of oscillation deflected by $mg/k$

Simple oscillator

If a potential function can be expanded into a Taylor series with a quadratic term, then we can get the frequency of small oscillations about equilibrium.

$$ \omega = \sqrt{\frac{U''(r)}{m}} $$

More generally, if we have a complex system with something other than a point particle, if we can write

$$ K=\frac{1}{2}m_{eff}\dot q^2, \quad V=\frac{1}{2}k_{eff}q^2 $$

this is a harmonic oscillator with

$$ \omega=\sqrt{\frac{k_{eff}}{m_{eff}}} $$

Damped oscillator

$$ m\ddot x+b\dot x+kx=0 $$

Guessing $x=e^{\omega t}$, the solution to $\omega$ looks like the solution to a quadratic: (because it is):

$$ \omega = -\frac{b}{2m} \pm\sqrt{\frac{b^2}{4m^2}-\frac{k}{m}}=-\frac{b}{2m} \pm i\sqrt{\frac{k}{m} -\frac{b^2}{4m^2}} $$

Forced oscillator

$$ m\ddot x+b\dot x+kx= F_0e^{i\omega t} $$

Now, we have to guess $x=Ae^{i\omega t}$ instead, and solve for $A$.

Coupled oscillators and Normal modes

A system of oscillators with $N$ degrees of freedom has $N$ normal modes when displaced from equilibrium, where all particles oscillate at the same frequency (in a specific normal mode).

How do I know how many degrees of freedom there are?

To find normal modes, there are 3 methods with increasing generality: