- Lagrangian mechanics
**Lagrangian mechanics**is a re-formulation ofclassical mechanics that combinesconservation of momentum withconservation of energy . It was introduced by Italian mathematicianLagrange in1788 . In Lagrangian mechanics, the trajectory of a system of particles is derived by solving Lagrange's equation, given herein, for each of the system'sgeneralized coordinates . Thefundamental lemma of calculus of variations shows that solving Lagrange's equation is equivalent to finding the path that minimizes the action functional, a quantity that is theintegral of theLagrangian over time.The use of generalized coordinates may considerably simplify a system's

analysis . For example, consider a small frictionless bead traveling in a groove. If one is tracking the bead as a particle, calculation of the motion of the bead usingNewtonian mechanics would require solving for the time-varying constraint force required to keep the bead in the groove. For the same problem using Lagrangian mechanics, one looks at the path of the groove and chooses a set of "independent" generalized coordinates that completely characterize the possible motion of the bead. This choice eliminates the need for the constraint force to enter into the resultant system of equations. There are fewer equations since one is not directly calculating the influence of the groove on the bead at a given moment.**Lagrange's equations**The equations of motion in Lagrangian mechanics are "Lagrange's equations", also known as "

Euler–Lagrange equation s". Below, we sketch out the derivation of Lagrange's equation. Please note that in this context, V is used rather than U for potential energy and T replaces K for kinetic energy. See the references for more detailed and more general derivations.Start with

D'Alembert's principle for thevirtual work of applied forces, $mathbf\{F\}\_i$, andinertia l forces on a three dimensional accelerating system of n particles, i, whose motion is consistent with its constraints:cite book |last=Torby |first=Bruce |title=Advanced Dynamics for Engineers |series=HRW Series in Mechanical Engineering |year=1984 |publisher=CBS College Publishing |location=United States of America |isbn=0-03-063366-4 |chapter=Energy Methods] rp|269:$delta\; W\; =\; sum\_\{i=1\}^n\; (\; mathbf\; \{F\}\_\{i\}\; -\; m\_i\; mathbf\{a\}\_i\; )cdot\; delta\; mathbf\; r\_i\; =\; 0$.::$delta\; W$ is the virtual work::$delta\; mathbf\; r\_i$ is the virtual displacement of the system, consistent with the constraints::$m\_i$ are the masses of the particles in the system::$mathbf\; a\_i$ are the accelerations of the particles in the system::$m\_i\; mathbf\; a\_i$ together as products represent the time derivatives of the system momenta, aka. inertial forces::$i$ is an integer used to indicate (via subscript) a variable corresponding to a particular particle::$n$ is the number of particles under consideration

Break out the two terms:

:$delta\; W\; =\; sum\_\{i=1\}^n\; mathbf\; \{F\}\_\{i\}\; cdot\; delta\; mathbf\; r\_i\; -\; sum\_\{i=1\}^n\; m\_i\; mathbf\{a\}\_i\; cdot\; delta\; mathbf\; r\_i\; =\; 0$.

Assume that the following transformation equations from m independent

generalized coordinates , $q\_j$, hold:rp|260:$mathbf\{r\}\_1=mathbf\{r\}\_1(q\_1,\; q\_2,\; ...,\; q\_m,\; t)$,:$mathbf\{r\}\_2=mathbf\{r\}\_2(q\_1,\; q\_2,\; ...,\; q\_m,\; t)$, ...:$mathbf\{r\}\_n=mathbf\{r\}\_n(q\_1,\; q\_2,\; ...,\; q\_m,\; t)$.::$m$ (without a subscript) indicates the total number generalized coordinates

An expression for the

virtual displacement (differential), $delta\; mathbf\{r\}\_i$, of the system isrp|264:$delta\; mathbf\{r\}\_i\; =\; sum\_\{j=1\}^m\; frac\; \{partial\; mathbf\; \{r\}\_i\}\; \{partial\; q\_j\}\; delta\; q\_j$.::$j$ is an integer used to indicate (via subscript) a variable corresponding to a generalized coordinate

The applied forces may be expressed in the generalized coordinates as

generalized forces , $Q\_j$,rp|265:$Q\_j\; =\; sum\_\{i=1\}^n\; mathbf\; \{F\}\_\{i\}\; cdot\; frac\; \{partial\; mathbf\; \{r\}\_i\}\; \{partial\; q\_j\}$.

