Calculus of Variations, Hamilton's stationary action
The main feature of this webpage is the stationary action diagram
The soap film image and the diagam below are here to provide context.

Image credit: Susan Schwartzenberg - Exploratorium
The right hand side of the diagram shows a catenoid surface in cross section. The number in the bottom right corner is the total surface area. Scramble the sliders, and then keep working the sliders to home in on minimized surface area. (To save time, scramble only the first three sliders; leave the fourth in de default position.)
In the final position: for every slider the response to variation is stationary. If on every subsection the response to variation is stationary then for the overall domain the response is stationary.
Calculus of variations is that you take the limit of going to infinitesimally small subsections.
Mathematical implementation of the process expressed in the diagram is described in the article Calculus of Variations, as applied in Physics.
For the next diagram, the main feature, I suggest that you open two side-by-side instances of your browser, with this page open in both instances. Use one of them to scroll through the description so that you're not scrolling up and down all the time.
Potential propertional to the cube of the height
The case represented in the interactive diagram below is the case of an object thrown vertically upward, subject to a force such that the potential increases with the cube of the height.
Of course, a case with a potential that increases with the cube of the height is unlikely to actually occur. I selected that potential because the diagram that it produces is particularly well suited to showcase Hamilton's stationary action.
The interactive diagram consists of three subpanels with a sequence of displays.
First diagram: the axes are labeled 'time' and 'height'
Second diagram: the axes are labeled 'time' and 'energy'
Third diagram: the axes are labeled 'variation' and 'integral'
The first diagram responds to the slider setting. The content in the second diagram follows the content of the first diagram; the content of the third diagram follows the content of the second diagram.
I will refer to the diagrams in the respective subpanels as, 'the first diagram', 'the second diagram', and 'the third diagram'
First diagram The grey curve, the true trajectory, was obtained by applying numerical integration: Runge Kutta 4. With \(h\) for 'height': the magnitude of the acceleration was obtained by differentiating the potential energy with respect to position coordinate: \(\tfrac{d(h^3)}{dh}=3h^2\). In the diagram: at time coordinate \({t=1}\) the object is back to height zero; that was achieved by tweaking the initial velocity.
The orange curve is a polynomial approximation of the true trajectory. The polynomial is of the form \({f(x)=a + bx^2+cx^4+dx^6}\). The variation is applied by multiplying the value of the polynomial with the slider value.
In the code that runs the diagram: to obtain the velocity (for the value of the kinetic energy) the polynomial is differentiated with respect to the time coordinate.
Second diagram As we know: the sum of kinetic energy and potential energy is a conserved quantity. It follows: for the true trajectory the kinetic energy and the minus potential energy are parallel to each other at every point along the timeline. That is the reason why the potential energy is represented as minus potential energy.
The shape of the energy curve is determined by the following two factors: the shape of the trajectory, and how the energy is a function of the trajectory. As you move the variation parameter slider: it is only at the value 1.00 that the red curve (\(E_k\)) and the green curve (-\(E_p\)) are parallel to each other for every point along the timeline.
Third diagram The red curve tracks the value of the kinetic-energy-integral as a function of the variational parameter. The green curve tracks the potential-energy-integral.
The way that calculus of variation operates: the direction of sweeping out variation coincides with the direction of the position coordinate. (In this diagram there is one degree of freedom, the relation generalizes to cases with multiple degrees of freedom. With two spatial degrees of freedom: for each of the degrees of freedom a corresponding variation is applied.)
The diagram demonstrates: as you apply variation: because \({\small \tfrac{1}{2}}mv^2\) is quadratic the kinetic-energy-integral-response to variation follows a quadratic function. For the potential energy: in the case displayed here the potential energy is a cubic function of height hence the potential-energy-integral-response to variation follows a cubic function
The pattern as it plays out in this diagram generalizes to all instances of application of Hamilton's stationary action:
The response of the kinetic-energy-integral is for all cases quadratic because \({\small \tfrac{1}{2}}mv^2\) is a quadratic expression. For the response of the potential-energy-integral: we have that the potential can be any power of the position coordinate. If the potential is to the power \(n\) then response of the potential-energy-integral will be to the power \(n\). Example: for an inverse square law the potential is inversely proportional to radial distance: \(r^{-1}\) Then the response to variation will follow an \(r^{-1}\) function .
Connection between slope of the integrand and derivative of the integral
In the third diagram: as you move the slider you are traversing variation space. At \({p=1.0}\) the derivative of the blue curve is zero. Given that the blue curve is the sum of the red curve and the green curve it follows that at \({p=1.0}\) the red curve and the green curve have the same tangent angle, with opposite sign.
Compare the second and the third diagram:
Second diagram: at \(p=1.0\) the kinetic energy curve and the minus potential energy curve are parallel to each other over the whole timeline.
Third diagram: at \(p=1.0\): for the the kinetic-energy-integral function and the potential-energy-integral function: the respective tangent lines have the same angle (with opposite sign).
The connection is one of matching rate of change. At \(p=1.0\) the second diagram slopes are matching each other, and the third diagram tangent line angles are matching each other
Those two matching pairs: that is how the mathematics works.
In the case of Hamilton's stationary action:
The integral-with-respect-to-time of the energy is obtained for the purpose of differentiating that integral with respect to variation.
For any curve: the derivative of the integral is proportional to the slope of the integrand. This mathematical connection works for any subsection of the curve, large or small.
The implication:
We have for Hamilton's stationary action: the process of identifying the point in variation space such that the derivative of the kinetic-energy-integral matches the derivative of the potential-energy-integral, is a process of finding a trajectory such that over the whole timeline the rate of change of kinetic energy continuously matches the rate of change of potential energy.
Mathematical implementation of the process expressed in the diagram is described in the article about Hamilton's stationary action
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last time this page was modified: August 20 2025