Аннотация:We develop the Hamilton–Jacobi theory in a generalized sense for a classical particle interacting with a thermal bath. It is shown that such a formulation of the theory of Brownian motion naturally leads to the Smoluchowski equation and allows one to easily obtain its following approximations. The proposed approach is developed for extensive and non-extensive statistics. Using the developed Hamilton–Jacobi theory for a classical particle, a general method for constructing equations of the theory of Brownian motion of quantum particles for extensive and non-extensive statistics is proposed. Using developed approach, we derive nonlinear Schrodinger equations, first introduced by Chavanis, which play the role of quantum versions of the Smoluchowski equation. As an example, using the obtained nonlinear Schrodinger equations, the thermostatistics of a quantum harmonic oscillator and the thermostatistics of a quantum particle in an infinite potential well are considered. The obtained solution for a quantum harmonic oscillator is compared with the well-known Bloch distribution. We show that the obtained equations of Brownian motion (both classical and quantum particles) can be derived from a variational principle that combines two basic variational principles of physics: the least action principle in mechanics and the principle of maximum entropy in thermodynamics.