PHY 313, Mechanics

September 14, 2026

Mulitvariable Euler-Lagrange

We may want to optimize a path that is a function of more than one variable. Any path can be written as a parametric curve; for example, in two dimensions we might have \(x = x(u)\) and \(y=y(u)\) where \(u\) is some common parameter. We already use this type of parametric curve every time we use kinematic equations for free-fall trajectories, where the parameter is time. Another example is a circle. You can write the full equation of the circle as \(x^2 + y^2 = R^2\) but it might be more useful as two parametric equations \(x(\theta) = R\cos\theta\) and \(y(\theta) = R\sin\theta\).

Let’s say we want to minimize the parametric curve \(x=x(u)\) and \(y=y(u)\) that connects two points \((x_1,y_1)\) and \((x_2,y_2)\). This is the same problem we have solved previously. We can write the path length as the integral

\[S = \int_1^2 ds = \int_1^2 \sqrt{dx^2 + dy^2} = \int_{u_1}^{u_2} \sqrt{x'(u)^2 + y'(u)^2}du\]

We now have an integral of the general form \(S = \int_{u_1}^{u_2} f(x(u), y(u), x'(u), y'(u), u) du\), to which we can apply the following minimization conditions:

Let the correct minimum path be given by the equations

\[\begin{align*} x(\alpha, u) &= x(0,u) + \alpha\xi(u) \\ y(\beta, u) &= y(0,u) + \beta\nu(u) \\ \frac{\partial S}{\partial \alpha} = \frac{\partial S}{\partial \beta} &= 0 \end{align*}\]

To meet both optimization criteria, we simply solve two Euler-Lagrange equations:

\[\begin{align*} \frac{\partial f}{\partial x} - \frac{d}{du}\left(\frac{\partial f}{\partial x'}\right) &= 0 \\ \frac{\partial f}{\partial y} - \frac{d}{du}\left(\frac{\partial f}{\partial y'}\right) &= 0 \end{align*}\]

Solving in \(x\),

