Skip to main content
Physics LibreTexts

13.9: Hamilton's Variational Principle

  • Page ID
    8446
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Hamilton’s variational principle in dynamics is slightly reminiscent of the principle of virtual work in statics, discussed in Section 9.4 of Chapter 9. When using the principle of virtual work in statics we imagine starting from an equilibrium position, and then increasing one of the coordinates infinitesimally. We calculate the virtual work done and set it to zero. I am slightly reminded of this when discussing Hamilton’s principle in dynamics

    Imagine some mechanical system – some contraption including in its construction various wheels, jointed rods, springs, elastic strings, pendulums, inclined planes, hemispherical bowls, and ladders leaning against smooth vertical walls and smooth horizontal floors. It may require \(N\) generalized coordinates to describe its configuration at any time. Its configuration could be described by the position of a point in \(N\)-dimensional space. Or perhaps it is subject to \(k\) holonomic constraints – in which case the point that describes its configuration in \(N\)-dimensional space is not free to move anywhere in that space, but is constrained to slither around on a surface of dimension \(N-k\).

    The system is not static, but it is evolving. It is changing from some initial state at time \(t_{1}\) to some final state at time \(t_{2}\). The generalized coordinates that describe it are changing with time – and the point in \(N\)-space is slithering round on its surface of dimension \(N-k\). One can imagine that at any instant of time one can calculate its kinetic energy \(T\) and its potential energy \(V\), and hence its lagrangian \(L=T-V\). You can multiply \(L\) at some moment by a small time interval \(\delta t\) and then add up all of these products between \(t_{1}\) and \(t_{2}\) to form the integral

    \[ \int_{t_{1}}^{t_{2}}L\,dt. \nonumber \]

    This quantity – of dimension ML2T-1 and SI unit J s – is sometimes called the “action”. There are many different ways in which we can imagine the system to evolve from its initial state to its final state – and there are many different routes that we can imagine might be taken by our point in \(N\)-space as its moves from its initial position to its final position, as long as it moves over its surface of dimension \(N-k\). But, although we can imagine many such routes, the manner in which the system will actually evolve, and the route that the point will actually take is determined by Hamilton’s principle; and the route, according to this principle, is such that the integral \(\int_{t_{1}}^{t_{2}}Ldt\) is a minimum, or a maximum, or an inflection point, when compared with other imaginable routes. Stated otherwise, let us suppose that we calculate \(\int_{t_{1}}^{t_{2}}Ldt\) over the actual route taken and then calculate the variation in \(\int_{t_{1}}^{t_{2}}Ldt\) if the system were to move over a slightly different adjacent path. Then (and here is the analogy with the principle of virtual work in a statics problem) this variation

    \[ \delta\int_{t_{1}}^{t_{2}}L\,dt \nonumber \]

    from what \(\int_{t_{1}}^{t_{2}}Ldt\) would have been over the actual route is zero. And this is Hamilton’s variational principle.

    The next questions will surely be: Can I use this principle for solving problems in mechanics? Can I prove this bald assertion? Let me try to use the principle to solve two simple and familiar problems, and then move on to a more general problem.

    Example \(\PageIndex{1}\)

    Imagine that we have a particle than can move in one dimension (i.e. one coordinate – for example its height \(y\) above a table - suffices to describe its position), and that when its coordinate is \(y\) its potential energy is

    \[ V=mgy. \label{13.9.1} \]

    Its kinetic energy is, of course,

    \[ T=\frac{1}{2}m\dot{y}^{2}. \label{13.9.2} \]

    We are going to use the variational principle to find the equation of motion – i.e we are going to find an expression for its acceleration. I imagine at the moment you have no idea what its acceleration could possibly be – but do not worry, for we know that the lagrangian is

    \[ L=\frac{1}{2}m\dot{y}^{2}-mgy, \label{13.9.3} \]

    and we’ll make short work of it with Hamilton’s variational principle and soon find the acceleration. According to this principle, \(y\) must vary with \(t\) in such a manner that

    \[ m\delta\int_{t_{1}}^{t_{2}}(\frac{1}{2}\dot{y}^{2}-gy)dt=0. \label{13.9.4} \]

    Let us vary \(\dot{y}\) by \(\delta \dot{y}\) and \(y\) by \(\delta y\) see how the integral varies.

    The integral is then

    \[ m\int_{t_{1}}^{t_{2}}(\dot{y}\delta\dot{y}-g\delta y)dt, \label{13.9.5} \]

    which I’ll call \(I_{1}-I_{2}\).

    Now \(\dot{y}=\frac{dy}{dt}\) and if \(y\) varies by \(\delta y\), the resulting variation in \(\dot{y}\) will be \(\delta\dot{y}=\frac{d}{dt}\delta y\), or \(\delta\dot{y}dt=d\delta y\).

    Therefore

    \[ I_{1}=m\int_{t_{1}}^{t_{2}}\dot{y}d\delta y. \label{13.9.6} \]

    (If unconvinced of this, consider \(\int e^{t}\cos tdt=\int e^{t}\frac{d}{dt}\sin tdt=\int e^{t}d\sin t\).)

    By integration by parts:

    \[ I_{1}=[m \dot{y} \delta y]_{t_{1}}^{t_{2}}-m\int_{t_{1}}^{t_{2}}\delta yd\dot{y}. \label{13.9.10} \]

    The first term is zero because the variation is zero at the beginning and end points. In the second term, \(d\dot{y}=\ddot{y}dt\) and therefore

    \[ I_{1}=-m\int_{t_{1}}^{t_{2}}\ddot{y}\delta ydt \label{13.9.11} \]

    \[ \delta \int_{t_{1}}^{t_{2}}Ldt=-m\int_{t_{1}}^{t_{2}}(\ddot{y}+g)\delta ydt, \label{13.9.12} \]

    and, for this to be zero, we must have

    \[ \ddot{y}=-g. \label{13.9.13} \]

    This is the equation of motion that we sought. You would never have guessed this, would you?

    Now let’s do another one-dimensional problem.

    Example \(\PageIndex{2}\)

    Only one coordinate, \(x\), describes the particle’s position, and, when its coordinate is \(x\) we’ll suppose that its potential energy is \(V=\frac{1}{2}m\omega^{2}x^{2}\) and its kinetic energy is, of course, \(T=\frac{1}{2}m\dot{x}^{2}\). The equation of motion, or the way in which the acceleration varies with position, must be such as to satisfy

    \[ \frac{1}{2}m\delta \int_{t_{1}}^{t_{2}}(\dot{x}^{2}-\omega^{2}x^{2})dt=0. \label{13.9.14} \]

    If we vary \(\dot{x}\) by \(\delta\dot{x}\) and \(x\) by \(\delta x\) the variation in the integral will be

    \[ m\int_{t_{1}}^{t_{2}}(\dot{x}\delta\dot{x}-\omega^{2}x\delta x)dt=I_{1}-I_{2}. \label{13.9.15} \]

    By precisely the same argument as before, the first integral is found to be \(-m\int_{t_{1}}^{t_{2}}\ddot{x}\delta x\,dt\)

    Therefore

    \[ \delta \int_{t_{1}}^{t_{2}}L\,dt=-m\int_{t_{1}}^{t_{2}}\ddot{x}\delta x\,dt-m\omega^{2}\int_{t_{1}}^{t_{2}}x\delta x\,dt, \label{13.9.16} \]

    and, for this to be zero, we must have

    \[ \ddot{x}=-\omega^{2}x. \label{13.9.17} \]

    These two examples must have given the impression that we are doing something very difficult in order to derive something that is immediately obvious – but the examples were just intended to show the direction of a more general argument we are about to make.

    This time, we’ll consider a very general system, in which we write the lagrangian as a function of the (several) generalized coordinates and their time rates of change - i.e. \(L=L(q_{i},\dot{q_{i}})\) - without specifying any particular form of the function – and we’ll carry out the same sort of argument to derive a very general equation of motion.

    We have

    \[ \delta\int_{t_{1}}^{t_{2}}Ldt=\int_{t_{1}}^{t_{2}}\delta L dt=\int_{t_{1}}^{t_{2}}\sum_{i}\left(\frac{\partial L}{\partial q_{i}}\delta q_{i}+\frac{\partial L}{\partial \dot{q_{i}}}\delta \dot{q_{i}}\right)dt=0. \label{13.9.18} \]

    As before, \(\delta \dot{q_{i}}=\frac{d}{dt}\delta q_{i}\) so that

    \[ \int_{t_{1}}^{t_{2}}\frac{\partial L}{\partial \dot{q_{i}}}\delta \dot{q_{i}}dt=\int_{t_{1}}^{t_{2}}\frac{\partial L}{\partial \dot{q_{i}}} \frac{d}{dt}\delta q_{i}dt=\int_{t_{1}}^{t_{2}}\frac{\partial L}{\partial \dot{q_{i}}} d\delta q_{i}=\left[\frac{\partial L}{\partial \dot{q_{i}}}\delta q_{i}\right]_{t_{1}}^{t_{2}}-\int_{t_{1}}^{t_{2}}\delta q_{i}\frac{d}{dt}\frac{\partial L}{\partial \dot{q_{i}}}dt \label{13.9.19} \]

    \[ \delta\int_{t_{1}}^{t_{2}}Ldt=\int_{t_{1}}^{t_{2}}\sum_{i} \left(\frac{\partial L}{\partial q_{i}}-\frac{d}{dt}\frac{\partial L}{\partial \dot{q_{i}}}\right)\delta q_{i}dt=0. \label{13.9.20} \]

    Thus we arrive at the general equation of motion

    \[ \frac{\partial L}{\partial q_{i}}-\frac{d}{dt} \left(\frac{\partial L}{\partial \dot{q_{i}}}\right)=0. \label{13.9.21} \]

    Thus we have derived Lagrange’s equation of motion from Hamilton’s variational principle, and this is indeed the way it is often derived. However, in this chapter, I derived Lagrange’s equation quite independently, and hence I would regard this derivation not so much as a proof of Lagrange’s equation, but as a vindication of the correctness of Hamilton’s variational principle.


    This page titled 13.9: Hamilton's Variational Principle is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Jeremy Tatum via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.