  We investigate the entanglement properties of the nonequilibrium dynamics of
one-dimensional noninteracting Fermi gases released from a trap. The gas of N
particles is initially in the ground state within hard-wall or harmonic traps,
then it expands after dropping the trap. We compute the time dependence of the
von Neumann and Renyi entanglement entropies and the particle fluctuations of
spatial intervals around the original trap, in the limit of a large number N of
particles. The results for these observables apply to one-dimensional gases of
impenetrable bosons as well.
  We identify different dynamical regimes at small and large times, depending
also on the initial condition, whether it is that of a hard-wall or harmonic
trap. In particular, we analytically show that the expansion from hard-wall
traps is characterized by the asymptotic small-time behavior $S \approx
(1/3)\ln(1/t)$ of the von Neumann entanglement entropy, and the relation
$S\approx \pi^2 V/3$ where V is the particle variance, which are analogous to
the equilibrium behaviors whose leading logarithms are essentially determined
by the corresponding conformal field theory with central charge $c=1$. The time
dependence of the entanglement entropy of extended regions during the expansion
from harmonic traps shows the remarkable property that it can be expressed as a
global time-dependent rescaling of the space dependence of the initial
equilibrium entanglement entropy.
