Optics as a motivation for Lagrangian mechanics
In geometrical optics, ray trajectories already arise from a variational principle. Classical mechanics can be motivated very naturally by recasting particle motion as an optical problem on configuration space.
Below is a structured explanation in this spirit.
Fermat’s principle in an inhomogeneous medium
Consider light propagating in a medium with spatially varying refractive index (n(x)). Between two fixed points (A) and (B), the physical light ray is characterized by Fermat’s principle:
it makes the optical length functional
\[ \mathcal{S}[\gamma] = \int_\gamma n(x)\, ds \]
stationary among all smooth curves () joining (A) and (B). Here (ds = |dx|) is the Euclidean arc length element.
If we parametrize the curve as (x(t)) (where (t) is just a parameter, not necessarily physical time), we can write
\[ \mathcal{S}[x] = \int_{t_1}^{t_2} n(x(t))\,|\dot x(t)|\,dt. \]
This already has the form of an action integral
\[ \mathcal{S}[x] = \int_{t_1}^{t_2} L_{\text{opt}}(x,\dot x)\,dt, \]
with an optical Lagrangian
\[ L_{\text{opt}}(x,\dot x) = n(x)\,|\dot x|. \]
Varying this functional with fixed endpoints gives the Euler–Lagrange equations for the ray paths. In piecewise constant (n), one recovers Snell’s law at interfaces; for smoothly varying (n(x)), the rays bend continuously according to a differential equation derived from the same variational principle.
Thus, even in basic optics we encounter a natural Lagrangian variational principle.
Mechanics with fixed energy as an optical problem
Now consider a classical particle of mass (m) moving in a potential (V(x)) in configuration space. Newton’s second law reads
\[ m \ddot x = -\nabla V(x). \]
Assume the total energy
\[ E = \frac12 m|\dot x|^2 + V(x) \]
is fixed and that (E > V(x)) along the trajectory, so the speed is determined by position:
\[ \frac12 m|\dot x|^2 + V(x) = E \quad\Rightarrow\quad |\dot x| = \sqrt{\frac{2}{m}(E - V(x))}. \]
Jacobi’s principle says that, among all curves () in configuration space joining two fixed points and lying on the fixed-energy surface, the physical trajectory makes the functional
\[ \mathcal{S}_J[\gamma] = \int_\gamma \sqrt{2m\,(E - V(x))}\,ds \]
stationary.
Compare this with Fermat’s functional
\[ \mathcal{S}_{\text{opt}}[\gamma] = \int_\gamma n(x)\,ds. \]
They have exactly the same structure. We can introduce a mechanical refractive index
\[ n_{\text{mech}}(x) = \sqrt{2m\,(E - V(x))}, \]
so that
\[ \mathcal{S}_J[\gamma] = \int_\gamma n_{\text{mech}}(x)\,ds. \]
Thus, a mechanical trajectory at fixed energy is formally identical to a light ray in a medium with refractive index (n_{}(x)). Configuration space is “filled” with an optical medium; the particle’s path is a ray that extremizes a Fermat-type functional.
From the geometric functional to the usual Lagrangian
Jacobi’s principle is parameterization-invariant: it depends only on the geometric curve (), not on how fast you move along it. The usual Lagrangian formulation, by contrast, singles out a distinguished parameter, namely physical time (t):
\[ S[x] = \int_{t_1}^{t_2} L(x,\dot x)\,dt. \]
One can view Hamilton’s principle as a refinement of Jacobi’s geometric variational principle that introduces physical time explicitly.
On a fixed-energy surface, the motion is governed by
\[ \mathcal{S}_J[\gamma] = \int_\gamma \sqrt{2m\,(E - V(x))}\,ds, \]
which is of Fermat type. If we now allow the energy to vary and insist on using time (t) as the parameter, the natural choice of Lagrangian that recovers this description on fixed-energy surfaces is
\[ L(x,\dot x) = T - V = \frac12 m|\dot x|^2 - V(x), \]
with (T = m|x|^2) the kinetic energy.
More systematically, one can proceed via the abbreviated action
\[ S_0[\gamma] = \int_\gamma p\cdot dx, \]
where for fixed energy (E) one has
\[ |p| = \sqrt{2m\,(E - V(x))}. \]
This abbreviated action reduces to Jacobi’s principle:
\[ S_0[\gamma] = \int_\gamma \sqrt{2m\,(E - V(x))}\,ds. \]
Introducing time as a variable, we consider the full action
\[ S[x] = \int_{t_1}^{t_2} (T - V)\,dt = \int_{t_1}^{t_2} \left(\frac12 m|\dot x|^2 - V(x)\right)\,dt. \]
Varying this with fixed endpoints in time yields the Euler–Lagrange equations
\[ \frac{d}{dt}\left(\frac{\partial L}{\partial \dot x}\right) - \frac{\partial L}{\partial x} = 0, \]
which are equivalent to Newton’s law. For fixed energy, the spatial projections of these solutions coincide with the extremals of Jacobi’s functional, i.e. with the “optical rays” in configuration space.
Thus, the usual Lagrangian formalism can be seen as the time-parametrized version of a Fermat/Jacobi variational principle.
Wave optics, the eikonal equation, and Hamilton–Jacobi theory
The analogy deepens when one passes from ray optics to wave optics. In the short-wavelength (geometric) limit, wave optics leads to the eikonal equation for the phase (S(x)) of the wave:
\[ |\nabla S(x)|^2 = n(x)^2. \]
Here the level sets of (S) are wavefronts, and the rays are orthogonal trajectories to these wavefronts.
The time-independent Hamilton–Jacobi equation for a classical particle of energy (E) is
\[ \frac{1}{2m}|\nabla S(x)|^2 + V(x) = E. \]
Using the same dictionary
\[ n_{\text{mech}}(x)^2 = 2m\,(E - V(x)), \]
we see that the Hamilton–Jacobi equation is formally identical to the eikonal equation in an optical medium with index (n_{}(x)). The classical trajectories are the characteristic curves (orthogonal to the level sets of (S)), just as rays are orthogonal to optical wavefronts.
From this point of view, one can motivate Hamiltonian and Lagrangian mechanics as the geometric (ray) limits of an underlying “wave theory” on configuration space, exactly mirroring the relationship between wave optics and ray optics.
Summary
- Geometrical optics starts with a very tangible variational principle: rays extremize an integral of the form (n(x),ds).
- Classical mechanics with fixed energy can be rewritten as exactly the same kind of variational problem on configuration space, with a mechanical refractive index [ n_{}(x) = . ]
- The usual Lagrangian formulation arises when we: . Choose physical time (t) as the distinguished parameter, and . Replace the geometric functional by a time integral [ S = L,dt, ] with (L = T - V), obtaining a time-parametrized version of the Fermat/Jacobi principle.
- Hamilton–Jacobi theory mirrors the eikonal approximation in optics: its equation is the analog of the eikonal equation, with classical trajectories playing the role of rays.
In this sense, Lagrangian (and Hamiltonian) mechanics can be viewed as optics on configuration space, with mechanical trajectories as light rays in a suitably chosen effective medium.