Lagrangian mechanics is a method for deriving equations of motion from a quantity called the Lagrangian. In many introductory mechanics problems with conservative forces, you choose a coordinate , write , and use the Euler-Lagrange equation to get the motion.
If you are searching for what Lagrangian mechanics actually does, that is the short answer: it turns energy expressions into the same equations of motion you could get from Newton's laws, often with less messy algebra.
What Lagrangian Mechanics Means
Newton's laws usually start with forces. Lagrangian mechanics usually starts with coordinates and energies.
The key idea is to choose coordinates that match the motion. A pendulum, for example, is easier to describe with one angle than with separate and coordinates plus a constraint that the string length stays fixed.
Those tailored coordinates are called generalized coordinates. They do not have to be ordinary Cartesian positions. They are just coordinates that describe the system efficiently.
When Works
In many first courses, the Lagrangian is written as
where is kinetic energy and is potential energy.
That form is especially useful for conservative systems, where the forces can be described by a potential energy. It is not a universal law for every mechanical problem. If friction, driving forces, or more general constraints matter, extra terms or a broader setup may be needed.
How the Euler-Lagrange Equation Works
For one coordinate , the Euler-Lagrange equation is
Here means the time derivative of . The equation tells you how the coordinate must evolve so the motion is consistent with the chosen Lagrangian.
In practice, the workflow is short:
- Choose coordinates that match the constraints.
- Write and, when appropriate, .
- Form if the system is conservative.
- Apply the Euler-Lagrange equation once for each coordinate.
Worked Example: Simple Pendulum
Take a pendulum with bob mass and string length . Let the angle from the downward vertical be .
This example shows why generalized coordinates help. The string length stays fixed, so one coordinate already captures the whole motion.
Step 1: Write the kinetic energy
The bob moves along a circle of radius , so its speed is . That gives
Step 2: Write the potential energy
If we choose the lowest point as zero potential energy, then
Step 3: Form the Lagrangian
Step 4: Apply Euler-Lagrange
Differentiate with respect to and :
Substitute into the Euler-Lagrange equation:
So the equation of motion is
or, after dividing by ,
and then
That is the exact equation for an ideal simple pendulum. If the angle is small enough that , it becomes
which is the simple harmonic motion approximation. The condition matters: this last step is only valid for small angles.
Common Mistakes With Lagrangian Mechanics
Assuming works for every problem
That form is standard for many conservative systems, not all systems. If friction or other non-conservative effects matter, you may need generalized forces or a different model.
Choosing too many coordinates
If a constraint already ties variables together, using extra coordinates makes the problem harder. A pendulum angle is usually better than separate Cartesian coordinates.
Mixing ordinary and partial derivatives
In the Euler-Lagrange equation, and are partial derivatives. After that, you take a time derivative of .
Losing track of the potential-energy reference
You can choose different zero points for , but you must stay consistent. Changing by a constant does not change the equation of motion.
Where Lagrangian Mechanics Is Useful
Lagrangian mechanics is especially useful when constraints and coordinates do most of the work for you. Common examples include pendulums, rolling systems, oscillations, orbital motion, and problems written in polar or spherical coordinates.
It also matters beyond intro mechanics. The same framework appears in more advanced classical mechanics and in later subjects such as field theory, although the details become more sophisticated.
When Newton's Laws May Be Faster
If the problem is a simple one-dimensional force balance, Newton's second law can be more direct. Lagrangian mechanics becomes more attractive when coordinates are awkward or constraints are doing most of the work.
Try a Similar Problem
Use the same workflow for a horizontal mass-spring system. Write and , then apply Euler-Lagrange and check that you recover the oscillator equation. If you want a next step, try your own version first, then compare it with a solved example in GPAI Solver.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →