Advanced Physics‹›⌂ 0:00 studied

Module 1 · 14 min read · Free chapter

Hamilton's principle, calculus of variations, cyclic coordinates and symmetries

In short

Hamilton's principle says the true path makes the action S, the time integral of L, stationary for fixed end points. Varying the path and integrating by parts gives the Euler-Lagrange equations. A coordinate missing from L is cyclic, and its conjugate momentum is conserved. If L has no explicit time, the energy function h is conserved, and it equals T + V for fixed constraints.

What are you preparing for? We show the practice and previous year questions of your exam.

Start from zero: nature's economy

Light going from air into water bends. In 1662 Pierre de Fermat explained the exact angle with a remarkable idea: light takes the path that takes the least time. It does not head straight for its target; it spends less time in the slow medium.

Could the motion of a ball, a planet or a pendulum be described the same way, by one quantity that the actual path makes smallest? In 1834 William Rowan Hamilton showed that it can. The quantity is the action, the time integral of the Lagrangian, and the true path makes it stationary.

This chapter develops the mathematics behind such statements, the calculus of variations, and derives Lagrange's equations from Hamilton's principle. It then shows the principle's most important consequence: every symmetry of a system gives a conserved quantity. The equations were first derived from Newton's laws in Lagrange's equations.

Derivation: the Euler-Lagrange equation of a functional

A functional assigns a number to a whole function. The length of a curve y(x) between two points, or the time to slide down it, are functionals:

