$$ m\ddot x - kx=0 $$
To solve this, guess $x=e^{i \omega t}$. Here, $\omega \in \mathbb R$, but more generally when we are solving oscillations problem, $\omega \in \mathbb C$. Substituting this solution into the problem gives $\omega = \pm \sqrt{k/m}$.
Hence, the general solution is a superposition of the two particular solutions: $x = A e^{i \omega_0 t} + B e^{-i \omega_0 t}$, where $\omega_0 \equiv \sqrt{k/m}$. Note that $A, B \in \mathbb C$. Taking the real component of the complex solution gives the real solution (of course).
Since $A, B \in \mathbb C$, it may seem like there are 4 quantities that describe the state of the oscillator. This makes sense, because that is true in the complex plane. However, when we expand the complex solution and recover the real part, we notice that there are actually only 2 independent quantities needed to specify the initial conditions in the real solution (see knzhou M1 P4). It turns out that we can set $B=0$, and only use $A$. Then, $A$ essentially represents the initial conditions of the oscillator. If we write $A$ in polar form $A = |A| e^{- i \phi}$, the solution becomes $x = |A| e^{i(\omega t - \phi)}$, so $\Re(x) = |A| \cos(\omega t - \phi)$. Essentially, $A$ encodes the amplitude of the oscillation and the initial phase.
More generally, guessing $x = e^{i \omega t}$ where $\omega \in \mathbb C$ works for any linear, time-translation invariant differential equation, including the damped oscillator.
$$ m \ddot x + b \dot x + kx =0 $$
Again, there are two solutions for $\omega$. Depending on the values of the system parameters, $\omega$ can be complex or purely imaginary.
$$ m \ddot x + b \dot x + kx = F_0 e^{i \omega t} $$
Unlike in previous problems, here $\omega$ is a given quantity, not something you solve for. In addition, this is no longer a linear differential equation, so we can no longer just guess $x= e^{i \omega t}$. However, it is still solvable with a modified guess. Now, we guess $x = A_0 e^{i \omega t}$, where $A_0 \in \mathbb C$, and solve for $A_0$. Here $A_0$ encodes the initial conditions, just like $A$ when we analysed the classical oscillator.
To be continued