The motion equation of electrons in an axial uniform magnetic field and a longitudinal wiggler
magnetic field is solved. The strict analytical solution of the electron velocity is derived in the rectangular
coordinate system, and the approximate solutions of the electron position in the rectangular or cylindrical
systems are also derived. The solutions are verified by numerical simulation, showing that the approximate
solutions are fairly accurate.