The dynamics of an electron in the fields associated with a transverse magnetic wave propagating inside circular and elliptical waveguides is analytically studied. The field components of the TMmr mode in the circular and elliptical waveguides are calculated. The relativistic momentum and energy equations are solved for the electron when it is injected along the direction of mode propagation. The deflection angle and the acceleration gradient of the electron during its shift along the waveguide are obtained. Furthermore, it is found that the acceleration gradient and deflection angle depend strongly on the parameters of the microwave and the dimensions of the waveguide. Finally, the cutoff frequency for the two cases of evacuated waveguide and plasma-filled waveguide is calculated.