A classical system is described by its Hamiltonian $H$, which is a function of a set of generalized co-ordinates $q_i$ and momenta $p_i$. The canonical equations of motion are
$$
\dot{p}_i=-\frac{\partial H}{\partial q_i}, \quad \dot{q}_i=\frac{\partial H}{\partial p_i} .
$$
Write the equation of continuity for $\rho$, the phase space density, and use it to show that the entropy of this system is constant in time.
Now consider a system whose motion is damped by frictional force. For simplicity, consider a damped harmonic oscillator in one dimension. The equations of motion are
$$
\dot{p}=-k q-\frac{\gamma p}{m}, \quad \dot{q}=\frac{p}{m},
$$
where $m$ is the mass, $k$ is the spring constant, and $\gamma$ is related to the friction, $m, k$ and $\gamma$ being all positive.)
What is the equation of motion for the phase space density $\rho$ ? Show that the entropy is now a decreasing function of time.
Can the last result be reconciled with the second law of thermodynamics?