  The microscopic approach was developed for obtaining of the free energy of a
superconductor with help direct calculation of the vacuum amplitude. The
functional of free energy of the spatially inhomogeneous superconductor in a
magnetic field was obtained with help the developed approach. The obtained
functional is generalization of Ginzburg-Landau functionals for any
temperature, for arbitrary spatial variations of the order parameter and for
the nonlocality of the order parameter and the magnetic response. Moreover the
nonlocality of the magnetic response is the consequence of the order
parameter's nonlocality. The extremals of this functional are considered in the
explicit form in the low-temperature limit and in the high-temperature limit at
the condition of slowness of spatial variations of the order parameter.
