# How can I derivate the solution of the under-damped harmonic oscillator?

The equation is $$m\ddot x =-k x -\gamma x$$ Multiply by $1/m$ we get:

$$\ddot x=-\omega_0^2x - \beta x$$

We use the ansatz $x(t)=e^{\lambda t}$

So for the $\lambda_{1,2}$ we get:

$$\lambda_{1,2}=-\frac{\beta}{2} \pm \sqrt{\beta^2/4-\omega_0^2}$$

Under-damping means $\beta<2\omega_0$, so we have an imaginary term under the $\sqrt{.... }$

So: $$\lambda_{1,2}= -\frac{\beta}{2} \pm \sqrt{i^2(\beta^2/4-\omega_0^2)} = -\frac{\beta}{2} \pm i \sqrt{(\beta^2/4-\omega_0^2)}= -\frac{\beta}{2} \pm i \omega$$

Where $\omega=\sqrt{(\beta^2/4-\omega_0^2)}$

The solution for $x(t)$: $$x(t)=A_{+} e^{-\frac{\beta t}{2}} e^{i\omega t} + A_- e^{-\frac{\beta t}{2}}e^{-i\omega t} = e^{-\frac{\beta t}{2}}(A_+ e^{i\omega t} + A_-e^{-i\omega t})$$

The question is, how can I get the following for $x(t)$: $$x(t)=e^{-\frac{\beta t}{2}}(A_1 \cos(\omega t)+A_2 \sin(\omega t))$$

I don't see it, and it's bugging me very much. It stops me from going on with my study.

The key points of your problem are that $A_+$ and $A_-$ are both complex numbers and $A_+e^{i\omega t}+A_-e^{-i\omega t}= \text{Real Number}$, because we can't have a imaginary displacement $x(t)$.
Next, we start to solve your problem from the equation $$x(t)=e^{-\frac{\beta t}{2}}(A_+e^{i\omega t}+A_-e^{-i\omega t})$$ by using Euler's formula $e^{i\theta}=\cos\theta+i\sin\theta$, we have $$A_+e^{i\omega t} =A_+\cos\omega t+iA_+\sin\omega t\\ A_-e^{-i\omega t} =A_-\cos\omega t-iA_-\sin\omega t$$
Then we add above two equations and get $$A_+e^{i\omega t}+A_-e^{-i\omega t}=(A_++A_-)\cos\omega t+i(A_+-A_-)\sin\omega t$$ Because I told you the left side of the above equation is real previously, and $\cos\omega t$, $\sin\omega t$ are both real, we can get $$A_1 =A_++A_-=\text{Real Constant}\\ A_2 =i(A_+-A_-)=\text{Real Constant}$$
Finally, we get the result, $$x(t)=e^{-\frac{\beta t}{2}}(A_1\cos\omega t+A_2\sin\omega t)$$