Module I·Article I·~5 min read

Functionals and the Euler–Lagrange Equation

Calculus of Variations

Turn this article into a podcast

Pick voices, format, length — AI generates the audio

Imagine stretching a rope between two nails: what shape will it take? Or: along which curve will a ball slide down in minimal time? In standard differential calculus, we seek a number $x$ that minimizes a function $f(x)$. Here, the unknown is an entire function $y(x)$, and we seek to minimize the “sum” (integral) of its properties. This is the domain of the calculus of variations—a theory of extrema for functionals, mappings from a space of functions to $\mathbb{R}$. Many fundamental laws of physics (the principle of least action in mechanics, Fermat’s principle in optics) are conditions of stationarity for functionals; thus, the language of the calculus of variations is the language in which nature “states” its laws.

Statement of a Variational Calculus Problem

Problem: Find a function $y(x)$ on the interval $[a, b]$ which minimizes the functional $J[y] = \int_a^b F(x, y, y'),dx$ under boundary conditions $y(a) = y_a$, $y(b) = y_b$.

Let us clarify the notation. $F(x, y, y')$ is the Lagrangian, the “density” of the quantity of interest: for example, arc length, travel time, or action. $x$ is the independent variable (often position or time), $y$ is the sought function, $y' = dy/dx$ is its derivative. The integral $J[y]$ sums the contribution from each point along the trajectory.

In physics, typically $F = T − V$ (kinetic energy minus potential energy), and $J$ is called the action. In optics, $F = n(x, y)\sqrt{1 + y'^2}$, where $n$ is the refractive index, and $J$ is the optical path.

Variation of a functional. To understand which $y$ minimizes $J$, we consider a “perturbed” family $y_\varepsilon(x) = y(x) + \varepsilon\cdot\eta(x)$, where $\eta$ is any function vanishing at the endpoints: $\eta(a) = \eta(b) = 0$ (the boundary conditions are fixed). We obtain a numerical function $J(\varepsilon) = \int_a^b F(x, y_\varepsilon, y_\varepsilon'),dx$, and from the extremum condition $dJ/d\varepsilon|_{\varepsilon=0} = 0$ for any $\eta$ we derive an equation for $y$.

Euler–Lagrange Equation

After differentiating with respect to $\varepsilon$ and integrating by parts, we get:

$ \int_a^b \left[\frac{\partial F}{\partial y} - \frac{d}{dx}\left(\frac{\partial F}{\partial y'}\right)\right] \eta(x),dx = 0 \quad \text{ for all admissible } \eta. $

By the Du Bois-Reymond lemma, the integrand is identically zero, and we obtain the Euler–Lagrange equation:

$\frac{\partial F}{\partial y} - \frac{d}{dx}\left(\frac{\partial F}{\partial y'}\right) = 0$.

This is a second-order ordinary differential equation for $y(x)$. Here, $\frac{\partial F}{\partial y}$ is the partial derivative of the Lagrangian with respect to $y$, holding $x$ and $y'$ fixed, and $d/dx(\frac{\partial F}{\partial y'})$ is the total derivative with respect to $x$ of $\frac{\partial F}{\partial y'}$ (with $y(x), y'(x)$ substituted).

Classic Examples

1. Shortest Path (Geodesic on the Plane). $F = \sqrt{1 + y'^2}$ is the element of arc length. The Lagrangian does not depend on $y$, so $\frac{\partial F}{\partial y} = 0$ and $\frac{d}{dx}(\frac{\partial F}{\partial y'}) = 0$, that is, $\frac{\partial F}{\partial y'} = \text{const}$. Thus, $y' = \text{const}$, $y = ax + b$—a straight line. For example, between the points $(0, 0)$ and $(3, 4)$, the shortest path of length $5$ is the segment of the straight line.

2. Brachistochrone. Find the curve along which a ball slides from $(0, 0)$ to $(a, b)$ in minimal time. By the law of conservation of energy, the speed $v = \sqrt{2gy}$, so the time $T = \int ds / v = \int \sqrt{\frac{1 + y'^2}{2gy}},dx$. The solution is a cycloid: $x = r(\theta - \sin\theta)$, $y = r(1 - \cos\theta)$. An amazing fact: the brachistochrone is faster than the straight inclined line, even though its length is greater.

3. Isoperimetric Problem. Among closed curves of length $L$, find one that encloses the maximal area. Using a Lagrange multiplier $\lambda$ for the constraint $\int ds = L$ leads to an equation whose solution is a circle of radius $L/(2\pi)$.

Numerical Example: Minimizing $\int_0^1 (y^2 + y'^2),dx$, $y(0) = 1$, $y(1) = 0$

$F = y^2 + y'^2$. $\frac{\partial F}{\partial y} = 2y$, $\frac{\partial F}{\partial y'} = 2y'$, $d/dx(\frac{\partial F}{\partial y'}) = 2y''$. Euler–Lagrange: $2y - 2y'' = 0 \rightarrow y'' = y$. General solution: $y = C_1 e^x + C_2 e^{-x}$. Boundary conditions: $C_1 + C_2 = 1$, $C_1 e + C_2/e = 0 \rightarrow C_1 = -1/(e^2 - 1)$, $C_2 = e^2/(e^2 - 1)$. Substituting into $J$ gives $J^* \approx 0.762$, which is less than $J = \int(1 - x)^2 + 1,dx = 4/3 \approx 1.333$ for the linear $y = 1 - x$.

Extensions

Several functions. If $y = (y_1, \ldots, y_n)$, then for each $y_i$ we write its own equation: $\frac{\partial F}{\partial y_i} - \frac{d}{dx}\left(\frac{\partial F}{\partial y_i'}\right) = 0$—the Euler–Lagrange system.

Higher derivatives. For $\int F(x, y, y', y''),dx$ the Euler–Poisson equation is: $\frac{\partial F}{\partial y} - \frac{d}{dx}\left(\frac{\partial F}{\partial y'}\right) + \frac{d^2}{dx^2}\left(\frac{\partial F}{\partial y''}\right) = 0$. This is used in the theory of elastic beams (Euler–Bernoulli beam).

Real Applications

  • Architecture and Engineering. The shape of arches and suspension bridges arises from minimizing potential energy—the catenary $y = a\cdot\cosh(x/a)$. The Golden Gate suspension bridge, cathedral arches are designed according to such curves.
  • Optics. Fermat’s principle gives the laws of reflection and refraction. All geometric optics is a consequence of the variational principle.
  • Machine Learning. Model training reduces to minimization of an error functional—this is a “discrete” counterpart of the variational problem. Regularization (e.g., Tikhonov) adds a penalty term $\int (y')^2 dx$ to the functional to obtain smooth solutions.
  • Finance. Optimal trajectories of consumption and investment (the Merton model) are found as extrema of the respective expected utility functional.

Exercise: (a) Find the curve of minimal surface of revolution (catenoid) between $y(x_1) = y_1$, $y(x_2) = y_2$. $F = 2\pi y\sqrt{1 + y'^2}$. Write down the EL equation and show that the solution is $y = a\cdot\cosh((x - b)/a)$. (b) Dido’s problem: $\max \int y,dx$ under $\int \sqrt{1 + y'^2},dx = L$, $y(0) = y(L) = 0$. Find the curve’s shape (a semicircle).

§ Act · what next