J[y]=∫x1x2f(y,y′,x)dxJ[y] = \int_{x_1}^{x_2}f\left(y, y', x\right)dx

Varying the path. Compare the path y(x) with a neighbour y(x)+ϵη(x)y(x) + \epsilon\eta(x), where η vanishes at both ends so the end points stay fixed. Then

dJdϵ∣ϵ=0=∫x1x2(∂f∂yη+∂f∂y′η′)dx\frac{dJ}{d\epsilon}\bigg\rvert_{\epsilon = 0} = \int_{x_1}^{x_2}\left(\frac{\partial f}{\partial y}\eta + \frac{\partial f}{\partial y'}\eta'\right)dx

Integrating by parts. The second term becomes [∂f∂y′η]x1x2−∫ddx(∂f∂y′)η dx\left[\dfrac{\partial f}{\partial y'}\eta\right]_{x_1}^{x_2} - \int\dfrac{d}{dx}\left(\dfrac{\partial f}{\partial y'}\right)\eta\,dx. The boundary term is zero because η vanishes at the ends. So

δJ=∫x1x2(∂f∂y−ddx∂f∂y′)η dx\delta J = \int_{x_1}^{x_2}\left(\frac{\partial f}{\partial y} - \frac{d}{dx}\frac{\partial f}{\partial y'}\right)\eta\,dx

For J to be stationary this must vanish for every η, which forces

ddx∂f∂y′−∂f∂y=0\frac{d}{dx}\frac{\partial f}{\partial y'} - \frac{\partial f}{\partial y} = 0

Beltrami identity. If f does not depend on x explicitly, the equation has a first integral, f−y′∂f∂y′=constantf - y'\dfrac{\partial f}{\partial y'} = \text{constant}. This saves one integration in many problems.

Worked example: the shortest path (IFoS 2017). In a plane, ds=1+y′2 dxds = \sqrt{1 + y'^2}\,dx, so f=1+y′2f = \sqrt{1 + y'^2}. f does not contain y, so $\frac{\partial f}{\partial y'} = \frac{y'}{\sqrt{1 + y'^2}} = $ constant. Hence y′ is constant and y = ax + b: a straight line. In three dimensions, with f=1+y′2+z′2f = \sqrt{1 + y'^2 + z'^2}, both y′ and z′ are constant and the conclusion is the same.

Hamilton's principle and Lagrange's equations (IFoS 2016, 2020; Geo-Scientist 2018)

Statement. For a system with Lagrangian L(q, q̇, t), of all the paths q(t) that start at q(t1)q(t_1) and end at q(t2)q(t_2), the actual path makes the action

S=∫t1t2L(q,q˙,t)dtS = \int_{t_1}^{t_2}L\left(q, \dot q, t\right)dt

stationary: δS = 0.

Derivation for n degrees of freedom. Vary each coordinate, qj→qj+δqjq_j \to q_j + \delta q_j, with δqj(t1)=δqj(t2)=0\delta q_j(t_1) = \delta q_j(t_2) = 0. Exactly as above,

δS=∫t1t2∑j=1n(∂L∂qj−ddt∂L∂q˙j)δqj dt=0\delta S = \int_{t_1}^{t_2}\sum_{j=1}^n\left(\frac{\partial L}{\partial q_j} - \frac{d}{dt}\frac{\partial L}{\partial\dot q_j}\right)\delta q_j\,dt = 0

If the system is holonomic and bilateral, with only potential forces, the n variations δqj\delta q_j are independent and arbitrary. Choosing all but one to be zero shows that each bracket vanishes:

ddt∂L∂q˙j−∂L∂qj=0,j=1,…,n\frac{d}{dt}\frac{\partial L}{\partial\dot q_j} - \frac{\partial L}{\partial q_j} = 0, \qquad j = 1, \ldots, n

Can it be applied to non-holonomic systems? (IFoS 2020). Not in this simple form. Non-holonomic constraints restrict the velocities, so the δqj\delta q_j are no longer independent and the step "each bracket vanishes" fails. For constraints of the form ∑jalj dqj+alt dt=0\sum_ja_{lj}\,dq_j + a_{lt}\,dt = 0, the correct equations come from D'Alembert's principle with Lagrange multipliers:

ddt∂L∂q˙j−∂L∂qj=∑lλlalj\frac{d}{dt}\frac{\partial L}{\partial\dot q_j} - \frac{\partial L}{\partial q_j} = \sum_l\lambda_la_{lj}

Significance (IFoS 2016). (1) The whole of mechanics is packed into one scalar, L. (2) The principle does not depend on coordinates, so any generalised coordinates can be used.

(3) It extends to fields, to relativity and to electromagnetism, where Maxwell's equations follow from an action. (4) It leads directly to quantum mechanics through Feynman's sum over paths. (5) It makes the link between symmetries and conservation laws transparent.

A Lagrangian is not unique. If L′=L+dF(q,t)dtL' = L + \dfrac{dF(q, t)}{dt}, then S′=S+F(q2,t2)−F(q1,t1)S' = S + F(q_2, t_2) - F(q_1, t_1). The extra term is fixed by the end points, so δS′ = δS and the equations of motion are the same.

Worked example: the brachistochrone

In 1696 Johann Bernoulli challenged the mathematicians of Europe: along which curve does a bead slide from one point to a lower one in the least time? Newton, Leibniz, Jakob Bernoulli and L'Hôpital all sent solutions; the problem gave birth to the calculus of variations.

Setting up. Measure y downward from the starting point. Starting from rest, the speed at depth y is 2gy\sqrt{2gy}, so the time is

t=∫dsv=∫0x21+y′22gy dxt = \int\frac{ds}{v} = \int_0^{x_2}\sqrt{\frac{1 + y'^2}{2gy}}\,dx

Solving. f does not contain x, so the Beltrami identity applies:

1+y′2y−y′2y(1+y′2)=constant⇒y(1+y′2)=2a\sqrt{\frac{1 + y'^2}{y}} - \frac{y'^2}{\sqrt{y\left(1 + y'^2\right)}} = \text{constant} \quad\Rightarrow\quad y\left(1 + y'^2\right) = 2a

for some constant 2a. Substituting y=a(1−cos⁡ϕ)y = a(1 - \cos\phi) gives x=a(ϕ−sin⁡ϕ)x = a(\phi - \sin\phi). This is a cycloid, the curve traced by a point on the rim of a wheel of radius a rolling along the line y = 0.

Two surprises. First, the straight line, though shortest, is not fastest: it is better to drop steeply at first and build up speed. Second, the brachistochrone is the same curve as the tautochrone of Lagrange's equations, on which a bead takes the same time to reach the bottom from any starting point.

Cyclic coordinates and conservation laws (IFoS 2022, 2025; Geo-Scientist 2023)

Generalised momentum. The momentum conjugate to qjq_j is pj=∂L∂q˙jp_j = \dfrac{\partial L}{\partial\dot q_j}. For a Cartesian coordinate it is ordinary momentum mx˙m\dot x; for an angle it is angular momentum mr2θ˙mr^2\dot\theta.

Cyclic coordinates. If qjq_j does not appear in L, Lagrange's equation reads dpjdt=∂L∂qj=0\dfrac{dp_j}{dt} = \dfrac{\partial L}{\partial q_j} = 0, so pjp_j is constant. A coordinate missing from L means L is unchanged when that coordinate is shifted: a symmetry. This is the simplest form of Noether's theorem (see conservation laws and Noether).

Symmetry of L Cyclic coordinate Conserved quantity
shift along a direction Cartesian coordinate along it linear momentum along it
rotation about an axis angle about that axis angular momentum about it
shift in time none, but ∂L∂t=0\dfrac{\partial L}{\partial t} = 0 energy function h

Worked example 1 (IFoS 2022; Geo-Scientist 2023). A particle moves in V=V0(x2+y2)V = V_0\left(x^2 + y^2\right). In cylindrical coordinates,

L=12m(ρ˙2+ρ2ϕ˙2+z˙2)−V0ρ2L = \frac{1}{2}m\left(\dot\rho^2 + \rho^2\dot\phi^2 + \dot z^2\right) - V_0\rho^2

Both z and φ are cyclic, and L has no t. So pz=mz˙p_z = m\dot z, Lz=mρ2ϕ˙L_z = m\rho^2\dot\phi and the energy E = T + V are conserved. The x and y components of momentum and of angular momentum are not, because V changes under shifts in x or y and under rotations about the x or y axis.

Worked example 2 (IFoS 2025). L=12m1q˙12+12m2q12q˙22−αq1L = \dfrac{1}{2}m_1\dot q_1^2 + \dfrac{1}{2}m_2q_1^2\dot q_2^2 - \dfrac{\alpha}{q_1}. The coordinate q2q_2 is cyclic, so p2=m2q12q˙2p_2 = m_2q_1^2\dot q_2 is conserved. L has no explicit t, and T is quadratic in the velocities, so the energy 12m1q˙12+12m2q12q˙22+αq1\dfrac{1}{2}m_1\dot q_1^2 + \dfrac{1}{2}m_2q_1^2\dot q_2^2 + \dfrac{\alpha}{q_1} is conserved. The symmetry is invariance under q2→q2+cq_2 \to q_2 + c; with m1=m2m_1 = m_2 the system is a particle in a central potential with q1q_1 as radius and q2q_2 as polar angle, and p2p_2 is its angular momentum.

Time symmetry: the energy function

Derivation. Take the total time derivative of L(q, q̇, t):

dLdt=∑j(∂L∂qjq˙j+∂L∂q˙jq¨j)+∂L∂t\frac{dL}{dt} = \sum_j\left(\frac{\partial L}{\partial q_j}\dot q_j + \frac{\partial L}{\partial\dot q_j}\ddot q_j\right) + \frac{\partial L}{\partial t}

Using Lagrange's equation to replace ∂L∂qj\dfrac{\partial L}{\partial q_j} by ddt∂L∂q˙j\dfrac{d}{dt}\dfrac{\partial L}{\partial\dot q_j}, the bracket becomes ddt(q˙j∂L∂q˙j)\dfrac{d}{dt}\left(\dot q_j\dfrac{\partial L}{\partial\dot q_j}\right). Rearranging,

dhdt=−∂L∂t,h=∑jq˙j∂L∂q˙j−L\frac{dh}{dt} = -\frac{\partial L}{\partial t}, \qquad h = \sum_j\dot q_j\frac{\partial L}{\partial\dot q_j} - L

So if L does not contain t explicitly, h is conserved. This is also called the Jacobi integral.

When is h the energy? If the constraints do not depend on time, T is a homogeneous quadratic function of the velocities. Euler's theorem then gives ∑q˙j∂T∂q˙j=2T\sum\dot q_j\dfrac{\partial T}{\partial\dot q_j} = 2T, so h = 2T − (T − V) = T + V.

When it is not: the rotating hoop. For the bead on a hoop spinning at constant ω (Lagrange's equations), L=12mR2(θ˙2+ω2sin⁡2θ)+mgRcos⁡θL = \dfrac{1}{2}mR^2\left(\dot\theta^2 + \omega^2\sin^2\theta\right) + mgR\cos\theta has no explicit t, so

h=12mR2θ˙2−12mR2ω2sin⁡2θ−mgRcos⁡θh = \frac{1}{2}mR^2\dot\theta^2 - \frac{1}{2}mR^2\omega^2\sin^2\theta - mgR\cos\theta

is conserved. But T + V has the centrifugal term with a plus sign, so it is not conserved. The motor keeping ω constant feeds energy in and out as the bead moves; h, the energy in the rotating frame including the centrifugal potential, is what stays fixed.

Velocity-dependent potentials: a charge in a field (Geo-Scientist 2025)

The magnetic force qv⃗×B⃗q\vec v\times\vec B depends on velocity and cannot come from an ordinary potential. It can, however, come from a velocity-dependent one. In SI units the Lagrangian is

L=12mv2−qϕ+qA⃗⋅v⃗L = \frac{1}{2}mv^2 - q\phi + q\vec A\cdot\vec v

where φ and A⃗\vec A are the scalar and vector potentials, with E⃗=−∇ϕ−∂A⃗∂t\vec E = -\nabla\phi - \dfrac{\partial\vec A}{\partial t} and B⃗=∇×A⃗\vec B = \nabla\times\vec A. Lagrange's equations reproduce mv⃗˙=q(E⃗+v⃗×B⃗)m\dot{\vec v} = q\left(\vec E + \vec v\times\vec B\right).

Canonical and kinetic momentum. p⃗=∂L∂v⃗=mv⃗+qA⃗\vec p = \dfrac{\partial L}{\partial\vec v} = m\vec v + q\vec A. This canonical momentum, not mv⃗m\vec v, is what is conserved when a coordinate is cyclic, and it is the momentum that becomes −iℏ∇-i\hbar\nabla in quantum mechanics.

Worked example (Geo-Scientist 2025). The question gives, in Gaussian units, L=12m(x˙2+y˙2+z˙2)+qc(zx˙−xz˙)L = \dfrac{1}{2}m\left(\dot x^2 + \dot y^2 + \dot z^2\right) + \dfrac{q}{c}\left(z\dot x - x\dot z\right). In these units L=12mv2−qϕ+qcA⃗⋅v⃗L = \dfrac{1}{2}mv^2 - q\phi + \dfrac{q}{c}\vec A\cdot\vec v. Comparing, φ = 0 and A⃗=(z,0,−x)\vec A = (z, 0, -x). Then

B⃗=∇×A⃗=(∂Az∂y−∂Ay∂z,∂Ax∂z−∂Az∂x,∂Ay∂x−∂Ax∂y)=(0,2,0)\vec B = \nabla\times\vec A = \left(\frac{\partial A_z}{\partial y} - \frac{\partial A_y}{\partial z}, \frac{\partial A_x}{\partial z} - \frac{\partial A_z}{\partial x}, \frac{\partial A_y}{\partial x} - \frac{\partial A_x}{\partial y}\right) = (0, 2, 0)

and E⃗=−∇ϕ−1c∂A⃗∂t=0\vec E = -\nabla\phi - \dfrac{1}{c}\dfrac{\partial\vec A}{\partial t} = 0. The particle moves in a uniform magnetic field of strength 2 (in the units of the problem) along the y-axis, with no electric field. Note that y is cyclic, so py=my˙p_y = m\dot y is conserved: motion along the field is free.

Deep dive: why nature finds the stationary path

Hamilton's principle can sound as if a particle "looks ahead" and chooses its path. Quantum mechanics removes the mystery. In Richard Feynman's 1948 formulation, a particle takes every possible path, each contributing a wave with phase Sℏ\dfrac{S}{\hbar}.

For a large object, S is enormous compared with Planck's constant ℏ≈1.05×10−34\hbar \approx 1.05\times10^{-34} J s. Neighbouring paths then have wildly different phases and cancel out, except near the path where S is stationary: there, small changes of path barely change S, and the contributions add up. The classical path is simply where the waves reinforce.

The same reasoning explains Fermat's principle: light also takes all paths, and only those near the stationary-time path survive. This is why stationary, not least, is the correct word. For long times, or on curved surfaces, the true path can be a saddle point of S rather than a minimum, as for light reflected from a concave mirror.

Hamilton himself was guided by the analogy between rays of light and paths of particles. A century later Louis de Broglie and Erwin Schrödinger used the same analogy in the other direction, giving particles a wave nature.

Critiques and debates: purpose or mathematics?

When Pierre-Louis Maupertuis proposed a "principle of least action" in 1744, he presented it as proof that nature acts with economy and wisdom. Critics, Voltaire among them, mocked the idea that a falling stone has a purpose.

View Claim Assessment
Teleological (Maupertuis) nature minimises action by design rejected: the action is often not a minimum
Equivalent reformulation δS = 0 is just Newton's laws rewritten true for holonomic systems with potentials
Deeper principle the action is more fundamental than forces supported by field theory and the path integral
Limited principle fails for friction and non-holonomic constraints true in its simple form; needs extensions

Today the action is the starting point for nearly every theory in physics, from general relativity to the Standard Model. Physicists usually write down an action that respects the required symmetries, and the equations and conservation laws follow.

Concept clarifications: commonly confused ideas

Writing a 20-mark answer

Question: "State Hamilton's principle and derive Lagrange's equations from it for a holonomic system with n degrees of freedom. What are cyclic coordinates? Can the principle be applied to non-holonomic systems?" (20 marks)

  1. Statement (3 marks). Action, fixed end points, δS = 0; stationary not least.
  2. Derivation (8 marks). Variation, integration by parts, vanishing boundary term, independence of δqj\delta q_j, result.
  3. Cyclic coordinates (4 marks). pj=∂L∂q˙jp_j = \dfrac{\partial L}{\partial\dot q_j} conserved; translation and rotation examples; energy function h.
  4. Non-holonomic (3 marks). Variations not independent; Lagrange multipliers from D'Alembert.
  5. Significance (2 marks). Coordinate-free, extends to fields, path integral.

Mains practice: questions to try

These are practice questions written by us, not past papers. The UPSC questions on this topic are shown in the previous year questions panel.

# Question Marks What it tests
1 Find the curve joining two points that, when rotated about the x-axis, gives the least surface area. 15 catenary
2 Show that the shortest path on the surface of a sphere is an arc of a great circle. 15 geodesics
3 A particle moves in the potential V=krV = \dfrac{k}{r} plus a uniform field along z. Which components of momentum and angular momentum are conserved? 10 symmetry
4 Show that adding ddt(q2t)\dfrac{d}{dt}\left(q^2t\right) to a Lagrangian does not change the equation of motion. 10 gauge freedom
5 Write the Lagrangian of a charge in a uniform magnetic field Bz^B\hat z using A⃗=12B⃗×r⃗\vec A = \dfrac{1}{2}\vec B\times\vec r and find the conserved quantities. 15 velocity-dependent potential

Quick revision

  • Euler-Lagrange: ddx∂f∂y′−∂f∂y=0\dfrac{d}{dx}\dfrac{\partial f}{\partial y'} - \dfrac{\partial f}{\partial y} = 0; Beltrami $f - y'\frac{\partial f}{\partial y'} = $ constant.
  • Shortest path: straight line; brachistochrone: cycloid (Bernoulli 1696).
  • δS = 0 with fixed end points gives Lagrange's equations for holonomic systems; non-holonomic need multipliers.
  • Cyclic qjq_j: pjp_j conserved; translation → momentum, rotation → angular momentum.
  • h=∑q˙j∂L∂q˙j−Lh = \sum\dot q_j\dfrac{\partial L}{\partial\dot q_j} - L conserved if ∂L∂t=0\dfrac{\partial L}{\partial t} = 0; h = T + V only for fixed constraints.
  • Charge: L=12mv2−qϕ+qA⃗⋅v⃗L = \dfrac{1}{2}mv^2 - q\phi + q\vec A\cdot\vec v, p⃗=mv⃗+qA⃗\vec p = m\vec v + q\vec A; L+dFdtL + \dfrac{dF}{dt} gives same equations.

Mains answer practice

Write your answer first, then open the points a good answer should cover.

  1. Derive the Euler-Lagrange equation for a functional with fixed end points.

    Show answer points
    • J = ∫ f(y, y', x) dx; vary y → y + εη
    • η = 0 at the ends
    • integrate the η' term by parts
    • boundary term vanishes
    • d/dx(∂f/∂y') - ∂f/∂y = 0
  2. Use the calculus of variations to show that the shortest path between two points in a plane is a straight line.

    Show answer points
    • ds = √(1 + y'²) dx
    • f has no y
    • ∂f/∂y' = y'/√(1 + y'²) = constant
    • y' constant
    • y = ax + b
  3. State Hamilton's principle and derive Lagrange's equations from it. Can it be applied to non-holonomic systems?

    Show answer points
    • S = ∫ L dt stationary for fixed end points
    • δS = ∫ Σ(∂L/∂q - d/dt ∂L/∂q̇) δq dt
    • integration by parts, boundary term zero
    • holonomic: δq_j independent, each bracket zero
    • non-holonomic: variations not independent; use multipliers
  4. A particle moves in V = V0(x² + y²). Identify the conserved quantities using cyclic coordinates.

    Show answer points
    • cylindrical: L = ½m(ρ̇² + ρ²φ̇² + ż²) - V0ρ²
    • z cyclic: p_z conserved
    • φ cyclic: L_z conserved
    • no explicit t: energy conserved
    • p_x, p_y, L_x, L_y not conserved
  5. Show that the energy function h is conserved when L has no explicit time dependence. When is h equal to T + V?

    Show answer points
    • dL/dt via chain rule
    • use Lagrange's equation
    • dh/dt = -∂L/∂t with h = Σ q̇ ∂L/∂q̇ - L
    • h = T + V if constraints fixed and T quadratic
    • rotating hoop: h conserved but T + V not
  6. The Lagrangian of a charge is L = ½mv² + (q/c)(z ẋ - x ż). Find the electromagnetic field acting on it.

    Show answer points
    • compare with L = ½mv² - qφ + (q/c) A·v
    • φ = 0, A = (z, 0, -x)
    • B = ∇ × A = (0, 2, 0)
    • E = -∇φ - (1/c)∂A/∂t = 0
    • uniform magnetic field along y; p_y conserved
  7. Show that adding a total time derivative dF(q, t)/dt to a Lagrangian does not change the equations of motion.

    Show answer points
    • S' = S + F(q2, t2) - F(q1, t1)
    • extra term fixed by end points
    • δS' = δS
    • same Euler-Lagrange equations
    • Lagrangian is not unique
  8. For L = ½m1 q̇1² + ½m2 q1² q̇2² - α/q1, find the cyclic coordinates, conserved quantities and the related symmetry.

    Show answer points
    • q2 absent from L: cyclic
    • p2 = m2 q1² q̇2 conserved
    • no explicit t, T quadratic: energy conserved
    • E = ½m1 q̇1² + ½m2 q1² q̇2² + α/q1
    • symmetry q2 → q2 + c; like angular momentum in a central potential

Previous year questions

Previous year questions for UPSC CSE will appear here once each one is checked word for word against the official question paper.

Learn with AI

A tutor that asks instead of telling, a partner that argues the other side, and this chapter told through your own district.

Tell the tutor what you are stuck on. It will guide you with questions and give the answer after a few tries.

🙋 Raise a doubt or feedback

Stuck somewhere, or spotted a mistake? Write to the ExamHike team. We usually reply within a day, and you will see the reply on My progress.

Log in to ask a doubt or send feedback →

Frequently asked questions

What is Hamilton's principle?

Among all paths between two configurations at fixed times, the actual motion makes the action, the integral of L dt, stationary. Lagrange's equations follow from it for holonomic systems.

What is a cyclic coordinate?

A coordinate that does not appear in the Lagrangian, though its velocity may. Its conjugate momentum is then conserved, as angular momentum is when the angle is missing.

Is the energy function always T + V?

No. It equals T + V only when constraints do not depend on time and T is quadratic in velocities. For a bead on a rotating hoop, h is conserved but T + V is not.

What is the brachistochrone?

It is the curve of fastest descent between two points under gravity. The calculus of variations shows it is a cycloid, not a straight line.

More in this module: Mechanics of particles

Official sources

Facts in this chapter were checked against these official sources.

  1. IGNOU PHE-01 Elementary Mechanics and BPHCT-131 Block 4: Lagrangian and Hamiltonian formulations
  2. MIT OpenCourseWare 8.09 Classical Mechanics III, lecture notes on Lagrangian mechanics