Relativistic Lagrangian mechanics

In theoretical physics, relativistic Lagrangian mechanics is Lagrangian mechanics applied in the context of special relativity and general relativity.

Introduction
The relativistic Lagrangian can be derived in relativistic mechanics to be of the form:
 * $$L = -\frac{m_0 c^2}{\gamma(\dot{\mathbf{r}})} - V(\mathbf{r}, \dot{\mathbf{r}}, t) \,.$$

Although, unlike non-relativistic mechanics, the relativistic Lagrangian is not expressed as difference of kinetic energy with potential energy, the relativistic Hamiltonian corresponds to total energy in a similar manner but without including rest energy. The form of the Lagrangian also makes the relativistic action functional proportional to the proper time of the path in spacetime.

In covariant form, the Lagrangian is taken to be:
 * $$\Lambda = g_{\alpha\beta}\frac{d x^\alpha}{d\sigma} \frac{d x^\beta}{d\sigma} ,$$

where σ is an affine parameter which parametrizes the spacetime curve.

Lagrangian formulation in special relativity
Lagrangian mechanics can be formulated in special relativity as follows. Consider one particle (N particles are considered later).

Coordinate formulation
If a system is described by a Lagrangian L, the Euler–Lagrange equations
 * $$\frac{d}{dt}\frac{\partial L}{\partial \dot{\mathbf{r}}} = \frac{\partial L}{\partial \mathbf{r}} $$

retain their form in special relativity, provided the Lagrangian generates equations of motion consistent with special relativity. Here r = (x, y, z)/is the position vector of the particle as measured in some lab frame where Cartesian coordinates are used for simplicity, and
 * $$\mathbf{v} = \dot{\mathbf{r}} = \frac{d\mathbf{r}}{dt} = \left(\frac{dx}{dt},\frac{dy}{dt},\frac{dz}{dt}\right) $$

is the coordinate velocity, the derivative of position r with respect to coordinate time t. (Throughout this article, overdots are with respect to coordinate time, not proper time). It is possible to transform the position coordinates to generalized coordinates exactly as in non-relativistic mechanics, r = r(q, t). Taking the total differential of r obtains the transformation of velocity v to the generalized coordinates, generalized velocities, and coordinate time
 * $$\mathbf{v} = \sum_{j=1}^n \frac{\partial \mathbf{r}}{\partial q_j}\dot{q}_j +\frac{\partial \mathbf{r}}{\partial t} \,, \quad \dot{q}_j = \frac{dq_j}{dt} $$

remains the same. However, the energy of a moving particle is different from non-relativistic mechanics. It is instructive to look at the total relativistic energy of a free test particle. An observer in the lab frame defines events by coordinates r and coordinate time t, and measures the particle to have coordinate velocity v = dr/dt. By contrast, an observer moving with the particle will record a different time, this is the proper time, τ. Expanding in a power series, the first term is the particle's rest energy, plus its non-relativistic kinetic energy, followed by higher order relativistic corrections;
 * $$E = m_0 c^2 \frac{dt}{d \tau} = \frac{m_0 c^2}{\sqrt {1 - \frac{\dot{\mathbf{r}}^2 (t)}{c^2}}} = m_0 c^2 + {1 \over 2} m_0 \dot{\mathbf{r}}^2 (t) + {3 \over 8} m_0 \frac{\dot{\mathbf{r}}^4(t)}{c^2} + \cdots \,,$$

where c is the speed of light in vacuum. The differentials in t and τ are related by the Lorentz factor γ,
 * $$dt=\gamma(\dot{\mathbf{r}})d\tau \,, \quad \gamma(\dot{\mathbf{r}}) = \frac{1}{\sqrt{1-\frac{\dot{\mathbf{r}}^2}{c^2}}} \,,\quad \dot{\mathbf{r}} = \frac{d\mathbf{r}}{dt} \,, \quad \dot{\mathbf{r}}^2 (t) = \dot{\mathbf{r}}(t) \cdot \dot{\mathbf{r}}(t)\,.$$

where · is the dot product. The relativistic kinetic energy for an uncharged particle of rest mass m0 is
 * $$T = (\gamma(\dot{\mathbf{r}}) - 1)m_0c^2 $$

