We start from the Lagrangian L(qi,q˙i,t). The Euler–Lagrange equations are
dtd∂q˙i∂L−∂qi∂L=0.
HOW do we switch variables cleanly? We use a Legendre transform. The trick: if a function depends on a variable q˙, but we'd rather it depend on its slope p=∂L/∂q˙, we form a new function whose differential no longer contains dq˙.
Take the total differential of H=∑ipiq˙i−L:
dH=∑i(q˙idpi+pidq˙i)−∑i(∂qi∂Ldqi+∂q˙i∂Ldq˙i)−∂t∂Ldt.
After cancellation, and using ∂L/∂qi=p˙i (from Euler–Lagrange, since p˙i=dtd∂q˙i∂L=∂qi∂L):
dH=∑iq˙idpi−∑ip˙idqi−∂t∂Ldt.
But by definition of a differential of H(q,p,t):
dH=∑i∂qi∂Hdqi+∑i∂pi∂Hdpi+∂t∂Hdt.
Matching coefficients of the independent differentials dqi,dpi,dt:
WHY the minus sign? It comes purely from matching −p˙idqi with +∂qi∂Hdqi. The asymmetric sign is what makes phase-space flow area-preserving (Liouville) — it is a feature, not a typo.
Momentum.p=∂x˙∂L=mx˙. Why this step? It defines the variable replacing x˙, and lets us invert x˙=p/m.
Hamiltonian.H=px˙−L=p⋅mp−(21m(mp)2−V)=2mp2+V(x). Why this step? Substituting x˙=p/m everywhere expresses H in (x,p) only — here it equals total energy T+V.
Equations.x˙=∂p∂H=mp,p˙=−∂x∂H=−dxdV.Why this step? The second is just mx¨=−V′(x) — Newton's second law re-emerges, confirming consistency.
V=21mω2x2, so H=2mp2+21mω2x2.
x˙=mp,p˙=−mω2x.Why interesting? Eliminating p: x¨=−ω2x. In phase space (x,p) the trajectory is an ellipse of constant energy — the orbit encloses constant area∮pdx=2πE/ω, a hint of action quantization.
Show the abstract recipe always reduces to Newton when H=T+V with p=mq˙; the structure guarantees it.
Recall Feynman: explain to a 12-year-old
Imagine you describe a swinging ball not by "where it is and how fast," but by "where it is and how much push it carries" (that push is momentum). Hamilton found two beautifully simple rules: how the position changes depends on how the energy changes with push, and how the push changes depends on how the energy changes with position — with a minus sign so nothing runs away. Plot position sideways and push upward, and the ball traces a closed loop forever, like a clock hand. The size of the loop never changes — that's energy staying constant.
Dekho, Lagrangian mechanics mein hum position q aur velocity q˙ use karte hain, aur humein n second-order equations milti hain. Hamilton ne ek smart chaal chali: velocity ko hatao, uski jagah momentump=∂L/∂q˙ le aao. Phir ek naya function banao — Hamiltonian H=∑pq˙−L — jo sirf (q,p) par depend karta hai. Yeh swap ek Legendre transform se hota hai, aur uska kamaal yeh hai ki dq˙ wala term apne aap cancel ho jaata hai kyunki ∂L/∂q˙ to p hi hai.
Iske baad do simple equations nikalti hain: q˙=+∂H/∂p aur p˙=−∂H/∂q. Yeh canonical equations kehlati hain. Note karo minus sign sirf p wale equation mein aata hai — yeh koi galti nahi, yahi minus energy ko conserve rakhta hai. Yaad rakhne ka tareeka: "q follows p plus, p fights q minus."
Kyun important hai? Kyunki ab system ka pura state ek single point ban jaata hai (q,p) phase space mein, aur uska future ek unique line par chalta hai. Simple harmonic oscillator mein yeh line ek ellipse hoti hai jiska area constant rehta hai — yahi aage chal kar Liouville's theorem aur quantum mechanics tak le jaata hai.
Ek warning: H hamesha total energy E ke barabar nahi hota. Sirf jab kinetic energy velocity mein quadratic ho aur constraints time pe depend na karein, tab H=E. Aur agar H mein explicit time nahi hai, to H conserve hota hai — yeh yaad rakhna exam ke liye gold hai.