Calculus of variations: brachistochrone and geodesics

Drag points A and B. Wheel — zoom. Functional J[y] = ∫ L(x, y, y') dx is solved via the Euler–Lagrange equation by shooting.

Drag the points with the mouse,
to change the boundary conditions.

Examples of functionals

The idea: We seek a curve y(x) minimizing J[y] = ∫ L(x, y, y') dx with y(x₀) = y₀, y(x₁) = y₁. Necessary condition — Euler–Lagrange: L_y − d/dx(L_y') = 0.

Lagrangian L(x, y, y')
Boundary conditions
Problem

Quick reference

The functional

\[ J[y] = \int_{x_0}^{x_1} L(x,y,y')\,dx \]

A necessary condition is the Euler–Lagrange equation. The brachistochrone has a cycloid as solution; planar geodesics are straight lines.

The brachistochrone problem and Euler–Lagrange online

The calculator finds an extremal of \(J[y]=\int L\,dx\) between two points: the curve of fastest descent and other presets.

Geodesics, a soap film, and a harmonic oscillator show how a minimum of an integral becomes an ODE for \(y(x)\). Export PNG.