and we may naïvely guess the relativistic Lagrangian for a particle to be this relativistic kinetic energy minus the potential energy. However, even for a free particle for which V = 0, this is wrong. Following the non-relativistic approach, we expect the derivative of this seemingly correct Lagrangian with respect to the velocity to be the relativistic momentum, which it is not.

The definition of a generalized momentum can be retained, and the advantageous connection between cyclic coordinates and conserved quantities will continue to apply. The momenta can be used to "reverse-engineer" the Lagrangian. For the case of the free massive particle, in Cartesian coordinates, the x component of relativistic momentum is
 * $$p_x = \frac{\partial L}{\partial \dot{x}} = \gamma(\dot{\mathbf{r}})m_0 \dot{x}\,,\quad$$

and similarly for the y and z components. Integrating this equation with respect to dx/dt gives
 * $$L = -\frac{m_0c^2}{\gamma(\dot{\mathbf{r}})} + X(\dot{y},\dot{z}) \,, $$

where X is an arbitrary function of dy/dt and dz/dt from the integration. Integrating py and pz obtains similarly
 * $$L = -\frac{m_0c^2}{\gamma(\dot{\mathbf{r}})} + Y(\dot{x},\dot{z}) \,,\quad L = -\frac{m_0c^2}{\gamma(\dot{\mathbf{r}})} + Z(\dot{x},\dot{y}) \,, $$

where Y and Z are arbitrary functions of their indicated variables. Since the functions X, Y, Z are arbitrary, without loss of generality we can conclude the common solution to these integrals, a possible Lagrangian that will correctly generate all the components of relativistic momentum, is
 * $$L = -\frac{m_0c^2}{\gamma(\dot{\mathbf{r}})}\,,$$

where X = Y = Z = 0.

Alternatively, since we wish to build a Lagrangian out of relativistically invariant quantities, take the action as proportional to the integral of the Lorentz invariant line element in spacetime, the length of the particle's world line between proper times τ1 and τ2,
 * $$S = \varepsilon \int_{\tau_1}^{\tau_2} d\tau = \varepsilon \int_{t_1}^{t_2} \frac{dt}{\gamma(\dot{\mathbf{r}})} \,,\quad L = \frac{\varepsilon}{\gamma(\dot{\mathbf{r}})} = \varepsilon\sqrt{1-\frac{\dot{\mathbf{r}}^2}{c^2}}\,,$$

where ε is a constant to be found, and after converting the proper time of the particle to the coordinate time as measured in the lab frame, the integrand is the Lagrangian by definition. The momentum must be the relativistic momentum,
 * $$\mathbf{p} = \frac{\partial L}{\partial \dot{\mathbf{r}}} = \left(\frac{- \varepsilon}{c^2}\right)\gamma(\dot{\mathbf{r}})\dot{\mathbf{r}} = m_0 \gamma(\dot{\mathbf{r}})\dot{\mathbf{r}} \,,$$

which requires ε = −m0c2, in agreement with the previously obtained Lagrangian.

Either way, the position vector r is absent from the Lagrangian and therefore cyclic, so the Euler–Lagrange equations are consistent with the constancy of relativistic momentum,
 * $$\frac{d}{dt}\frac{\partial L}{\partial \dot{\mathbf{r}}} = \frac{\partial L}{\partial \mathbf{r}} \quad \Rightarrow \quad \frac{d}{dt} (m_0 \gamma(\dot{\mathbf{r}})\dot{\mathbf{r}} ) = 0 \,, $$

which must be the case for a free particle. Also, expanding the relativistic free particle Lagrangian in a power series to first order in (v/c)2,
 * $$ L = -m_0 c^2 \left[ 1 + \frac{1}{2}\left(- \frac{\dot{\mathbf{r}}^2}{c^2}\right) + \cdots \right] \approx -m_0 c^2 + \frac{m_0}{2}\dot{\mathbf{r}}^2 \,,$$

in the non-relativistic limit when v is small, the higher order terms not shown are negligible, and the Lagrangian is the non-relativistic kinetic energy as it should be. The remaining term is the negative of the particle's rest energy, a constant term which can be ignored in the Lagrangian.

For the case of an interacting particle subject to a potential V, which may be non-conservative, it is possible for a number of interesting cases to simply subtract this potential from the free particle Lagrangian,
 * $$L = -\frac{m_0 c^2}{\gamma(\dot{\mathbf{r}})} - V(\mathbf{r}, \dot{\mathbf{r}}, t) \,.$$

