The Living Thing / Notebooks :

Lagrangian mechanics

Applied variational calculus with some physics.

I don’t really do physics these days, but physicists write the best introductions to variational calculus, which I do do.

“What is the quickest path through these mountains?” “Where do I put mountains such that my map produces the right quickest path?”

Optimal control, Pontryagin’s maximum principle. Variational calculus, minimising functionals. deriving high dimensional functions as solutions of scalar optimisation using conservation principles as seen in functional data analysis and variational inference.

Here is a non-peer-reviewed introduction to Lagrangian mechanics from λ-calculus guy John Shutt <>

Noether’s theorem (pedantically, Noether’s first theorem) says that each differentiable invariant in the action of a system gives rise to a conservation law. This is a particularly celebrated result in mathematical physics; it’s explicitly about how properties of a system are implied by the mathematical structure of its description; and invariants — the current fad name for them in physics is “symmetries” — are close kin to both hygiene and geometry, which relate to each other through the analogy I’m pursuing; so Noether’s theorem has a powerful claim on my attention.

The action of a system always used to seem very mysterious to me, until I figured out it’s one of those deep concepts that, despite its depth, is also quite shallow. It comes from Lagrangian mechanics, a mathematical formulation of classical mechanics alternative to the Newtonian mechanics formulation. […]

Newtonian mechanics seeks to describe the trajectory of a thing in terms of its position, velocity, mass, and the forces acting on it. This approach has some intuitive advantages but is sometimes beastly difficult to solve for practical problems. The Lagrangian formulation is sometimes much easier to solve. Broadly, the time evolution of the system follows a trajectory through abstract state-space, and a function called the Lagrangian of the system maps each state into a quantity that… er… well, its units are those of energy. For each possible trajectory of the system through state-space, the path integral of the Lagrangian is the action. The principle of least action says that starting from a given state, the system will evolve along the trajectory that minimizes the action. Solving for the behavior of the system is then a matter of finding the trajectory whose action is smallest.[…]

The Lagrangian formulation tends to be good for systems with conserved quantities; one might prefer the Newtonian approach for, say, a block sliding on a surface with friction acting on it. And this Lagrangian affinity for conservative systems is where Noether’s theorem comes in: if there’s a differentiable symmetry of the action — no surprise it has to be differentiable, seeing how central integrals and derivatives are to all this — the symmetry manifests itself in the system behavior as a conservation law.

And what, you may ask, is this magical Lagrangian function, whose properties studied through the calculus of variations reveal the underlying conservation laws of nature? Some deeper layer of reality, the secret structure that underlies all? Not exactly. The Lagrangian function is whatever works: some function that causes the principle of least action to correctly predict the behavior of the system. In quantum field theory — so I’ve heard, having so far never actually grappled with QFT myself — the Lagrangian approach works for some fields but there is no Lagrangian for others. […]

This is an important point: the Lagrangian is whatever function makes the least-action principle work right. It’s not “really there”, except in exactly the sense that if you can devise a Lagrangian for a given system, you can then use it via the action integral and the calculus of variations to describe the behavior of the system. Once you have a Lagrangian function that does in fact produce the system behavior you want it to, you can learn things about that behavior from mathematical exploration of the Lagrangian. Such as Noether’s theorem. When you find there is, or isn’t, a certain differentiable symmetry in the action, that tells you something about what is or isn’t conserved in the behavior of the system, and that result really may be of great interest; just don’t lose sight of the fact that you started with the behavior of the system and constructed a suitable Lagrangian from which you are now deducing things about what the behavior does and doesn’t conserve.