Analytical study of the equation for the longitudinal motion of particles in a radio-frequency-quadrupole accelerator