Combining the equations for $delta\; W$, $delta\; mathbf\{r\}\_i$, and $Q\_j$ yields the following result after pulling the sum out of the dot product in the second term:rp|269

:$delta\; W\; =\; sum\_\{j=1\}^m\; Q\_j\; delta\; q\_j\; -\; sum\_\{j=1\}^m\; sum\_\{i=1\}^n\; m\_i\; mathbf\{a\}\_i\; cdot\; frac\; \{partial\; mathbf\; \{r\}\_i\}\; \{partial\; q\_j\}\; delta\; q\_j\; =\; 0$.

Substituting in the result from the kinetic energy relations to change the inertial forces into a function of the kinetic energy leavesrp|270

:$delta\; W\; =\; sum\_\{j=1\}^m\; Q\_j\; delta\; q\_j\; -\; sum\_\{j=1\}^m\; left\; (\; frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; T\}\{partial\; dot\{q\}\_j\}\; ight\; )\; -\; frac\; \{partial\; T\}\{partial\; q\_j\}\; ight\; )\; delta\; q\_j\; =\; 0$.

In the above equation, $delta\; q\_j$ is arbitrary, though it is—by definition—consistent with the constraints. So the relation must hold term-wise:rp|270

:$Q\_j\; =\; frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; T\}\{partial\; dot\{q\}\_j\}\; ight\; )\; -\; frac\; \{partial\; T\}\{partial\; q\_j\}$.

If the $mathbf\; F\_i$ are conservative, they may be represented by a

scalar potential field, $V$:rp|266 & 270$mathbf\; F\_i\; =\; -\; abla\; V\; Rightarrow\; Q\_j\; =\; -\; sum\_\{i=1\}^n\; abla\; V\; cdot\; frac\; \{partial\; mathbf\; \{r\}\_i\}\; \{partial\; q\_j\}\; =\; -\; frac\; \{partial\; V\}\{partial\; q\_j\}$.

The previous result may be easier to see by recognizing that $V$ is a function of the $mathbf\; \{r\}\_i$, which are in turn functions of $q\_j$, and then applying the

chain rule to the derivative of $V$ with respect to $q\_j$.The definition of the

Lagrangian isrp|270:$mathcal\{L\}\; =\; T\; -\; V$.

Since the potential field is only a function of position, not velocity,

**Lagrange's equations**are as follows:rp|270:$0\; =\; frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; mathcal\; L\}\{partial\; dot\{q\}\_j\}\; ight\; )\; -\; frac\; \{partial\; mathcal\; L\}\{partial\; q\_j\}$.

This is consistent with the results derived above and may be seen by differentiating the right side of the Lagrangian with respect to $dot\{q\}\_j$ and time, and solely with respect to $q\_j$, adding the results and associating terms with the equations for $mathbf\; F\_i$ and $Q\_j$.

In a more general formulation, the forces could be both potential and viscous. If an appropriate transformation can be found from the $mathbf\; F\_i$, Rayleigh suggests using a dissipation function, $D$, of the following form:rp|271

:$D\; =\; frac\; \{1\}\{2\}\; sum\_\{j=1\}^m\; sum\_\{k=1\}^m\; C\_\{j\; k\}\; dot\{q\}\_j\; dot\{q\}\_k$.::$C\_\{j\; k\}$ are constants that are related to the damping coefficients in the physical system, though not necessarily equal to them

If $D$ is defined this way, thenrp|271

:$Q\_j\; =\; -\; frac\; \{partial\; V\}\{partial\; q\_j\}\; -\; frac\; \{partial\; D\}\{partial\; dot\{q\}\_j\}$ and:$0\; =\; frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; mathcal\; L\}\{partial\; dot\{q\}\_j\}\; ight\; )\; -\; frac\; \{partial\; mathcal\; L\}\{partial\; q\_j\}\; +\; frac\; \{partial\; D\}\{partial\; dot\{q\}\_j\}$.

**Kinetic energy relations**The

kinetic energy , $T$, for the system of particles is defined byrp|269:$T\; =\; frac\; \{1\}\{2\}\; sum\_\{i=1\}^n\; m\_i\; mathbf\; \{v\}\_i\; cdot\; mathbf\; \{v\}\_i$.

The partial derivative of $T$ with respect to the

