  Building on the discussion in PRA 93, 042510 (2016), we present a systematic
derivation of gradient corrections to the kinetic-energy functional and the
one-particle density, in particular for two-dimensional systems. We derive the
leading gradient corrections from a semiclassical expansion based on Wigner's
phase space formalism and demonstrate that the semiclassical kinetic-energy
density functional at zero temperature cannot be evaluated unambiguously. In
contrast, a density-potential functional description that effectively
incorporates interactions provides unambiguous gradient corrections. Employing
an averaging procedure that involves Airy functions, thereby partially
resumming higher-order gradient corrections, we facilitate a smooth transition
of the particle density into the classically forbidden region of arbitrary
smooth potentials. We find excellent agreement of the semiclassical
Airy-averaged particle densities with the exact densities for very low but
finite temperatures, illustrated for a Fermi gas with harmonic potential
energy. We furthermore provide criteria for the applicability of the
semiclassical expansions at low temperatures. Finally, we derive a well-behaved
ground-state kinetic-energy functional, which improves on the Thomas-Fermi
approximation.