and the Euler–Lagrange equations lead to the relativistic version of Newton's second law. The derivative of relativistic momentum with respect to the time coordinate is equal to the force acting on the particle:
 * $$\mathbf{F} = \frac{d}{dt}\frac{\partial V}{\partial \dot{\mathbf{r}}} - \frac{\partial V}{\partial \mathbf{r}} = \frac{d}{dt}(m_0 \gamma(\dot{\mathbf{r}})\dot{\mathbf{r}})\,,$$

assuming the potential V can generate the corresponding force F in this way. If the potential cannot obtain the force as shown, then the Lagrangian would need modification to obtain the correct equations of motion.

Although this has been shown by taking Cartesian coordinates, it follows due to invariance of Euler Lagrange equations, that it is also satisfied in any arbitrary co-ordinate system as it physically corresponds to action minimization being independent of the co-ordinate system used to describe it. In a similar manner, several properties in Lagrangian mechanics are preserved whenever they are also independent of the specific form of the Lagrangian or the laws of motion governing the particles. For example, it is also true that if the Lagrangian is explicitly independent of time and the potential V(r) independent of velocities, then the total relativistic energy
 * $$E = \frac{\partial L}{\partial \dot{\mathbf{r}}}\cdot\dot{\mathbf{r}} - L = \gamma(\dot{\mathbf{r}})m_0c^2 + V(\mathbf{r})$$

is conserved, although the identification is less obvious since the first term is the relativistic energy of the particle which includes the rest mass of the particle, not merely the relativistic kinetic energy. Also, the argument for homogeneous functions does not apply to relativistic Lagrangians.

The extension to N particles is straightforward, the relativistic Lagrangian is just a sum of the "free particle" terms, minus the potential energy of their interaction;
 * $$L = - c^2 \sum_{k=1}^N \frac{m_{0k} }{\gamma(\dot{\mathbf{r}}_k)} - V(\mathbf{r}_1, \mathbf{r}_2, \ldots, \dot{\mathbf{r}}_1,\dot{\mathbf{r}}_2,\ldots, t) \,,$$

where all the positions and velocities are measured in the same lab frame, including the time.

The advantage of this coordinate formulation is that it can be applied to a variety of systems, including multiparticle systems. The disadvantage is that some lab frame has been singled out as a preferred frame, and none of the equations are manifestly covariant (in other words, they do not take the same form in all frames of reference). For an observer moving relative to the lab frame, everything must be recalculated; the position r, the momentum p, total energy E, potential energy, etc. In particular, if this other observer moves with constant relative velocity then Lorentz transformations must be used. However, the action will remain the same since it is Lorentz invariant by construction.

A seemingly different but completely equivalent form of the Lagrangian for a free massive particle, which will readily extend to general relativity as shown below, can be obtained by inserting
 * $$d\tau = \frac{1}{c}\sqrt{\eta_{\alpha\beta}\frac{dx^\alpha}{dt}\frac{dx^\beta}{dt}} dt \,, $$

into the Lorentz invariant action so that
 * $$S = \varepsilon \int_{t_1}^{t_2} \frac{1}{c}\sqrt{\eta_{\alpha\beta}\frac{dx^\alpha}{dt}\frac{dx^\beta}{dt}} dt \quad\Rightarrow\quad L = \frac{\varepsilon}{c}\sqrt{\eta_{\alpha\beta}\frac{dx^\alpha}{dt}\frac{dx^\beta}{dt}} $$

where ε = −m0c2 is retained for simplicity. Although the line element and action are Lorentz invariant, the Lagrangian is not, because it has explicit dependence on the lab coordinate time. Still, the equations of motion follow from Hamilton's principle
 * $$\delta S = 0\,. $$

Since the action is proportional to the length of the particle's worldline (in other words its trajectory in spacetime), this route illustrates that finding the stationary action is asking to find the trajectory of shortest or largest length in spacetime. Correspondingly, the equations of motion of the particle are akin to the equations describing the trajectories of shortest or largest length in spacetime, geodesics.

For the case of an interacting particle in a potential V, the Lagrangian is still
 * $$L = \frac{\varepsilon}{c}\sqrt{\eta_{\alpha\beta}\frac{dx^\alpha}{dt}\frac{dx^\beta}{dt}} - V ,$$

