First-principles calculation of the dynamic structure factor for the electron gas in metallic systems.