\[\begin{align*} \frac{\partial f}{\partial x} - \frac{d}{du}\left(\frac{\partial f}{\partial x'}\right) &= 0 \\ 0 - \frac{d}{du}\left(\frac{2x'}{\sqrt{x'^2+y'^2}}\right) &= 0 \\ \frac{2x'}{\sqrt{x'^2+y'^2}} &= C_1 \end{align*}\]

In \(y\) we would get the corresponding result \(\frac{2y'}{\sqrt{x'^2+y'^2}} = C_2\). If we take the ratio of \(y'/x'\) we get \(y'/x' = dy/dx = C_2/C_1=m\). The slope is some constant \(m\), so we have recovered our result that the shortest path between two points is a straight line.

If we have more than two variables, then we have more than two Euler-Lagrange equations to solve. We also might want to describe our system in terms of generalized coordinates.

General coordinates

Our main goal in mechanics is to describe an object’s motion. To that end, we started with the kinematic equations, which are really just calculus definitions of position, velocity, and acceleration:

\[\begin{align*} x(t) &= x_0 + v_{0,x} t + \frac{1}{2} a_x t^2 \\ v_x(t) &= v_{0,x} + a_x t \\ a_x(t) &= \text{constant} \end{align*}\]

These, of course, can be extended to any rectangular coordinate (\(x\), \(y\), \(z\)) and you probably also saw their rotational form for motion around a circle of radius \(R\) with constant acceleration:

\[\begin{align*} \theta(t) &= \theta_0 + \omega t + \frac{1}{2} \alpha t^2 \\ \omega(t) &= \omega_0 + \alpha t \\ \alpha &= a_{tan}/R = \text{constant} \end{align*}\]

In advanced classical mechanics, we will need to be able to work in any general coordinate system. Some commone ones will be rectangular, spherical, and cylindrical. The standard defnitions of position, velocity, and acceleration being sequential time derivatives will hold within the coordinate system. But to take integrals, we will need to understand the unit length or line element of each coordinate system.

In our typical three dimensions,

Cartesian coordinates: \(x, y, z\)
Line element: \(ds^2 = dx^2 + dy^2 + dz^2\)

Plane polar coordinates: \(r, \theta\)
Transformation to cartesian: \(x=r\cos\theta, y=r\sin\theta\)
Line element: \(ds^2 = r^2 + r^2d\theta^2\)

Spherical coordinates: \(r, \theta, \phi\)
Transformation to cartesian: \(x = r\sin\theta\cos\phi, y = r\sin\theta\sin\phi, z = r\cos\phi\)
Line element: \(ds^2 = dr^2 + r^2d\theta^2 + r^2\sin^2\theta d\phi^2\)

Cylindrical coordinates: \(r, \phi, z\)
Transformation to cartesian: \(x = r\cos\phi, y = r\sin\phi, z\)
Line element: \(ds^2 = dr^2 + r^2d\phi^2 + z^2\)

When defining a single particle, we have three degrees of freedom in any coordinate system. If we are working with \(n\) particles, then we must have \(3n\) degrees of freedom.

From Marion and Thornton:

If there exits equations of constraint that relate some of these coordinates to others (as would be the case … if some of the particles were connected …), then not all the \(3n\) coordinates are independent. In fact, if there are \(m\) equations of constraint, then \(3n-m\) coordinates are indpendent, and the system is aid to posess \(3n-m\) degrees of freedom.

It is important to note that if \(s=3n-m\) coordinates are required in a given case, we need not choose \(s\) rectangular coordinates or even \(s\) curvilinear coordinates (e.g., spherical, cylindrical). We can choose any \(s\) independent parameters, as long as they completely specify the state of the system. These \(s\) quantities need not even have the deminsions of length. Depending on the problem at hand, it may prove more convenient to choose some of the parameters with dimensions of energy, some with dimensions of (length), some that are dimensionless, and so forth. In Example 6.5, we describe a disk rolling down an inclined plane in terms of one coordinate that was a length and one that was an angle. We give the name generalized coordinates to any set of quantities that completely specifies the state of a system.

The generalized coordinates are typically written \(q_1, q_2, q_3, \ldots\), or simply as the \(q_j\). The choice of generalized coordinates is not unique. We could choose anything, as long as we completely specify the system. Can you think of a few ways to define a coordinate system in the problem mentioned in the text above, with the disk rolling down an incline plane? There are no general rules for choosing a coordinate system. You just have to find what works best for you and the problem at hand. For now let’s take \(s = n\), with no constraints.

Generalized coordinates, just like any other coordinates, can have time derivatives \(\dot{q_1}, \dot{q_2}, \dot{q_3}, \ldots\) or \(\dot{q_j}\). These can be called the generalized velocities.

We will typically want to be able to transform between our generalized coordinates and cartesian coordinates. They should be related to each other by each of the coordinates and time. If \(\alpha\) denotes the particle we are trying to describe out of \(n\) possible particles, then for each particle \(\alpha\):

\(\vec r_{\alpha} = \vec r_{\alpha}\left( q_1, q_2, q_3, \ldots, t \right) = \vec r_{\alpha}\left( q_j, t \right)\)
\(\dot{ \vec{r}}_{\alpha} = \dot {\vec{r}}_{\alpha}\left( q_j, \dot{q_j}, t \right)\)

Likewise, \(q_j = q_j\left(\vec r_1, \vec r_2, \vec r_3, \ldots , t\right) = q_j\left(\vec r_{alpha}, t\right)\)
\(\dot{q_j} = \dot{q_j} \left( \vec r_{\alpha}, \dot{\vec r}_{alpha}, t \right)\)

Lagrangian Mechanics

We want to find, in general, the equations of motion for a particle subject to a conservative force \(\vec F(\vec r)\). We will start with an unconstrained particle, meaning that the particle is in free space and is not subject to any constraints of motion (e.g. sliding down a ramp or confined to a circle). We can partially define the state of this system by its energy, which has two parts:

\[\begin{align*} \text{kinetic energy } T = \frac{1}{2}mv^2 = \frac{1}{2}m\dot{\vec r}^2 = \frac{1}{2}\left(\dot{x}^2 + \dot{y}^2 + \dot{z}^2\right) \\ \text{potential energy} U = U(\vec r) = U(x, y, z) \end{align*}\]

We will define the Lagrangian function \(\mathcal{L} = T - U\). Why are we defining this function? That is a question for you to endlessly ponder. For now, let’s just show that it works and returns the expected equations of motion.

\(\mathcal{L}\) depends on position \((x, y, z)\) by the potential energy \(U\) and the velocity \(\left(\dot{x}, \dot{y}, \dot{z}\right)\) by the kinetic energy \(T\). This means \(\mathcal{L} = \mathcal{L}\left(x, y, z, \dot{x}, \dot{y}, \dot{z}, t\right)\) (time is the parameter for the path \(\vec r(t)\)), which looks a lot like an Euler-Lagrange function! We can then define an integral that should be stationary for the correct path \(\vec r(t)\):

\[S = \int \mathcal{L} dt\]

This is the action integral, where \(S\) is the action. To restate this carefully, we have Hamilton’s Principle:

The actual path taken by a particle between two points 1 and 2 in a time interval \(t_1\) to \(t_2\) is such that the action \(S = \int \mathcal{L}dt\) is stationary.

At this point we should check that we can recover Newtonian mechanics from Lagrangian mechanics if we assume an inertial reference frame:

\[\begin{align*} \frac{\partial\mathcal{L}}{\partial x} &= \frac{\partial U}{\partial x} = F_x \\ \frac{\partial\mathcal{L}}{\partial \dot{x}} &= \frac{\partial T}{\partial \dot{x}} = m\dot{x} = p_x \\ \text{From Newton's second law we know } F_x &= \frac{dp_x}{dt} \\ &= \frac{d}{dt}\left(\frac{\partial\mathcal{L}}{\partial \dot{x}}\right) \\ \text{therefore, } \frac{\partial\mathcal{L}}{\partial x} &= \frac{d}{dt}\left(\frac{\partial\mathcal{L}}{\partial \dot{x}}\right) \end{align*}\]

Therefore, the minimal action path as found by the Euler-Lagrange equation recovers Newton’s second law in an inertial reference frame.

We would also recover directly the correct equations of motion by solving the Euler-Lagrange equation.

\[\begin{align*} \frac{\partial\mathcal{L}}{\partial x} &= \frac{\partial U}{\partial x} = F_x \\ \frac{d}{dt}\left(\frac{\partial\mathcal{L}}{\partial \dot{x}}\right) &= \frac{d}{dt} m\dot{x} = m\ddot{x} \\ m\ddot{x} &= F_x \end{align*}\]