Why do Lagrangians and Hamiltonians give the equations of motion? [duplicate]

I remember asking my second year Mechanics teacher about why do the Lagrangians give the equations of motion. His answer was that there is no answer to that, it is an empirical fact, and that asking the why of the Lagrangians is the same as asking why Newton's laws hold.

I understood his point but I wonder if you have a better answer. Why do Hamiltonians and Lagrangians work?

marked as duplicate by Qmechanic♦Jun 6 '13 at 0:11

• What do you mean by "why"? Are you asking if the stationary action principle of classical mechanics can be proven from something more "fundamental"? – joshphysics Jun 5 '13 at 21:43
• That's it. I mean it's kinda "magical", I mean, you get the Lagrangian and it gives all the information you want, and everything works pretty fine, but why? – Yossarian Jun 5 '13 at 21:47
• Possible duplicates: physics.stackexchange.com/q/9/2451 , physics.stackexchange.com/q/3500/2451 , physics.stackexchange.com/q/15899/2451 and links therein. – Qmechanic Jun 5 '13 at 21:48
• The origin is Quantum Mechanics. To calculate a transition amplitude, you have expressions like : $Z = \int d\Phi e^{\frac{-i}{\hbar} S(\Phi)}$, where $\Phi$ is a possible path in space and time, and $S = \int dt L(t)$ is the action (L being the lagrangian). The classical path corresponds to a stationnary action, that means that all the paths which are just near the classical path make together a collective positive contribution (because their relative phase ~ 0), while paths far from the classical path correspond to a phase which is varying extremely fast, so that their contribution is 0. – Trimok Jun 6 '13 at 12:24