Professor Turing

Study guides

What is a Lagrangian?

Last updated: 2026-11-26

In classical mechanics a Lagrangian is a function of a system's coordinates, velocities and sometimes time, from which the equations of motion follow. For many introductory systems it is L = T − V, the kinetic energy minus the potential energy.

Start learning No account needed

1. What L is for

Add up L over time along a possible path, between a fixed start and a fixed end. The result is called the action. The path the system takes is one where the action is stationary, meaning that small changes to the path leave it unchanged to first order. That condition leads to Lagrange's equation, d/dt of ∂L/∂v equals ∂L/∂x, with one such equation for each coordinate x and its velocity v.

2. A worked example: why minus?

A 1 kg ball leaves height 0, goes up, and returns to height 0 after 2 s. Try a family of paths with the same start and end, scaled by a number k. The value k = 1 is the path from Newton's second law, and k = 0 means the ball stays on the floor. Guess which k gives the lowest action. The numbers are computed by scripts/what-is-a-lagrangian-worked-example.py in the Professor Turing repository.

ball, 1 kg, leaves y = 0 at t = 0 and is back at t = 2 s
trial paths y = k g t (2 - t) / 2; Newton's path is k = 1
k     action of T - V    integral of T + V
0         0.0000            0.0000
0.5     -24.0100           40.0167
1       -32.0133           96.0400
1.5     -24.0100          168.0700
2         0.0000          256.1067
two masses on a pulley, 3 kg and 2 kg
L = 0.5 (m1 + m2) v^2 + (m1 - m2) g x
acceleration from Lagrange's equation: 1.96 m/s^2
tension, Newton on the 3 kg mass: 23.52 N
tension, Newton on the 2 kg mass: 23.52 N

The action of T − V is lowest at k = 1, at −32.0133 J s. The paths at k = 0.5 and k = 1.5 both give −24.0100. Near k = 1 the curve is flat, and that is the stationary condition. The integral of T + V keeps rising as k passes through 1, so it does not pick out Newton's path. The minus sign is there because it makes the stationary condition agree with F = ma.

3. What you gain: constraints drop out

Hang 3 kg and 2 kg from a light string that does not stretch, over a frictionless pulley of negligible mass. One coordinate, the distance x the heavier mass has dropped, describes both. Then T = ½ (m1 + m2) v² and, up to a constant, V = −(m1 − m2) g x. Lagrange's equation gives (m1 + m2) a = (m1 − m2) g, so a = 1.96 m/s². The tension did not appear. If you want it, go back to Newton for one mass, and both masses give 23.52 N.

Wikipedia's article on Lagrangian mechanics describes two advantages of this approach: Lagrange's equations keep their form when you change coordinates, and constraint forces can be left out when you only want the motion. The working routine is to write the kinetic and potential energies, then apply the equations.

4. A common misconception: L is the total energy

The total energy in these examples is T + V. The Lagrangian is T − V, and in general it changes during the motion while the total energy of the ball on Newton's path stays fixed, since gravity is a conservative force (conservative force). Two further cautions help. "Least action" is a loose name, since the condition asks for a stationary value, which can be a saddle point. Our ball family happens to show a minimum. Also, T − V with a velocity-independent V is not the form for each system: a charged particle in an electromagnetic field needs a term that depends on velocity.

5. Test yourself

Case 1. Set both pulley masses to 2 kg. What does Lagrange's equation say?

Answer to case 1

The term (m1 − m2) g x vanishes, so the acceleration is zero. The velocity stays whatever it was.

Case 2. For a falling mass, L = ½ m v² − m g y. Derive the equation of motion.

Answer to case 2

∂L/∂v = m v and ∂L/∂y = −m g, so m times the acceleration is −m g.

Case 3. You add a constant to V. Does the motion change?

Answer to case 3

No. The derivatives of L with respect to the coordinate and velocity are unchanged.

For more physics practice, see how to study for a physics exam and how to get unstuck.

What the sources found, and their limits

Wikipedia, "Lagrangian mechanics." L = T − V for many systems, the stationary action principle, generalized coordinates, constraints, invariance under coordinate changes and the charged particle. License: CC BY-SA 4.0. Source: Lagrangian mechanics, read on 2026-11-25.

Wikipedia, "Action principles." The path taken has a stationary value of the action, which may be a minimum or a saddle point. License: CC BY-SA 4.0. Source: Action principles, read on 2026-11-25.

Wikipedia, "Conservative force." Gravity as a conservative force and its link to mechanical energy. License: CC BY-SA 4.0. Source: Conservative force, read on 2026-11-25.

Limits: reference articles, introductory use. The ball paths, the pulley numbers and the self-test cases are ours. The ball example compares one family of paths, so it illustrates the principle and does not prove it.

How Professor Turing helps

Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks you questions instead of giving the final answer, does not grade a bare guess, and remembers what you got wrong. No account is needed to start. It's an AI tutor, free to try.

Bring a mechanics system and the coordinate you would choose for it. Its first reply asks about your attempt, such as how you would write the kinetic energy, before it teaches anything. You must be 18 or older, and guest conversations are deleted 7 days after the last activity.

FAQ

How does Lagrangian mechanics differ from Newtonian mechanics? Newton's method works with forces as vectors. The Lagrangian method starts from a single function, often T − V, written in coordinates you choose. For the systems on this page the two give the same motion, and the Lagrangian route let us solve the pulley without finding the tension first.

Does each system have L = T − V? No. It is the form for many introductory systems. A charged particle in an electromagnetic field, for example, has a Lagrangian with a term that depends on velocity.

Start with what you're working on

Tell the tutor which mechanics problem you are working on and let it ask you the questions.

Start learning No account needed

See also: how to study for a physics exam · all study guides