We construct the exact solution for the time evolution of the local mass density in an ideal gas in which an external short-ranged separable potential is switched on at time t = 0. The redistribution of matter in strong potentials causing bound states or resonances is studied in great numerical detail.