which can also extend to many particles as shown above, each particle has its own set of position coordinates to define its position.

Covariant formulation
In the covariant formulation, time is placed on equal footing with space, so the coordinate time as measured in some frame is part of the configuration space alongside the spatial coordinates (and other generalized coordinates). For a particle, either massless or massive, the Lorentz invariant action is (abusing notation)
 * $$S = \int_{\sigma_1}^{\sigma_2} \Lambda(x^\nu(\sigma),u^\nu(\sigma),\sigma) d\sigma ,$$

where lower and upper indices are used according to covariance and contravariance of vectors, σ is an affine parameter, and uμ = dxμ/dσ is the four-velocity of the particle.

For massive particles, σ can be the arc length s, or proper time τ, along the particle's world line,
 * $$ds^2 = c^2d\tau^2 = g_{\alpha\beta} d x^\alpha d x^\beta .$$

For massless particles, it cannot because the proper time of a massless particle is always zero;
 * $$g_{\alpha\beta} d x^\alpha d x^\beta = 0\,.$$

For a free particle, the Lagrangian has the form
 * $$\Lambda = g_{\alpha\beta}\frac{d x^\alpha}{d\sigma} \frac{d x^\beta}{d\sigma} $$

where the irrelevant factor of 1/2 is allowed to be scaled away by the scaling property of Lagrangians. No inclusion of mass is necessary since this also applies to massless particles. The Euler–Lagrange equations in the spacetime coordinates are
 * $$\frac{d}{d\sigma}\frac{\partial \Lambda}{\partial u^\alpha} - \frac{\partial \Lambda}{\partial x^\alpha} = \frac{d^2 x^\alpha}{d\sigma^2} + \Gamma^\alpha_{\beta\gamma} \frac{dx^\beta}{d\sigma}\frac{dx^\gamma}{d\sigma} = 0\,, $$

which is the geodesic equation for affinely parameterized geodesics in spacetime. In other words, the free particle follows geodesics. Geodesics for massless particles are called "null geodesics", since they lie in a "light cone" or "null cone" of spacetime (the null comes about because their inner product via the metric is equal to 0), massive particles follow "timelike geodesics", and hypothetical particles that travel faster than light known as tachyons follow "spacelike geodesics".

This manifestly covariant formulation does not extend to an N-particle system, since then the affine parameter of any one particle cannot be defined as a common parameter for all the other particles.

Special relativistic 1d free particle
For a 1d relativistic free particle, the Lagrangian is
 * $$L = - m_0 c^2 \sqrt {1 - \frac{\dot{x}^2(t)}{c^2}}\,.$$

This results in the following equation of motion:
 * $$m_0\ddot{x} \, \frac{1}{\left(1-\frac{\dot{x}^2}{c^2}\right)^{\frac{3}{2}}} = 0 \,.$$


 * {| class="toccolours collapsible collapsed" width="80%" style="text-align:left"

!Derivation

\frac{d}{dt}\frac{\partial L}{\partial \dot{x}} - \frac{\partial L}{\partial x} = 0 $$

\Rightarrow \frac{d}{dt}\frac{\partial}{\partial \dot{x}}\left(-m_0c^2 \sqrt {1 - \frac{\dot{x}^2}{c^2}}\right) = 0 $$

\Rightarrow -m_0c^2 \frac{d}{dt}\left(-\frac{\dot{x}}{c^2} \frac{1}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}}\right) = 0 $$

\Rightarrow m_0 \frac{d}{dt}\frac{\dot{x}}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} = 0 $$

\Rightarrow m_0\left(\frac{\ddot{x}}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} + \frac{\dot{x}^2}{c^2}\frac{\ddot{x}}{\left(1-\frac{\dot{x}^2}{c^2}\right)^{\frac{3}{2}}}\right) = 0 $$

\Rightarrow m_0\ddot{x} \left(\frac{1}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} + \frac{\frac{\dot{x}^2}{c^2}}{\left(1-\frac{\dot{x}^2}{c^2}\right)^{\frac{3}{2}}}\right) = 0 $$

\Rightarrow m\ddot{x} \left(\frac{1- \frac{\dot{x}^2}{c^2}}{\left(1 - \frac{\dot{x}^2}{c^2}\right)^{\frac{3}{2}}} + \frac{\frac{\dot{x}^2}{c^2}}{\left(1-\frac{\dot{x}^2}{c^2}\right)^{\frac{3}{2}}}\right) = 0 $$

