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 qiq_i, write L=TVL = T - V, and use the Euler-Lagrange equation to get the motion.

ddt(Lq˙i)Lqi=0\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}_i}\right) - \frac{\partial L}{\partial q_i} = 0

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 θ\theta than with separate xx and yy 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 L=TVL = T - V Works

In many first courses, the Lagrangian is written as

L=TVL = T - V

where TT is kinetic energy and VV 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 qq, the Euler-Lagrange equation is

ddt(Lq˙)Lq=0\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}}\right) - \frac{\partial L}{\partial q} = 0

Here q˙\dot{q} means the time derivative of qq. The equation tells you how the coordinate must evolve so the motion is consistent with the chosen Lagrangian.

In practice, the workflow is short:

  1. Choose coordinates that match the constraints.
  2. Write TT and, when appropriate, VV.
  3. Form L=TVL = T - V if the system is conservative.
  4. Apply the Euler-Lagrange equation once for each coordinate.

Worked Example: Simple Pendulum

Take a pendulum with bob mass mm and string length ll. Let the angle from the downward vertical be θ\theta.

This example shows why generalized coordinates help. The string length stays fixed, so one coordinate θ\theta already captures the whole motion.

Step 1: Write the kinetic energy

The bob moves along a circle of radius ll, so its speed is v=lθ˙v = l\dot{\theta}. That gives

T=12ml2θ˙2T = \frac{1}{2} m l^2 \dot{\theta}^2

Step 2: Write the potential energy

If we choose the lowest point as zero potential energy, then

V=mgl(1cosθ)V = mgl(1 - \cos\theta)

Step 3: Form the Lagrangian

L=TV=12ml2θ˙2mgl(1cosθ)L = T - V = \frac{1}{2} m l^2 \dot{\theta}^2 - mgl(1 - \cos\theta)

Step 4: Apply Euler-Lagrange

Differentiate with respect to θ˙\dot{\theta} and θ\theta:

Lθ˙=ml2θ˙\frac{\partial L}{\partial \dot{\theta}} = ml^2\dot{\theta} ddt(Lθ˙)=ml2θ¨\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{\theta}}\right) = ml^2\ddot{\theta} Lθ=mglsinθ\frac{\partial L}{\partial \theta} = -mgl\sin\theta

Substitute into the Euler-Lagrange equation:

ml2θ¨(mglsinθ)=0ml^2\ddot{\theta} - (-mgl\sin\theta) = 0

So the equation of motion is

ml2θ¨+mglsinθ=0ml^2\ddot{\theta} + mgl\sin\theta = 0

or, after dividing by mlml,

lθ¨+gsinθ=0l\ddot{\theta} + g\sin\theta = 0

and then

θ¨+glsinθ=0\ddot{\theta} + \frac{g}{l}\sin\theta = 0

That is the exact equation for an ideal simple pendulum. If the angle is small enough that sinθθ\sin\theta \approx \theta, it becomes

θ¨+glθ=0\ddot{\theta} + \frac{g}{l}\theta = 0

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 L=TVL = T - V 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, L/q\partial L / \partial q and L/q˙\partial L / \partial \dot{q} are partial derivatives. After that, you take a time derivative of L/q˙\partial L / \partial \dot{q}.

Losing track of the potential-energy reference

You can choose different zero points for VV, but you must stay consistent. Changing VV 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 T=12mx˙2T = \frac{1}{2}m\dot{x}^2 and V=12kx2V = \frac{1}{2}kx^2, 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 →