Dynamic correlations in an electron gas. I. First-order perturbation theory