\Rightarrow m\ddot{x} \, \frac{1}{\left(1 - \frac{\dot{x}^2}{c^2}\right)^{\frac{3}{2}}} = 0 $$
 * }

Special relativistic 1d harmonic oscillator
For a 1d relativistic simple harmonic oscillator, the Lagrangian is
 * $$L = - m c^2 \sqrt {1 - \frac{\dot{x}^2(t)}{c^2}} - \frac{k}{2}x^2 \,.$$

where k is the spring constant.

Special relativistic constant force
For a particle under a constant force, the Lagrangian is
 * $$L = - m c^2 \sqrt {1 - \frac{\dot{x}^2(t)}{c^2}} - mgx \,,$$

where g is the force per unit mass.

This results in the following equation of motion:
 * $$\frac{1}{(1-\frac{\dot{x}^2}{c^2})^{\frac{3}{2}}}\ddot{x} = -g \,.$$

Which, given initial conditions of
 * $$\begin{align}

x(t=0) &= x_0 \\ \dot{x}(t=0) &= v_0 \end{align}$$ results in the position of the particle as a function of time being
 * $$x(t) = x_0 + \frac{c^2}{g}\left[\frac{1}{\sqrt{1-\frac{v_0^2}{c^2}}} - \sqrt{\frac{1}{1-\frac{v_0^2}{c^2}} + \frac{g^2 t^2}{c^2} - \frac{2v_0 g t}{c^2\sqrt{1-\frac{v_0^2}{c^2}}}}\right] \,.$$


 * {| class="toccolours collapsible collapsed" width="80%" style="text-align:left"

!Derivation of equation of motion

\frac{d}{dt}\frac{\partial L}{\partial \dot{x}} - \frac{\partial L}{\partial x} = 0 $$

\Rightarrow \frac{d}{dt}\frac{\partial}{\partial \dot{x}}(-mc^2 \sqrt {1 - \frac{\dot{x}^2}{c^2}}) - \frac{\partial}{\partial x}(-mg x) = 0 $$

\Rightarrow -mc^2 \frac{d}{dt}(-\frac{\dot{x}}{c^2} \frac{1}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}}) = -mg $$

\Rightarrow \frac{d}{dt}\frac{\dot{x}}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} = -g $$

\Rightarrow \frac{\ddot{x}}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} + \frac{\dot{x}^2}{c^2}\frac{\ddot{x}}{(1-\frac{\dot{x}^2}{c^2})^{\frac{3}{2}}} = -g $$

\Rightarrow (\frac{1}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} + \frac{\frac{\dot{x}^2}{c^2}}{(1-\frac{\dot{x}^2}{c^2})^{\frac{3}{2}}}) \ddot{x} = -g $$

\Rightarrow (\frac{1- \frac{\dot{x}^2}{c^2}}{(1 - \frac{\dot{x}^2}{c^2})^{\frac{3}{2}}} + \frac{\frac{\dot{x}^2}{c^2}}{(1-\frac{\dot{x}^2}{c^2})^{\frac{3}{2}}}) \ddot{x} = -g $$

\Rightarrow \frac{1}{(1 - \frac{\dot{x}^2}{c^2})^{\frac{3}{2}}} \ddot{x} = -g $$
 * }


 * {| class="toccolours collapsible collapsed" width="80%" style="text-align:left"

!Derivation of solution From Euler-Lagrange equation we have

\frac{d}{dt}\frac{\dot{x}}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} = -g $$ Integrating with respect to time:

\Rightarrow \frac{\dot{x}}{\sqrt{1 - \frac{\dot{x}^2}{c^2}}} = -gt + A $$ Where $$A$$ is an undetermined constant.

Solving this equation for $$\dot{x}$$:

\dot{x}(t) = \frac{A-gt}{\sqrt{1+\frac{(A-gt)^2}{c^2}}} $$ Then, using $$\dot{x}(t=0) = v_0$$,

\frac{A}{\sqrt{1+\frac{A^2}{c^2}}} = v_0 $$ This implies that

A = \frac{v_0}{\sqrt{1-\frac{v_0^2}{c^2}}} \equiv \gamma_0 v_0 $$ Thus

