# How do you actually find the path of least action?

Reading up on Lagrangian mechanics, it's fascinating. Entirely different view, one single rule, a complete alternative to Newton's laws. But how do you actually find the path of least action?

Let's say I were trying to find the path taken by a projectile launched by a cannon, image courtesy of Dr. Thomas Gibson, Texas Tech University:

Let's say the above cannon launches a projectile off a cliff at $$0^\circ$$ off the horizontal. The mass doesn't actually affect the path disregarding air resistance, but it's needed for Lagrangian mechanics so let's say it's a $$10\textrm{kg}$$ projectile. The projectile is fired from $$10\textrm{m}$$ off the ground, and the velocity imparted to the projectile is $$10^{\textrm{m}}/_{\textrm{s}}$$ entirely in the positive $$x$$ direction.

### Newtonian

Running through this Newtonian-style, if we wanted to find the location of the projectile at any given point in its path, we know that the horizontal component of its position can be found using the initial velocity, and the vertical component can be found using acceleration due to gravity, so:

$$\vec{s}(t) = \left \langle {v_xt}, {\frac{gt^2}{2}} \right \rangle$$

### Lagrangian

For the Lagrangian approach, we know that the kinetic energy of the projectile at the start is $$\frac{mv^2}{2}$$ and ignoring air resistance the potential energy of the projectile at the start is $$mgh$$. So, within the context of a given path,

$${\mathcal {S}}(L)=\int_{t_i}^{t_f}{\left[ \frac{mv_x^2}{2} - mgh \right]} \,dt$$

And the path of least action $$L_{LA}$$ from all possible paths $$L$$ is defined as:

$$\{L_{LA} \in L \mid {\mathcal {S}}(L_{LA}) = \min_{L_k \in L}{\mathcal {S}}(L_k)\}$$

So I've got my definition down, but how do I actually find the curve followed by the projectile:

$$\vec{s}(t) = \left \langle {?}, {?} \right \rangle$$

### Example

Let's say I wanted to find the position of the projectile at the middle of its path, by time.

In the Newtonian model, I know that the projectile's path will end upon hitting the ground, so the total time in the air can be expressed as $$t_f = \sqrt\frac{2d}{g}$$ so at half of $$t_f$$ then, $$t_{mid} = \sqrt\frac{d}{2g}$$.

Substitute $$t_{mid}$$ in for $$t$$ and we have the position mid-path by time:

$$\vec{s}(t_{mid}) = \left \langle {v_x\sqrt\frac{d}{2g}}, {\frac{d}{4}} \right \rangle$$

But I can't quite figure out how to arrive at the same result from the Lagrangian form. How would I use the action to actually find details of the favored path?

$${\mathcal {S}}(L)=\int_{t_i}^{t_f}{\left[ \frac{mv_x^2}{2} - mgh \right]} \,dt \quad\quad \Longrightarrow \quad\quad \vec{s}(t_{mid}) = \left \langle {v_x\sqrt\frac{d}{2g}}, {\frac{d}{4}} \right \rangle$$

## 3 Answers

Let $$V(\vec{x})$$ be the potential energy (in this case gravitational energy) and $$T(\vec{v})$$ the kinetic energy, then we define a Lagrangian as $$\mathcal{L}(\vec{x},\vec{v})=T(\vec{v}) - V(\vec{x})$$ and an action $$S = \int_{t_1}^{t_2} \mathcal{L}(\vec{x},\vec{v}) dt$$

It is possible to prove that the path $$\vec{x}(t)$$ which minimizes the action is the solution to the Lagrange equation

$$\frac{d}{dt}\frac{\partial \mathcal{L}}{\partial v_i} - \frac{\partial \mathcal{L}}{\partial x_i} = 0$$

Prove of this can be found in every textbook and online as well, and this is completely general. Now it's an easy exercise to use $$T(\vec{v}) = m \sum_{i=1}^3 v_i^2/2$$ and $$V(\vec{x}) = mgz$$ in Lagrange equations to find

$$\frac{dv_x}{dt} = 0$$ $$\frac{dv_y}{dt} = 0$$ $$\frac{dv_z}{dt} = -g$$ which are simply the Newton laws.

To conclude, you should not consider the variational approach as an easiest way to get cinematic, but as a different perspective on physics from which cinematic is deduced. So, when solving a simple parabolic motion problem, just use classical cinematic, since it is exactly the same, just be aware that the parabolic path is also the one which minimizes the action.

Hope this helps! Please ask for doubts and details if you need.

Whilst I fully agree with @Matteo, there is a twist especially relevant in the age of easy computing power. Principle of least action tells you that the correct path is the one that gives you smallest action. So guess the path, then change it a bit, see if action is reduced, yes -> proceed, no -> go back and try again. Keep going ... and you will find your path without solving a differential equation. More precisely you swaped a problem of solving a differential equation for a problem of minimization.

Whilst the procedure of trial and error would be a torture few decades ago, now this is fairly simple thing to code up, and then computer will simply splurt out the result.

Feynman, Chap 19 talked about it http://www.feynmanlectures.caltech.edu/II_19.html

" Suppose I don’t know the capacity of a cylindrical condenser. I can use this principle to find it. I just guess at the potential function ϕ until I get the lowest C. etc... "

This specific quote is on capacitance, but the lecutre is on variational principles.

• Of course the same computer power is also used to compute trajectories using numerical analysis. For instance, all space probe missions, including missions that involve gravitational slingshots, are computed using numerical analysis, number-crunching differential equations. Mar 14, 2019 at 23:13
• On computing trajectories using least action: it's not even necessary to guess the path. For any path, no matter how wrong, a variation that gives a lower value for the action is a move towards the true trajectory. The simplest starting form is a straight line. Then the computation starts iterating, making a step towards the true trajectory every cycle of the iteration. (I don't know whether there are cases where there is local minimum that isn't a global minimum. I suspect such cases do not occur in natural circumstances.) Mar 14, 2019 at 23:14
• Computers can solve differential equations very well, no doubt. But (1) in my humble opinioin it is easier to teach an undergrad to minimize action than to solve a differential equation on computer (the minimization method is harder to 'break'); (2) should there be numerical problems with finding a solution, the two methods (solving diff eq. and action minimization) are likely to suffer from different problems, so the two methods are complementary.
– Cryo
Mar 14, 2019 at 23:22

This was my interpretation of the problem statement:

$$L(\dot x(t),y(t))=\frac {m}{2}\dot x(t)^2 - mgy(t)$$

Hence,

$$\delta S(L(\dot x(t),y(t))= \delta \int L(\dot x(t),y(t))dt$$

which implies

$$\frac {d}{dt}(\frac {\partial L}{\partial \dot x(t)})=0$$

$$-\frac{\partial L} {\partial {y(t)}}=F_{y(t)}$$

where I've only listed the non-zero terms.

$$F_{y(t)}$$ is a holonomic constraint, i.e., gravity.

Note, I haven't invented any data - and I haven't coupled the gravitation potential into the kinetic energy term $$T$$.

The solution to the problem is

$$y(t)=-\frac {1}{2}g(\frac {x(t)}{v_{x(0)}})^2+h$$

which should be a straight forward solution of differential equations - assuming I haven't made a algebra error.

The canon ball lands

$$x(t_f) = \sqrt{ \frac {2h}{g}}{v}^2_{x(0)}$$

from the base of the cliff.