Derivation of the equation of motion of a body oscillating in a viscous medium