In the coherent electron cooling, the modern hadron beam cooling technique, each hadron receives an individual kick from the electric field of the amplified electron density perturbation created in the modulator by this hadron in a copropagating electron beam. We developed a method for computing the dynamics of these density perturbations in an infinite electron plasma with any equilibrium velocity distribution-a possible model for the modulator. We derived analytical expressions for the dynamics of the density perturbations in the Fourier-Laplace domain for a variety of 1D, 2D, and 3D equilibrium distributions of the electron beam. To obtain the space-time dynamics, we employed the fast Fourier transform algorithm. We also found an analytical solution in the space-time domain for the 1D Cauchy equilibrium distribution, which serves as a benchmark for our general approach based on numerical evaluation of the integral transforms and as a fast alternative to the numerical computations. We tested the method for various distributions and initial conditions.