# Recirculated Wave Undulators for Compact FELs
## 4 Dynamics of Relativistic Electrons Inside an Electromagnetic Undulator  
In this section, we calculate the electron trajectories from first principles of relativistic mechanics when they interact with an electromagnetic plane wave. The formalism of Hamilton-Jacobi will be adopted here, as in [32]. The four-dimensional form of Hamilton-Jacobi equation for the interaction of our interest is:  
\[g^{ik}\bigg{(}\frac{\partial S}{\partial x^{i}}-\frac{e}{c}A_{i}\bigg{)}\left( \frac{\partial S}{\partial x^{k}}-\frac{e}{c}A_{k}\right)=m^{2}c^{2} \tag{12}\]  
where \(g^{ik}\) is the Minkowski tensor with \((1,3)\) signature, \(S\) the Hamilton function, \(x^{i}\) the radius four-vector. We make explicit the planar symmetry in the argument of the four-vector potential by setting \(A_{i}\equiv A_{i}(\xi)\), with \(\xi=k_{i}x^{i}=\omega_{0}(t+z/c)\), where the sign \(+\) in the phase expression stands for the head-on interaction on the \(z\)-direction; then we impose the Lorentz gauge condition:  
\[\frac{\partial A^{i}}{\partial x^{i}}=\frac{\partial A^{i}}{\partial\xi}k_{i}=0 \tag{13}\]  
that is equivalent to \(A^{i}k_{i}=0\). To find the Hamilton principal function, we look for a solution of the kind:  
\[S=-p_{i}x^{i}+F(\xi) \tag{14}\]  
Figure 2: Evolution of the longitudinal phase-space of the electron beam passing from one interaction point to the other. The evolution through the magnetic chicane is calculated via the analytic solution of the Liouville equation. The longitudinal phase spaces shown above will be commented in Section 8.  
where \(p_{i}\) is the four-vector who satisfies the condition \(p_{i}p^{i}=m^{2}c^{2}\), and \(F(\xi)\) is an unknown function to determine. Substituting (14) into (12) yields:  
\[2\eta\frac{\partial F}{\partial\xi}+2\frac{e}{c}p_{i}A^{i}-\frac{e^{2}}{c^{2}} A_{i}A^{i}=0 \tag{15}\]  
where \(\eta=p_{i}k^{i}\). From the above we can infer the expression for \(F\) and therefore for \(S\):  
\[S=-p_{i}x^{i}-\frac{ep_{i}}{\eta}\int A^{i}d\xi+\frac{e^{2}}{2\eta}\int A^{i}A _{i}d\xi \tag{16}\]  
Being \(k^{i}=(\omega_{0}/c,0,0,-\omega_{0}/c)\) with \(\omega_{0}=2\pi c/\lambda_{0}\), we obtain \(\eta=(\omega_{0}/c)(p_{0}+p_{3})\). Expanding the square of \(p_{i}\), we obtain \(p_{0}^{2}-p_{3}^{2}-p_{\perp 0}^{2}=m^{2}c^{2}\), where we have denoted by \(p_{\perp 0}\) the modulus of the generalized transverse four-momentum: \(\vec{p}_{\perp 0}\) is a constant of motion, and it will be naturally interpreted as the electron initial transverse moment just before impacting on the photons. It is straightforward to deduce at this point the following equation:  
\[p_{0}-p_{3}=\Big{(}\frac{\omega_{0}}{c}\Big{)}\frac{p_{\perp 0}^{2}+m^{2}c^{2} }{\eta} \tag{17}\]  
Now, by means of the algebra below:  
\[p^{3}x^{3}-p^{0}x^{0}=\frac{(p^{3}+p^{0})(x^{3}-x^{0})}{2}+\frac{(p^{3}-p^{0}) (x^{3}+x^{0})}{2} \tag{18}\]  
and using Equations (16) and (17), one obtains the following expression for \(S\):  
\[S=\vec{p}_{\perp 0}\cdot\vec{r}_{\perp}-\frac{c\eta}{2\omega_{0}}(ct-z)-\frac{p_ {\perp 0}^{2}+m^{2}c^{2}}{2\eta}\xi-\frac{ep_{i}}{\eta}\int A^{i}d\xi+\frac{e ^{2}}{2\eta}\int A_{i}A^{i}d\xi \tag{19}\]  
By equating the S derivatives with respect to the \(\vec{p}_{\perp 0}\) components and to the \(\eta\) parameter to zero, valid for a suitable choice of reference frame, we achieve the useful results for the electron trajectories:  
\[\vec{r}_{\perp} = \frac{\vec{p}_{\perp 0}}{\eta}\xi+\frac{e}{\eta}\int\vec{A}d\xi\] \[\frac{\partial A^{i}}{\partial x^{i}}=\frac{\partial A^{i}}{\partial\xi}k_{i}=0 \tag{13}\]0  
Carrying out the time derivative \(\partial S/\partial t=-\gamma(t)mc^{2}\), yields an expression for the invariant \(\eta\), evaluated at the origin of times: \(\eta=(\omega_{0}/c)(\gamma_{0}mc+p_{z0})\), with \(\gamma_{0}\) the initial Lorentz factor. Equations (20) describe the motion of a free electron under the influence of the wave undulator.