time derivative s of the generalized coordinates, $dot\{q\}\_j$, isrp|269:$frac\; \{partial\; T\}\{partial\; dot\{q\}\_j\}\; =\; sum\_\{i=1\}^n\; m\_i\; mathbf\; \{v\}\_i\; cdot\; frac\; \{partial\; mathbf\; \{v\}\_i\}\; \{partial\; dot\{q\}\_j\}$.

The previous result may be difficult to visualize. As a result of the

product rule , the derivative of a generaldot product $frac\{d\}\{dx\}\; (\; mathbf\{f\}(x)\; cdot\; mathbf\{g\}(x)\; )$ is $mathbf\{f\}(x)\; cdot\; frac\{d\}\{dx\}\; mathbf\{g\}(x)\; +\; mathbf\{g\}(x)\; cdot\; frac\{d\}\{dx\}\; mathbf\{f\}(x)$ This general result may be seen by briefly stepping into aCartesian coordinate system , recognizing that the dot product is (there) a term-by-term product sum, and also recognizing that the derivative of a sum is the sum of its derivatives. In our case,**f**and**g**are equal to**v**, which is why the factor of one half disappears.According to the

chain rule and the coordinate transformation equations given above for $mathbf\{r\}$, its time derivative, $mathbf\{v\}$, is:rp|264:$mathbf\{v\}\_i\; =\; sum\_\{k=1\}^m\; frac\; \{partial\; mathbf\{r\}\_i\}\{partial\; q\_k\}\; dot\{q\}\_k\; +\; frac\; \{partial\; mathbf\{r\}\_i\}\{partial\; t\}$.

Together, the definition of $mathbf\; v\_i$ and the total differential, $d\; mathbf\; \{r\}\_i$, suggest thatrp|269

:$frac\; \{partial\; mathbf\; \{v\}\_i\}\{partial\; dot\{q\}\_j\}\; =\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}$.

[ Remember that :$frac\; \{partial\; \}\; \{partial\; \{dot\{q\}\_k\; \{A\}\{dot\{q\}\_k\}\; =\; A$. Also remember that in the sum, there is only one $\{dot\{q\}\_j\}$. ]

Substituting this relation back into the expression for the partial derivative of $T$ givesrp|269

:$frac\; \{partial\; T\}\{partial\; dot\{q\}\_j\}\; =\; sum\_\{i=1\}^n\; m\_i\; mathbf\; v\_i\; cdot\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}$.

Taking the time derivative givesrp|270

:$frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; T\}\{partial\; dot\{q\}\_j\}\; ight\; )\; =\; sum\_\{i=1\}^n\; left\; [\; m\_i\; mathbf\; a\_i\; cdot\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}\; +\; m\_i\; mathbf\; \{v\}\_i\; cdot\; frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}\; ight\; )\; ight\; ]$.

Using the chain rule on the last term givesrp|270

:$frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}\; ight\; )\; =\; sum\_\{k=1\}^m\; frac\; \{partial^2\; mathbf\; r\_i\}\{partial\; q\_j\; partial\; q\_k\}\; dot\{q\_k\}\; +\; frac\; \{partial^2\; mathbf\; r\_i\}\{partial\; q\_j\; partial\; t\}$.

From the expression for $mathbf\; v\_i$, one sees thatrp|270

:$frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}\; ight\; )\; =\; frac\; \{partial\; mathbf\; \{v\}\_i\}\{partial\; q\_j\}$.

This allows simplification of the last term,rp|270

:$frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; T\}\{partial\; dot\{q\}\_j\}\; ight\; )\; =\; sum\_\{i=1\}^n\; left\; [\; m\_i\; mathbf\; a\_i\; cdot\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}\; +\; m\_i\; mathbf\; \{v\}\_i\; cdot\; frac\; \{partial\; mathbf\; \{v\}\_i\}\{partial\; q\_j\}\; ight\; ]$.

The partial derivative of $T$ with respect to the generalized coordinates, $q\_j$, isrp|270

:$frac\; \{partial\; T\}\{partial\; q\_j\}\; =\; sum\_\{i=1\}^n\; m\_i\; mathbf\; \{v\}\_i\; cdot\; frac\; \{partial\; mathbf\; \{v\}\_i\}\; \{partial\; q\_j\}$.Clarifyme|date=March 2008

[This last result may be obtained by doing a partial differentiation directly on the kinetic energy definition represented by the first equation.] The last two equations may be combined to give an expression for the inertial forces in terms of the kinetic energy:rp|270

