← Back to GATE Mathematics

Calculus of Variations

Functionals, the Euler-Lagrange equation, isoperimetric problems, the brachistochrone, and Lagrangian mechanics — with complete derivations, classic worked examples, and interactive practice.

Functionals & Extrema Euler-Lagrange Equation Isoperimetric Problems Brachistochrone Problem Hamilton's Principle
0 / 5 units completed0%
01
Functionals & Their Extrema

While ordinary calculus finds extrema of functions (numbers in, numbers out), the calculus of variations finds extrema of functionals — mappings that take entire functions as input and return a single number.

What is a Functional?
Definition — Functional A functional is a mapping $J: \mathcal{A} \to \mathbb{R}$ where $\mathcal{A}$ is a set of functions. The most common form is: $$J[y] = \int_a^b F\!\left(x, y(x), y'(x)\right) dx$$ where $y \in C^1[a,b]$ satisfies given boundary conditions $y(a) = A$, $y(b) = B$, and $F$ is a smooth function of three variables called the Lagrangian (or integrand).
Definition — First Variation The first variation of $J$ at $y$ in the direction $\eta$ (where $\eta(a) = \eta(b) = 0$) is: $$\delta J[y; \eta] = \lim_{\varepsilon \to 0} \frac{J[y + \varepsilon \eta] - J[y]}{\varepsilon} = \frac{d}{d\varepsilon}\bigg|_{\varepsilon=0} J[y + \varepsilon \eta].$$ A necessary condition for $y$ to be an extremum is $\delta J[y; \eta] = 0$ for all admissible $\eta$.
★ Example — Arc Length Functional
The arc length of $y(x)$ from $(a, y(a))$ to $(b, y(b))$ is the functional: $$J[y] = \int_a^b \sqrt{1 + (y')^2}\, dx.$$ Finding the curve of shortest length between two points is one of the oldest variational problems.
Preview: The Euler-Lagrange equation for this functional yields a straight line — as expected from Euclidean geometry. We shall derive this in Unit 2.
02
Euler-Lagrange Equation

The Euler-Lagrange equation is the fundamental necessary condition for an extremum of a functional. It is the variational analogue of setting a derivative to zero.

Derivation
Theorem — Euler-Lagrange Equation If $y \in C^2[a,b]$ is an extremum of $J[y] = \int_a^b F(x, y, y')\,dx$ subject to $y(a) = A$, $y(b) = B$, then $y$ satisfies: $$\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'} = 0.$$

Derivation sketch: Let $\eta \in C^2[a,b]$ with $\eta(a) = \eta(b) = 0$. Compute $\delta J = \int_a^b \left[\frac{\partial F}{\partial y}\eta + \frac{\partial F}{\partial y'}\eta'\right]dx$. Integrate the second term by parts: $$\delta J = \left[\frac{\partial F}{\partial y'}\eta\right]_a^b + \int_a^b \left[\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'}\right]\eta\,dx.$$ The boundary term vanishes since $\eta(a) = \eta(b) = 0$. By the fundamental lemma of calculus of variations, the integrand must be identically zero.

Beltrami Identity When $F$ does not explicitly depend on $x$ (i.e., $\frac{\partial F}{\partial x} = 0$), the Euler-Lagrange equation has a first integral: $$F - y'\frac{\partial F}{\partial y'} = C \quad (\text{constant}).$$
Worked Examples
★ Example — Shortest Path (Geodesic)
Find the curve $y(x)$ of minimum arc length between $(0, 0)$ and $(1, 1)$.
Solution: The functional is $J[y] = \int_0^1 \sqrt{1 + (y')^2}\,dx$. Here $F = \sqrt{1 + (y')^2}$. We compute: $$\frac{\partial F}{\partial y} = 0, \quad \frac{\partial F}{\partial y'} = \frac{y'}{\sqrt{1+(y')^2}}.$$ The Euler-Lagrange equation gives $\frac{d}{dx}\frac{y'}{\sqrt{1+(y')^2}} = 0$, so $\frac{y'}{\sqrt{1+(y')^2}} = c$ (constant). Solving: $y' = \text{const}$, hence $y = mx + b$. With $y(0) = 0$, $y(1) = 1$: $y(x) = x$. The shortest path is a straight line.
★ Example — Minimal Surface of Revolution
Find the curve $y(x) > 0$ between $(x_0, y_0)$ and $(x_1, y_1)$ that, when revolved about the $x$-axis, generates the surface of least area.
Solution: The surface area is $J[y] = 2\pi \int_{x_0}^{x_1} y\sqrt{1+(y')^2}\,dx$. Here $F = y\sqrt{1+(y')^2}$ does not depend explicitly on $x$, so we use the Beltrami identity: $$y\sqrt{1+(y')^2} - y' \cdot \frac{y \cdot y'}{\sqrt{1+(y')^2}} = c.$$ Simplifying: $\frac{y}{\sqrt{1+(y')^2}} = c$, which gives $y'^2 = \frac{y^2}{c^2} - 1$. The solution is a catenary: $$y(x) = c \cosh\!\left(\frac{x - d}{c}\right)$$ where $c$ and $d$ are determined by the boundary conditions. The resulting surface is a catenoid.
03
Isoperimetric Problems

Isoperimetric problems seek to optimise one functional subject to a constraint on another — the classical example being to find the curve of fixed perimeter enclosing maximum area.

Method of Lagrange Multipliers for Functionals
Theorem — Isoperimetric Condition To extremise $J[y] = \int_a^b F(x,y,y')\,dx$ subject to the constraint $K[y] = \int_a^b G(x,y,y')\,dx = \ell$ (a given constant), form the augmented Lagrangian: $$H = F + \lambda G$$ where $\lambda$ is a Lagrange multiplier. The extremal $y$ satisfies the Euler-Lagrange equation for $H$: $$\frac{\partial H}{\partial y} - \frac{d}{dx}\frac{\partial H}{\partial y'} = 0.$$
★ Example — Classical Isoperimetric Problem
Among all simple closed curves of perimeter $L$ in the plane, find the one enclosing the maximum area.
Solution: Parametrise the curve as $(x(t), y(t))$ for $t \in [0, 2\pi]$. The area is $A = \frac{1}{2}\oint (x\,dy - y\,dx)$ and the perimeter is $P = \oint \sqrt{(\dot{x})^2 + (\dot{y})^2}\,dt = L$. Applying the isoperimetric method leads to the Euler-Lagrange equations: $$\dot{x}^2 + \dot{y}^2 = \text{const}, \quad \text{curvature} = \frac{1}{\lambda} = \text{const}.$$ A curve of constant curvature is a circle. The circle of circumference $L$ has radius $r = L/(2\pi)$ and encloses area $A = L^2/(4\pi)$.
Dido's Problem
★ Example — Dido's Problem
Find the curve $y(x) \ge 0$ from $(0,0)$ to $(a, 0)$ of fixed length $\ell > a$ that encloses the maximum area with the $x$-axis.
Solution: Maximise $J[y] = \int_0^a y\,dx$ subject to $K[y] = \int_0^a \sqrt{1+(y')^2}\,dx = \ell$. The augmented integrand is $H = y + \lambda\sqrt{1+(y')^2}$. The Euler-Lagrange equation gives: $$1 - \lambda\frac{d}{dx}\frac{y'}{\sqrt{1+(y')^2}} = 0 \implies \frac{y'}{\sqrt{1+(y')^2}} = \frac{x - c_1}{\lambda}.$$ Solving yields $(x - c_1)^2 + (y - c_2)^2 = \lambda^2$, a circular arc. The constants are determined by the boundary conditions and the length constraint.
04
Brachistochrone Problem

The brachistochrone (from Greek: "shortest time") asks for the curve of fastest descent under gravity — one of the most celebrated problems in mathematics, posed by Johann Bernoulli in 1696.

Problem Formulation and Solution
Problem Statement A bead slides frictionlessly under gravity along a wire from point $A = (0,0)$ to point $B = (x_1, y_1)$ (with $y$ measured downward). Find the shape of the wire that minimises the travel time.

By conservation of energy, the speed at height $y$ is $v = \sqrt{2gy}$. The time functional is:

$$T[y] = \int_0^{x_1} \frac{\sqrt{1 + (y')^2}}{\sqrt{2gy}}\,dx = \int_0^{x_1} \sqrt{\frac{1+(y')^2}{2gy}}\,dx.$$

Solution — Cycloid The integrand $F = \sqrt{\frac{1+(y')^2}{2gy}}$ does not depend explicitly on $x$. Using the Beltrami identity: $$\frac{1}{\sqrt{2gy(1+(y')^2)}} = c.$$ This simplifies to $y(1 + (y')^2) = \frac{1}{2gc^2} = 2a$ (constant). The parametric solution is: $$x = a(\theta - \sin\theta), \quad y = a(1 - \cos\theta)$$ which is a cycloid — the curve traced by a point on the rim of a rolling circle of radius $a$.
★ Example
Verify that the cycloid $x = a(\theta - \sin\theta)$, $y = a(1-\cos\theta)$ satisfies $y(1+(y')^2) = 2a$.
Solution: Compute $\frac{dy}{dx} = \frac{dy/d\theta}{dx/d\theta} = \frac{a\sin\theta}{a(1-\cos\theta)} = \frac{\sin\theta}{1-\cos\theta}$. Then: $$1 + (y')^2 = 1 + \frac{\sin^2\theta}{(1-\cos\theta)^2} = \frac{(1-\cos\theta)^2 + \sin^2\theta}{(1-\cos\theta)^2} = \frac{2(1-\cos\theta)}{(1-\cos\theta)^2} = \frac{2}{1-\cos\theta}.$$ So $y(1+(y')^2) = a(1-\cos\theta) \cdot \frac{2}{1-\cos\theta} = 2a$. Verified.
05
Hamilton's Principle & Lagrangian Mechanics

Hamilton's principle is the variational foundation of classical mechanics: the true trajectory of a mechanical system extremises the action integral.

Hamilton's Principle
Definition — Action and Lagrangian The Lagrangian of a mechanical system is $L = T - V$ where $T$ is kinetic energy and $V$ is potential energy. The action is the functional: $$S[q] = \int_{t_1}^{t_2} L\!\left(q(t), \dot{q}(t), t\right) dt$$ where $q(t) = (q_1(t), \dots, q_n(t))$ are generalised coordinates.
Hamilton's Principle (Principle of Least Action) The actual motion of a mechanical system from time $t_1$ to $t_2$ is the path $q(t)$ (with fixed endpoints) that makes the action $S[q]$ stationary. The resulting equations of motion are the Euler-Lagrange equations: $$\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_i} - \frac{\partial L}{\partial q_i} = 0, \quad i = 1, \dots, n.$$
Examples in Mechanics
★ Example — Free Particle
Derive Newton's first law from Hamilton's principle for a free particle of mass $m$.
Solution: For a free particle, $T = \frac{1}{2}m\dot{x}^2$ and $V = 0$, so $L = \frac{1}{2}m\dot{x}^2$. The Euler-Lagrange equation gives: $$\frac{d}{dt}\frac{\partial L}{\partial \dot{x}} - \frac{\partial L}{\partial x} = \frac{d}{dt}(m\dot{x}) - 0 = m\ddot{x} = 0.$$ Hence $\ddot{x} = 0$, i.e., $x(t) = at + b$ — uniform motion in a straight line (Newton's first law).
★ Example — Simple Harmonic Oscillator
Derive the equation of motion for a mass $m$ on a spring with constant $k$.
Solution: $T = \frac{1}{2}m\dot{x}^2$, $V = \frac{1}{2}kx^2$, so $L = \frac{1}{2}m\dot{x}^2 - \frac{1}{2}kx^2$. The Euler-Lagrange equation: $$\frac{d}{dt}(m\dot{x}) - (-kx) = 0 \implies m\ddot{x} + kx = 0.$$ This is the SHM equation with solution $x(t) = A\cos(\omega t + \phi)$, where $\omega = \sqrt{k/m}$.
★ Example — Simple Pendulum
Derive the equation of motion for a simple pendulum of length $\ell$ and mass $m$.
Solution: Using the angle $\theta$ as generalised coordinate: $T = \frac{1}{2}m\ell^2\dot{\theta}^2$, $V = -mg\ell\cos\theta$ (measuring from the pivot). The Lagrangian is $L = \frac{1}{2}m\ell^2\dot{\theta}^2 + mg\ell\cos\theta$. The Euler-Lagrange equation: $$\frac{d}{dt}(m\ell^2\dot{\theta}) + mg\ell\sin\theta = 0 \implies \ddot{\theta} + \frac{g}{\ell}\sin\theta = 0.$$ For small oscillations, $\sin\theta \approx \theta$, giving SHM with period $T = 2\pi\sqrt{\ell/g}$.
★ Key Takeaways
✎ Practice Problems
Problem 1
Find the extremal of $J[y] = \int_0^1 (y'^2 + 2y)\,dx$ with $y(0) = 0$, $y(1) = 0$.
Show Solution ▼
Here $F = y'^2 + 2y$. The E-L equation: $\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'} = 2 - 2y'' = 0$, so $y'' = 1$. Integrating: $y = \frac{x^2}{2} + c_1 x + c_2$. From $y(0) = 0$: $c_2 = 0$. From $y(1) = 0$: $\frac{1}{2} + c_1 = 0$, so $c_1 = -\frac{1}{2}$. Answer: $y(x) = \frac{x^2 - x}{2}$.
Problem 2
Find the extremal of $J[y] = \int_1^2 \frac{\sqrt{1+(y')^2}}{x}\,dx$ with $y(1) = 0$, $y(2) = 1$.
Show Solution ▼
Here $F = \frac{\sqrt{1+(y')^2}}{x}$. Since $F$ depends on $x$ explicitly, we use the full E-L equation. $\frac{\partial F}{\partial y} = 0$, so $\frac{d}{dx}\frac{\partial F}{\partial y'} = 0$, giving $\frac{\partial F}{\partial y'} = \frac{y'}{x\sqrt{1+(y')^2}} = c$. Hence $y' = \frac{cx}{\sqrt{1-c^2x^2}}$, and integrating: $y = -\frac{1}{c}\sqrt{1-c^2x^2} + d$. Applying boundary conditions determines $c$ and $d$. The extremal is an arc of a circle.
Problem 3
Use the Beltrami identity to find the extremal of $J[y] = \int_0^{\pi} (y'^2 - y^2)\,dx$ with $y(0) = 0$, $y(\pi) = 0$.
Show Solution ▼
Here $F = y'^2 - y^2$ does not depend on $x$, but let us use the E-L equation directly: $\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'} = -2y - 2y'' = 0$, giving $y'' + y = 0$. Solution: $y = A\sin x + B\cos x$. From $y(0) = 0$: $B = 0$. From $y(\pi) = 0$: $A\sin\pi = 0$, which is satisfied for all $A$. The extremal is $y(x) = A\sin x$ for any constant $A$.
Problem 4
Among all curves $y(x)$ from $(0,0)$ to $(1,1)$ of length $\ell = 2$, find the curve that maximises the area $\int_0^1 y\,dx$ under the curve.
Show Solution ▼
Maximise $J = \int_0^1 y\,dx$ subject to $K = \int_0^1 \sqrt{1+(y')^2}\,dx = 2$. Form $H = y + \lambda\sqrt{1+(y')^2}$. The E-L equation gives $(x - c_1)^2 + (y - c_2)^2 = \lambda^2$ (a circular arc). The three constants $c_1, c_2, \lambda$ are determined from $y(0) = 0$, $y(1) = 1$, and the length constraint $\ell = 2$.
Problem 5
Using Hamilton's principle, derive the equations of motion for a particle of mass $m$ in a central force field $V(r)$, using polar coordinates $(r, \theta)$.
Show Solution ▼
In polar coordinates, $T = \frac{1}{2}m(\dot{r}^2 + r^2\dot{\theta}^2)$. The Lagrangian is $L = \frac{1}{2}m(\dot{r}^2 + r^2\dot{\theta}^2) - V(r)$. E-L for $r$: $m\ddot{r} - mr\dot{\theta}^2 + V'(r) = 0$. E-L for $\theta$: $\frac{d}{dt}(mr^2\dot{\theta}) = 0$, giving $mr^2\dot{\theta} = \ell$ (conservation of angular momentum). These are the standard central force equations.
🎯 Interactive Quiz
1. The Euler-Lagrange equation for $J[y] = \int_a^b F(x,y,y')\,dx$ is:
A $\frac{\partial F}{\partial y} + \frac{\partial F}{\partial y'} = 0$
B $\frac{\partial F}{\partial y} - \frac{d}{dx}\frac{\partial F}{\partial y'} = 0$
C $\frac{\partial F}{\partial y} + \frac{d}{dx}\frac{\partial F}{\partial y'} = 0$
D $\frac{\partial F}{\partial y} - \frac{d}{dy}\frac{\partial F}{\partial y'} = 0$
2. The solution to the brachistochrone problem (curve of fastest descent under gravity) is a:
A Straight line
B Parabola
C Cycloid
D Catenary
3. The Beltrami identity $F - y'\frac{\partial F}{\partial y'} = C$ applies when:
A $F$ does not depend on $y$
B $F$ does not depend explicitly on $x$
C $F$ does not depend on $y'$
D $F$ is linear in $y'$
4. Among all closed curves of fixed perimeter, the one enclosing maximum area is a:
A Square
B Ellipse
C Circle
D Equilateral triangle
5. In Hamilton's principle, the Lagrangian $L$ is defined as:
A $L = T - V$ (kinetic minus potential energy)
B $L = T + V$ (total energy)
C $L = V - T$
D $L = TV$ (product of energies)