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] = \int L(x, y, y')\, dx \) with \( y(x_0) = y_0 \), \( y(x_1) = y_1 \). Necessary condition — Euler–Lagrange: \( L_y - \frac{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.

What you can do on this page

On this page you can expand the plot to full screen, drag boundary points A and B, zoom with the mouse wheel, and save a PNG.