\dot{x}(t) = \frac{\gamma_0 v_0-gt}{\sqrt{1+\frac{(\gamma_0 v_0-gt)^2}{c^2}}} $$ Note that for a large value of $$gt$$, we have $$1 << (\gamma_0 v_0 - gt)^2 \Rightarrow \sqrt{1+\frac{(\gamma_0 v_0-gt)^2}{c^2}} \approx \frac{\gamma_0 v_0 - gt}{c} $$ and see that $$\dot{x}(t\rightarrow \infty) = c$$.

Then, given that

\frac{dx}{dt} = \frac{\gamma_0 v_0-gt}{\sqrt{1+\frac{(\gamma_0 v_0-gt)^2}{c^2}}} $$ we have

x(t) = \int \frac{\gamma_0 v_0-gt}{\sqrt{1+\frac{(\gamma_0 v_0-gt)^2}{c^2}}} dt $$ Picking $$u\equiv 1 + \frac{(\gamma_0 v_0 - gt)^2}{c^2} \Rightarrow du = -\frac{2g}{c^2}(\gamma_0 v_0 - gt)dt$$, we have

x(u) = -\frac{c^2}{2g}\int \frac{1}{\sqrt{u}} du $$ Then note that $$\int u^{-\frac{1}{2}}du = 2u^{\frac{1}{2}} + C$$ for some undetermined constant $$C$$ so that

x(u) = -\frac{c^2}{g} \sqrt{u} + B $$ Using $$u = 1 + \frac{(\gamma_0 v_0 - gt)^2}{c^2}$$:

x(t) = -\frac{c^2}{g} \sqrt{1 + \frac{(\gamma_0 v_0 - gt)^2}{c^2}} + B $$ Recalling that $$x(t=0) = x_0$$:

B -\frac{c^2}{g} \sqrt{1 + \frac{(\gamma_0 v_0)^2}{c^2}} = x_0 $$ Since $$\gamma_0 = \frac{1}{\sqrt{1-\frac{v_0^2}{c^2}}}$$, we have $$1 + \frac{(\gamma_0 v_0)^2}{c^2} = \gamma_0^2$$ and come to

B = x_0 + \frac{c^2}{g}\gamma_0 $$ Therefore

x(t) = x_0 + \frac{c^2}{g} [ \gamma_0 - \sqrt{1 + \frac{(\gamma_0 v_0 - gt)^2}{c^2}}] $$ Plugging in the definition of $$\gamma_0 = \frac{1}{\sqrt{1-\frac{v_0^2}{c^2}}}$$ and using $$\gamma_0^2 = 1 + \frac{(\gamma_0 v_0)^2}{c^2}$$ brings the solution to

x(t) = x_0 + \frac{c^2}{g}[\frac{1}{\sqrt{1-\frac{v_0^2}{c^2}}} - \sqrt{\frac{1}{1-\frac{v_0^2}{c^2}} + \frac{g^2 t^2}{c^2} - \frac{2v_0 g t}{c^2\sqrt{1-\frac{v_0^2}{c^2}}}}] $$ The Newtonian limit of this solution can be obtained by making the following approximations, which are equivalent to stating that $$\dot{x}(t) << c$$:

\begin{align} \gamma_0 &= \frac{1}{\sqrt{1-\frac{v_0^2}{c^2}}} = 1 \\ \frac{v_0 - gt}{c} &<< 1 \\ \end{align} $$ This simplifies the solution to

x(t) \approx x_0 + \frac{c^2}{g} [ 1 - \sqrt{1 + \frac{g^2t^2}{c^2} -\frac{2v_0 gt}{c^2}}] $$ Then using the approximation that $$\alpha << 1 \Rightarrow \sqrt{1+\alpha} \approx 1 + \frac{\alpha}{2}$$:

x(t) \approx x_0 + \frac{c^2}{g}[1 - 1 - \frac{g^2t^2}{2c^2} + \frac{v_0 gt}{c^2}] $$ Which simplifies to

x(t) \approx -\frac{1}{2}gt^2 + v_0 t + x_0 $$ This is expected solution to the equation of motion to the Newtonian particle subject to a constant force: $$\ddot{x} = -g$$
 * }

Special relativistic test particle in an electromagnetic field
In special relativity, the Lagrangian of a massive charged test particle in an electromagnetic field modifies to
 * $$ L = - m c^2 \sqrt {1 - \frac{v^2 }{c^2}} - q \phi + q \dot{\mathbf{r}} \cdot \mathbf{A} \,.$$

