A few days ago we looked at what a Lagrangian actually is. The short of it is that it’s the kinetic energy minus the potential energy of a given mass*. More importantly, if you construct the classical action by integrating the Lagrangian over the time (see the previous link for a more full explanation) you’ll find that the actual trajectory is the one that minimizes the action.
It turns out that the way to find the path that minimizes the action is pretty easy. In honor of two of its pioneers, we call it the Euler-Lagrange equation. If you can find a solution that satisfies the Euler-Lagrange equation for your problem, you have determined the trajectory of your system. The equation is this:
Here x is position and x-dot is velocity. We’re working with a 1-d harmonic oscillator, so that one coordinate is enough to describe the system. In more dimensions you just write this equation down more times, with (say) y and z replacing x. The lagrangian for our system is:
Do we all know enough calculus to plug that into the Euler-Lagrange equation? If you’re not familiar with partial derivatives (the script d), that means to differentiate with respect to that variable, treating all the other variables as constant. For instance, the partial derivative of the Lagrangian with respect to t would be 0 because t doesn’t explicitly appear. The d/dt derivative (which is what’s in the E-L equation) is not zero, because x and x-dot are functions of t. Anyway, plugging in, we get:
Which is exactly the equation we got when we did the harmonic oscillator using force-based methods rather than this potential energy based method.
So why all that extra trouble? In this case, just to see how things work. But in other cases, this is our only option. There are plenty of times (for instance, a roller coaster on tracks) where the forces involved (such as the tracks on the car) are so blisteringly complicated as to be practically impossible to solve. However, it’s easy to write the relation between the track height and the potential energy, and the Lagrangian formulation can automatically give us a much simpler differential equation to solve. We can do this because the Euler-Lagrange equations don’t even care if we use x, y, and z as our coordinates. We can use radial coordinates, spherical coordinates, hyperbolic coordinates, or any ridiculous purpose-built coordinates for our problem. We don’t even have to modify the form of the equation. And that makes our lives ridiculously simpler. Which I’m all for.
*This is true in classical mechanics. It’s not true in relativistic mechanics even if you use relativistic kinetic energy. That’s more complicated and we’ll worry about it later.