:$frac\; \{d\}\{d\; t\}\; left\; (\; frac\; \{partial\; T\}\{partial\; dot\{q\}\_j\}\; ight\; )\; -\; frac\; \{partial\; T\}\{partial\; q\_j\}\; =\; sum\_\{i=1\}^n\; m\_i\; mathbf\; a\_i\; cdot\; frac\; \{partial\; mathbf\; \{r\}\_i\}\{partial\; q\_j\}$

**Old Lagrange's equations**Consider a single particle with

mass "m" andposition vector $old\{r\}$, moving under an appliedforce , $old\{F\}$, which can be expressed as thegradient of a scalar potential energy function $V\; (old\{r\},t)$::$old\{F\}\; =\; -\; old\{\; abla\}\; V.$

Such a force is independent of third- or higher-order derivatives of $old\{r\}$, so Newton's second law forms a set of 3 second-order

ordinary differential equation s. Therefore, the motion of the particle can be completely described by 6 independent variables, or "degrees of freedom". An obvious set of variables is $\{\; old\{r\}\_j,\; dot\{old\{r\_j\; |\; j\; =\; 1,\; 2,\; 3\}$, the Cartesian components of $old\{r\}$ and their time derivatives, at a given instant of time (i.e. position (x,y,z) and velocity $(v\_x,v\_y,v\_z)$).More generally, we can work with a set of

generalized coordinates , $q\_j$, and their time derivatives, the generalized velocities, $dot\{q\_j\}$. The position vector, $old\{r\}$, is related to the generalized coordinates by some "transformation equation"::$old\{r\}\; =\; old\{r\}(q\_i\; ,\; q\_j\; ,\; q\_k,\; t).$

For example, for a

simple pendulum of length "l", a logical choice for a generalized coordinate is the angle of the pendulum from vertical, θ, for which the transformation equation would be:$old\{r\}(\; heta,\; dot\{\; heta\}\; ,\; t)\; =\; (l\; sin\; heta,\; l\; cos\; heta)$.

The term "generalized coordinates" is really a holdover from the period when Cartesian coordinates were the default coordinate system.

Consider an arbitrary displacement $delta\; old\{r\}$ of the particle. The work done by the applied force $old\{F\}$ is $W\; =\; old\{F\}\; cdot\; delta\; old\{r\}$. Using Newton's second law, we write:

:$egin\{matrix\}\; old\{F\}\; cdot\; delta\; old\{r\}\; =\; mddot\{old\{r\; cdot\; delta\; old\{r\}.end\{matrix\}$

Since work is a physical scalar quantity, we should be able to rewrite this equation in terms of the generalized coordinates and velocities. On the left hand side,

:$egin\{matrix\}\; old\{F\}\; cdot\; old\{delta\}\; old\{r\}\; =\; -\; old\{\; abla\}\; V\; cdot\; displaystylesum\_i\; \{partial\; old\{r\}\; over\; partial\; q\_i\}\; delta\; q\_i\; \backslash \; \backslash \; =\; -\; displaystylesum\_\{i,j\}\; \{partial\; V\; over\; partial\; r\_j\}\; \{partial\; r\_j\; over\; partial\; q\_i\}\; delta\; q\_i\; \backslash \; \backslash \; =\; -\; displaystylesum\_i\; \{partial\; V\; over\; partial\; q\_i\}\; delta\; q\_i.\; \backslash \; end\{matrix\}$

On the right hand side, carrying out a change of coordinatesClarifyme|date=March 2008, we obtain:

$m\; ddot\{old\{r\; cdot\; delta\; old\{r\}\; =\; m\; sum\_\{i,j\}\; ddot\{r\_i\}\; \{partial\; r\_i\; over\; partial\; q\_j\}\; delta\; q\_j$

Rearranging Slightly:

$m\; ddot\{old\{r\; cdot\; delta\; old\{r\}\; =\; m\; sum\_j\; left\; [\; sum\_i\; ddot\{r\_i\}\; \{partial\; r\_i\; over\; partial\; q\_j\}\; ight]\; delta\; q\_j$

Now, by performing an "integration by parts" transformation, with respect to t:

$m\; ddot\{old\{r\; cdot\; delta\; old\{r\}\; =\; m\; sum\_j\; left\; [\; sum\_i\; left\; [\; \{mathrm\{d\}\; over\; mathrm\{d\}t\}\; left(\; dot\{r\_i\}\; \{partial\; r\_i\; over\; partial\; q\_j\}\; ight)\; -\; dot\{r\_i\}\; \{mathrm\{d\}\; over\; mathrm\{d\}t\}left(\; \{partial\; r\_i\; over\; partial\; q\_j\}\; ight)\; ight]\; ight]\; delta\; q\_j$

Recognizing that $\{mathrm\{d\}\; over\; mathrm\{d\}t\}\{partial\; r\_j\; over\; partial\; q\_i\}\; =\; \{partial\; dot\{r\_j\}\; over\; partial\; q\_i\}$ and $\{partial\; r\_j\; over\; partial\; q\_i\}\; =\; \{partial\; dot\{r\_j\}\; over\; partial\; dot\{q\_i$, we obtain:

$m\; ddot\{old\{r\; cdot\; delta\; old\{r\}\; =\; m\; sum\_j\; left\; [\; sum\_i\; left\; [\; \{mathrm\{d\}\; over\; mathrm\{d\}t\}\; left(\; dot\{r\_i\}\; \{partial\; dot\{r\_i\}\; over\; partial\; dot\{q\_j\; ight)\; -\; dot\{r\_i\}\; \{partial\; dot\{r\_i\}\; over\; partial\; q\_j\}\; ight]\; ight]\; delta\; q\_j$

Now, by changing the order of differentiation, we obtain:

$m\; ddot\{old\{r\; cdot\; delta\; old\{r\}\; =\; m\; sum\_j\; left\; [\; sum\_i\; left\; [\; \{mathrm\{d\}\; over\; mathrm\{d\}t\}\; \{partial\; over\; partial\; dot\{q\_j\; left(\; frac\{1\}\{2\}\; dot\{r\_i\}^2\; ight)\; -\; \{partial\; over\; partial\; q\_j\}\; left(\; frac\{1\}\{2\}\; dot\{r\_i\}^2\; ight)\; ight]\; ight]\; delta\; q\_j$

Finally, we change the order of summation:

$m\; ddot\{old\{r\; cdot\; delta\; old\{r\}\; =\; sum\_j\; left\; [\; \{mathrm\{d\}\; over\; mathrm\{d\}t\}\; \{partial\; over\; partial\; dot\{q\_j\; left(\; sum\_i\; frac\{1\}\{2\}\; m\; dot\{r\_i\}^2\; ight)\; -\; \{partial\; over\; partial\; q\_j\}\; left(\; sum\_i\; frac\{1\}\{2\}\; m\; dot\{r\_i\}^2\; ight)\; ight]\; delta\; q\_j$

Which is equivalent to:

:$m\; ddot\{old\{r\; cdot\; delta\; old\{r\}=\; sum\_i\; left\; [\{mathrm\{d\}\; over\; mathrm\{d\}t\}\{partial\; T\; over\; partial\; dot\{q\_i-\{partial\; T\; over\; partial\; q\_i\}\; ight]\; delta\; q\_i$

where $T=frac\{1\}\{2\}mdot\{old\{rcdotdot\{old\{r$ is the kinetic energy of the particle. Our equation for the work done becomes

:$sum\_i\; left\; [\{mathrm\{d\}\; over\; mathrm\{d\}t\}\{partial\{T\}over\; partial\{dot\{q\_i\}-\{partial\{(T-V)\}over\; partial\; q\_i\}\; ight]\; delta\; q\_i\; =\; 0.$

However, this must be true for "any" set of generalized displacements $delta\; q\_i$, so we must have

:$left\; [\; \{mathrm\{d\}\; over\; mathrm\{d\}t\}\{partial\{T\}over\; partial\{dot\{q\_i\}-\{partial\{(T-V)\}over\; partial\; q\_i\}\; ight]\; =\; 0$

for "each" generalized coordinate $delta\; q\_i$. We can further simplify this by noting that "V" is a function solely of

**r**and "t", and**r**is a function of the generalized coordinates and "t". Therefore, "V" is independent of the generalized velocities::$\{mathrm\{d\}\; over\; mathrm\{d\}t\}\{partial\{V\}over\; partial\{dot\{q\_i\}\; =\; 0.$

Inserting this into the preceding equation and substituting "L" = "T" - "V", called the Lagrangian, we obtain Lagrange's equations:

:$\{partial\{mathcal\{Lover\; partial\; q\_i\}\; =\; \{mathrm\{d\}\; over\; mathrm\{d\}t\}\{partial\{mathcal\{Lover\; partial\{dot\{q\_i\}.$

There is one Lagrange equation for each generalized coordinate q

_{i}. When q_{i}= r_{i}(i.e. the generalized coordinates are simply the Cartesian coordinates), it is straightforward to check that Lagrange's equations reduce to Newton'ssecond law.The above derivation can be generalized to a system of "N" particles. There will be 6"N" generalized coordinates, related to the position coordinates by 3"N" transformation equations. In each of the 3"N" Lagrange equations, "T" is the total kinetic energy ofthe system, and "V" the total potential energy.

In practice, it is often easier to solve a problem using the

Euler–Lagrange equation s than Newton's laws. This is because appropriate generalized coordinates "q"_{i}may be chosen to exploit symmetries in the system.**Examples**In this section two examples are provided in which the above concepts are applied. The first example establishes that in a simple case, the Newtonian approach and the Lagrangian formalism agree. The second case illustrates the power of the above formalism, in a case which is hard to solve with Newton's laws.

**Falling mass**Consider a point mass "m" falling freely from rest. By gravity a force "F = m g" is exerted on the mass (assuming "g" constant during the motion). Filling in the force in Newton's law, we find $ddot\; x\; =\; g$ from which the solution:$x(t)\; =\; frac\{1\}\{2\}\; g\; t^2$ follows (choosing the origin at the starting point). This result can also be derived through the Lagrange formalism. Take "x" to be the coordinate, which is "0" at the starting point. The kinetic energy is $T\; =\; frac\{1\}\{2\}\; m\; v^2$ and the potential energy is $V\; =\; -\; m\; g\; x$, hence :$mathcal\{L\}\; =\; T\; -\; V\; =\; frac\{1\}\{2\}\; m\; dot\{x\}^2\; +\; m\; g\; x$. Now we find:$0\; =\; frac\{partial\; mathcal\{L\{partial\; x\}\; -\; frac\{mathrm\{d\{mathrm\{d\}t\}\; frac\{partial\; mathcal\{L\{partial\; dot\; x\}\; =\; m\; g\; -\; m\; frac\{mathrm\{d\}\; dot\; x\}\{mathrm\{d\}\; t\}$which can be rewritten as $ddot\; x\; =\; g$, yielding the same result as earlier.

**Pendulum on a movable support**Consider a pendulum of mass "m" and length "l", which is attached to a support with mass "M" which can move along a line in the "x"-direction. Let "x" be the coordinate along the line of the support, and let us denote the position of the pendulum by the angle "θ" from the vertical. The kinetic energy can then be shown to be:$T\; =\; frac\{1\}\{2\}\; M\; dot\{x\}^2\; +\; frac\{1\}\{2\}\; m\; left(\; dot\{x\}\_mathrm\{pend\}^2\; +\; dot\{y\}\_mathrm\{pend\}^2\; ight)\; =\; frac\{1\}\{2\}\; M\; dot\{x\}^2\; +\; frac\{1\}\{2\}\; m\; left\; [\; left(\; dot\; x\; +\; l\; dot\; heta\; cos\; heta\; ight)^2\; +\; left(\; l\; dot\; heta\; sin\; heta\; ight)^2\; ight]\; ,$and the potential energy of the system is

:$V\; =\; m\; g\; operatorname\{y\}\_mathrm\{pend\}\; =\; -\; m\; g\; l\; cos\; heta\; .$

Now carrying out the differentiations gives for the support coordinate "x":$frac\{mathrm\{d\{mathrm\{d\}t\}\; left\; [\; (M\; +\; m)\; dot\; x\; +\; m\; l\; dot\; heta\; cos\; heta\; ight]\; =\; 0,$therefore::$(M\; +\; m)\; ddot\; x\; +\; m\; l\; ddot\; hetacos\; heta-m\; l\; dot\; heta\; ^2\; sin\; heta\; =\; 0$indicating the presence of a constant of motion. The other variable yields:$frac\{mathrm\{d\{mathrm\{d\}t\}left\; [\; m(\; l^2\; dot\; heta\; +\; dot\; x\; l\; cos\; heta\; )\; ight]\; +\; m\; (dot\; x\; l\; dot\; heta\; +\; g\; l)\; sin\; heta\; =\; 0$;therefore:$ddot\; heta\; +\; frac\{ddot\; x\}\{l\}\; cos\; heta\; +\; frac\{g\}\{l\}\; sin\; heta\; =\; 0$.These equations may look quite complicated, but finding them with Newton's laws would have required carefully identifying all forces, which would have been much harder and prone to errors. By considering limit cases ($ddot\; x\; o\; 0$ should give the equations of motion for a pendulum, $ddot\; heta\; o\; 0$ should give the equations for a pendulum in a constantly accelerating system, etc.) the correctness of this system can be verified.

**Hamilton's principle**The action, denoted by $mathcal\{S\}$, is the time integral of the Lagrangian::$mathcal\{S\}\; =\; int\; mathcal\{L\},mathrm\{d\}t.$

Let "q

_{0}" and "q_{1}" be the coordinates at respective initial and final times "t_{0}" and "t_{1}". Using thecalculus of variations , it can be shown the Lagrange's equations are equivalent to "Hamilton's principle "::"The system undergoes the trajectory between t

_{0}and t_{1}whose action has a stationary value."By "stationary", we mean that the action does not vary to first-order for infinitesimal deformations of the trajectory, with the end-points ("q

_{0}", "t_{0}") and ("q_{1}","t_{1}") fixed. Hamilton's principle can be written as::$delta\; mathcal\{S\}\; =\; 0.\; ,!$

Thus, instead of thinking about particles accelerating in response to applied forces, one might think of them picking out the path with a stationary action.

Hamilton's principle is sometimes referred to as the "

principle of least action ". However, this is a misnomer: the action only needs to be stationary, and the correct trajectory could be produced by a maximum,saddle point , or minimum in the action.We can use this principle instead of

Newton's Laws as the fundamental principle of mechanics, this allows us to use an integral principle (Newton's Laws are based on differential equations so they are a differential principle) as the basis for mechanics. However it is not widely stated that Hamilton's principle is a variational principle only withholonomic constraints, if we are dealing with nonholonomic systems then the variational principle should be replaced with one involvingd'Alembert principle ofvirtual work . Working only with holonomic constraints is the price we have to pay for using an elegant variational formulation of mechanics.**Extensions of Lagrangian mechanics**The Hamiltonian, denoted by "H", is obtained by performing a

Legendre transformation on the Lagrangian. The Hamiltonian is the basis for an alternative formulation of classical mechanics known asHamiltonian mechanics . It is a particularly ubiquitous quantity inquantum mechanics (seeHamiltonian (quantum mechanics) ).In

1948 , Feynman invented thepath integral formulation extending theprinciple of least action toquantum mechanics forelectrons andphotons . In this formulation, particles travel every possible path between the initial and final states; the probability of a specific final state is obtained by summing over all possible trajectories leading to it. In the classical regime, the path integral formulation cleanly reproduces Hamilton's principle, andFermat's principle inoptics .**ee also***

Canonical coordinates

*Functional derivative

*Generalized coordinates

*Hamiltonian mechanics

*Lagrangian analysis (applications of Lagrangian mechanics)

*Nielsen form

*Restricted three-body problem **References*** Goldstein, H. "Classical Mechanics," second edition, pp.16 (Addison-Wesley, 1980)

* Moon, F. C. "Applied Dynamics With Applications to Multibody and Mechatronic Systems", pp. 103-168 (Wiley, 1998).**Further reading*** Landau, L.D. and Lifshitz, E.M. "Mechanics", Pergamon Press.

* Gupta, Kiran Chandra, "Classical mechanics of particles and rigid bodies" (Wiley, 1988).**External links*** Tong, David, [

*http://www.damtp.cam.ac.uk/user/tong/dynamics.html Classical Dynamics*] Cambridge lecture notes

* [*http://www.eftaylor.com/software/ActionApplets/LeastAction.html Principle of least action interactive*] Excellent interactive explanation/webpage

* [*http://ocw.mit.edu/NR/rdonlyres/Aeronautics-and-Astronautics/16-61Aerospace-DynamicsSpring2003/D453E02B-5218-4154-8531-DB35ECD76A6C/0/lecture9.pdf Aerospace dynamics lecture notes on Lagrangian mechanics*]

* [*http://ocw.mit.edu/NR/rdonlyres/Aeronautics-and-Astronautics/16-61Aerospace-DynamicsSpring2003/53F21B11-4F88-4870-967A-0C05AD85B104/0/lecture10.pdf Aerospace dynamics lecture notes on Rayleigh dissipation function*]

*Wikimedia Foundation.
2010.*