The Lagrangian equations in r lead to the Lorentz force law, in terms of the relativistic momentum
 * $$\frac{d}{d t}\left(\frac{m \dot{\mathbf{r}}} {\sqrt {1 - \frac{v^2 }{c^2}}}\right) = q \mathbf{E} + q \dot{\mathbf{r}} \times \mathbf{B} \,. $$

In the language of four-vectors and tensor index notation, the Lagrangian takes the form
 * $$ L(\tau) = \frac{1}{2}m u^\mu(\tau)u_\mu(\tau) + qu^\mu(\tau)A_\mu(x) ,$$

where uμ = dxμ/dτ is the four-velocity of the test particle, and Aμ the electromagnetic four-potential.

The Euler–Lagrange equations are (notice the total derivative with respect to proper time instead of coordinate time)
 * $$ \frac{\partial L}{\partial x^\nu} - \frac{d}{d\tau}\frac{\partial L}{\partial u^\nu} = 0$$

obtains
 * $$ qu^\mu\frac{\partial A_\mu}{\partial x^\nu} = \frac{d}{d\tau} (m u_\nu + q A_\nu) \,. $$

Under the total derivative with respect to proper time, the first term is the relativistic momentum, the second term is
 * $$ \frac{d A_\nu}{d\tau} = \frac{\partial A_\nu}{\partial x^\mu} \frac{d x^\mu}{d\tau} = \frac{\partial A_\nu}{\partial x^\mu} u^\mu \,, $$

then rearranging, and using the definition of the antisymmetric electromagnetic tensor, gives the covariant form of the Lorentz force law in the more familiar form,
 * $$\frac{d}{d\tau} (m u_\nu) = qu^\mu F_{\nu\mu} \,,\quad F_{\nu\mu} = \frac{\partial A_\mu}{\partial x^\nu} - \frac{\partial A_\nu}{\partial x^\mu} \,. $$

Lagrangian formulation in general relativity
The Lagrangian is that of a single particle plus an interaction term LI
 * $$ L = - m c^2 \frac{d \tau}{d t} + L_\text{I} \,.$$

Varying this with respect to the position of the particle x&alpha; as a function of time t gives
 * $$ \begin{align} \delta L & = m \frac{d t}{2 d \tau} \delta \left( g_{\mu\nu} \frac{d x^{\mu}}{d t} \frac{d x^{\nu}}{d t} \right) + \delta L_\text{I} \\

& = m \frac{d t}{2 d \tau} \left( g_{\mu\nu,\alpha} \delta x^{\alpha} \frac{d x^{\mu}}{d t} \frac{d x^{\nu}}{d t} + 2 g_{\alpha\nu} \frac{d \delta x^{\alpha}}{d t} \frac{d x^{\nu}}{d t} \right) + \frac{\partial L_\text{I}}{\partial x^{\alpha}} \delta x^{\alpha} + \frac{\partial L_\text{I}}{\partial \frac{d x^{\alpha}}{d t}} \frac{d \delta x^{\alpha}}{d t} \\ & = \frac12 m g_{\mu\nu,\alpha} \delta x^{\alpha} \frac{d x^{\mu}}{d \tau} \frac{d x^{\nu}}{d t} - \frac{d }{d t} \left( m g_{\alpha\nu} \frac{d x^{\nu}}{d \tau} \right) \delta x^{\alpha} + \frac{\partial L_\text{I}}{\partial x^{\alpha}} \delta x^{\alpha} - \frac{d }{d t} \left( \frac{\partial L_\text{I}}{\partial \frac{d x^{\alpha}}{d t}} \right) \delta x^{\alpha} + \frac{d (\cdots)}{d t} \,. \end{align}$$

This gives the equation of motion
 * $$ 0 = \frac12 m g_{\mu\nu,\alpha} \frac{d x^{\mu}}{d \tau} \frac{d x^{\nu}}{d t} - \frac{d }{d t} \left( m g_{\alpha\nu} \frac{d x^{\nu}}{d \tau} \right) + f_{\alpha} $$

where
 * $$ f_{\alpha} = \frac{\partial L_\text{I}}{\partial x^{\alpha}} - \frac{d }{d t} \left( \frac{\partial L_\text{I}}{\partial \frac{d x^{\alpha}}{d t}} \right) $$

