Damped harmonic oscillator derivation