Analytical study of the swing-by maneuver in an elliptical system