is the non-gravitational force on the particle. (For m to be independent of time, we must have f&alpha;dx&alpha;/dt = 0.)

Rearranging gets the force equation
 * $$ \frac{d }{d t} \left( m \frac{d x^{\nu}}{d \tau} \right) = - m \Gamma^{\nu}_{\mu\sigma} \frac{d x^{\mu}}{d \tau} \frac{d x^{\sigma}}{d t} + g^{\nu\alpha} f_{\alpha} $$

where &Gamma; is the Christoffel symbol, which describes the gravitational field.

If we let
 * $$ p^{\nu} = m \frac{d x^{\nu}}{d \tau} $$

be the (kinetic) linear momentum for a particle with mass, then
 * $$ \frac{d p^{\nu}}{d t} = - \Gamma^{\nu}_{\mu\sigma} p^{\mu} \frac{d x^{\sigma}}{d t} + g^{\nu\alpha} f_{\alpha} $$

and
 * $$ \frac{d x^{\nu}}{d t} = \frac{p^{\nu}}{p^0} $$

hold even for a massless particle.

General relativistic test particle in an electromagnetic field
In general relativity, the first term generalizes (includes) both the classical kinetic energy and the interaction with the gravitational field. For a charged particle in an electromagnetic field, the Lagrangian is given by
 * $$ L(x,\dot{x}) = - m c^2 \sqrt {- c^{-2} g_{\mu\nu}(x(\tau)) \frac{d x^{\mu}(\tau)}{d \tau} \frac{d x^{\nu}(\tau)}{d \tau}} + q \frac{d x^{\mu}(\tau)}{d \tau} A_{\mu}(x(\tau))\,.$$

If the four spacetime coordinates xμ are given in arbitrary units (i.e. unitless), then gμν is the rank 2 symmetric metric tensor, which is also the gravitational potential. Also, Aμ is the electromagnetic 4-vector potential.

There exists an equivalent formulation of the relativistic Lagrangian, which has two advantages:
 * it allows for a generalization to massless particles and tachyons;
 * it is based on an energy functional instead of a length functional, such that it does not contain a square root.

In this alternative formulation, the Lagrangian is given by
 * $$L(x,\dot{x},e)

= \frac{1}{2 \, e(\lambda) } g_{\mu\nu}( x(\lambda) ) \, \frac{d x^\mu(\lambda)}{d\lambda} \frac{d x^\nu(\lambda)}{d\lambda} - \frac{ e (\lambda) \, m^2 \, c^2 }{2} + q \, A_\mu(x(\lambda)) \frac{ d x^\mu(\lambda) }{d\lambda}$$, where $$\lambda$$ is an arbitrary affine parameter and $$e$$ is an auxiliary parameter that can be viewed as an einbein field along the worldline. In the original Lagrangian with the square root the energy-momentum relation appears as a primary constraint that is also a first class constraint. In this reformulation this is no longer the case. Instead, the energy-momentum relation appears as the equation of motion for the auxiliary field $$e$$. Therefore, the constraint is now a secondary constraint that is still a first class constraint, reflecting the invariance of the action under reparameterization of the affine parameter $$\lambda$$. After the equation of motion has been derived, one must gauge fix the auxiliary field $$e$$. The standard gauge choice is as follows:
 * If $$m^2 > 0$$, one fixes $$e = |m|^{-1}$$. This choice automatically fixes $$\lambda=\tau$$, i.e. the affine parameter is fixed to be the proper time.
 * If $$m^2 < 0$$, one fixes $$e = |m \, c|^{-1}$$. This choice automatically fixes $$\lambda=s$$, i.e. the affine parameter is fixed to be the proper length.
 * If $$m=0$$, there is no choice that fixes the affine parameter $$\lambda$$ to a physical parameter. Consequently, there is some freedom in fixing the auxiliary field. The two common choices are:
 * Fix $$e = 1$$. In this case, $$e$$ does not carry a dependence on the affine parameter $$\lambda$$, but the affine parameter is measured in units of time per unit of mass, i.e. $$[\lambda]= T/M$$.
 * Fix $$e = c^2 E(\lambda)$$, where $$E$$ is the energy of the particle. In this case, the affine parameter is measured in units of time, i.e. $$[\lambda]= T$$, but $$e$$ retains a dependence on the affine parameter $$\lambda$$.