Back to the on-screen lesson ·
Stationary integrals and the Euler–Lagrange equation, first integrals, Fermat's principle and Snell's law, the brachistochrone, and the catenary.
Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.
By the end of this lesson you will be able to derive and apply the Euler–Lagrange equation, use first integrals, and solve the shortest-path, refraction and brachistochrone problems.
You can find where a function has a minimum by setting its derivative to zero, and you can integrate by parts. From the last unit you know that energy methods can answer mechanical questions without solving for the motion in time. This lesson asks a larger question: not which number makes a function smallest, but which whole curve makes an integral smallest. Its answer, the Euler–Lagrange equation, is the foundation of the rest of the course.
| Term | What it means |
|---|---|
| Functional | A rule that takes a whole function and returns a number, such as $S[y] = \int f(y, y', x)\,dx$. |
| Variation | A small change of path $\epsilon\eta(x)$ that leaves the endpoints fixed, so $\eta = 0$ at both ends. |
| Stationary path | A path for which $S$ does not change to first order in $\epsilon$. |
| Euler–Lagrange equation | $\dfrac{\partial f}{\partial y} - \dfrac{d}{dx}\dfrac{\partial f}{\partial y'} = 0$, the condition for a stationary path. |
| First integral | A quantity the equation keeps constant, such as $f - y'\partial f/\partial y'$ when $f$ has no $x$. |
| Brachistochrone | The curve of fastest descent under gravity: a cycloid. |
| Fermat's principle | Light takes a path of stationary travel time. |
Suppose a quantity is an integral along a path $y(x)$ between fixed endpoints,
$$S = \int_{x_1}^{x_2}f(y, y', x)\,dx.$$
To find the path that makes $S$ smallest, compare it with every nearby path $Y = y + \epsilon\eta(x)$, where $\eta$ vanishes at both ends. For the right $y$, $S$ must not change to first order in $\epsilon$: $dS/d\epsilon = 0$ at $\epsilon = 0$. Differentiating under the integral and integrating the $\eta'$ term by parts gives
$$\frac{dS}{d\epsilon} = \int_{x_1}^{x_2}\eta(x)\left(\frac{\partial f}{\partial y} - \frac{d}{dx}\frac{\partial f}{\partial y'}\right)dx = 0.$$
Since this holds for every $\eta$, the bracket itself must vanish at every $x$:
$$\frac{\partial f}{\partial y} - \frac{d}{dx}\frac{\partial f}{\partial y'} = 0,$$
the Euler–Lagrange equation, a differential equation for the best path. In the partial derivatives, $y$ and $y'$ are treated as independent variables of $f$.
Another way: picture
Lay a rope between two posts and imagine nudging it into slightly different shapes. For most shapes, a small nudge changes the length by an amount proportional to the nudge. For the one best shape, the straight line, a small nudge changes the length only by the nudge squared: the length is flat to first order there, like a function at the bottom of a valley. The Euler–Lagrange equation finds the shape where every possible nudge is flat.
Another way: steps
Write $S(\epsilon) = \int f(y + \epsilon\eta, y' + \epsilon\eta', x)\,dx$. Differentiating with the chain rule, $dS/d\epsilon = \int(\eta\,\partial f/\partial y + \eta'\,\partial f/\partial y')\,dx$. The second term has $\eta'$ in it, and integration by parts moves the derivative off $\eta$: $\int\eta'\,\partial f/\partial y'\,dx = [\eta\,\partial f/\partial y']_{x_1}^{x_2} - \int\eta\frac{d}{dx}\partial f/\partial y'\,dx$.
The boundary term vanishes because $\eta$ is zero at both fixed endpoints. What is left is the integral of $\eta$ times the bracket. The final step is a lemma: if $\int\eta g\,dx = 0$ for every smooth $\eta$ that vanishes at the ends, then $g = 0$ everywhere, since otherwise we could choose $\eta$ to be positive just where $g$ is positive and make the integral positive. That is all the proof there is.
Two special cases halve the work. If $f$ does not contain $y$, the equation says $\frac{d}{dx}\partial f/\partial y' = 0$, so $\partial f/\partial y'$ is constant. The shortest path is this case, and the constant slope follows at once.
If $f$ does not contain $x$ explicitly, then the combination $f - y'\,\partial f/\partial y'$ is constant, the Beltrami identity. It can be checked by differentiating it with respect to $x$ and using the Euler–Lagrange equation. The brachistochrone and the soap film are this case. In mechanics, where the variable is time, these become the two great conservation laws: a missing coordinate gives a conserved momentum, and a missing time gives conserved energy, as the lesson after next shows.
In 1662 Pierre de Fermat proposed that light travels between two points along the path of least time. In a medium of index $n$, light moves at $c/n$, so the time is $\frac{1}{c}\int n\,ds$. For a ray crossing a flat boundary between two uniform media, only the crossing point is free, and setting the derivative of the time to zero gives Snell's law, $n_1\sin\theta_1 = n_2\sin\theta_2$.
In a medium whose index varies smoothly, such as air warmer near hot pavement, the Euler–Lagrange equation with $f = n(y)\sqrt{1 + y'^2}$ gives a curved ray. Its first integral, $n\cos\theta$ constant, bends light rays upward over a hot Arizona highway, so the sky appears on the road as a shimmering pool: a mirage. The same equation designs graded-index optical fibers, which keep light near their axis.
The figure compares the two tracks. The cycloid drops steeply at first, so the bead gains speed early, and that head start outweighs its longer path.
In 1696 Johann Bernoulli challenged the mathematicians of Europe to find the curve down which a bead slides fastest between two points. With $y$ measured downward from the start, the speed is $\sqrt{2gy}$ and the time is $\int\sqrt{1 + y'^2}/\sqrt{2gy}\,dx$. It is easier to treat $x$ as a function of $y$; then $f = \sqrt{(1 + x'^2)/y}$ does not contain $x$, and $\partial f/\partial x' = $ constant gives $x' = \sqrt{y/(2a - y)}$.
Substituting $y = a(1 - \cos\theta)$ integrates this to $x = a(\theta - \sin\theta)$: a cycloid, the curve traced by a point on the rim of a rolling wheel. Newton solved the challenge in one evening. The cycloid starts vertically, so the bead gains speed at once, and that early speed more than pays for the longer path. It is also a tautochrone: from any starting point on it, a bead reaches the bottom in the same time.
A soap film stretched between two coaxial rings takes the shape of least area. The area of a surface of revolution is $2\pi\int y\sqrt{1 + y'^2}\,dx$, and since $f$ has no $x$, the Beltrami identity gives $y/\sqrt{1 + y'^2} = c$. Its solution is the catenary, $y = c\cosh((x - b)/c)$, and the surface is a catenoid.
A chain hanging under gravity minimizes its potential energy $\int y\,ds$ at fixed length, which gives the same integrand, and so a hanging chain is also a catenary. Turned upside down, it becomes an arch in pure compression: the Gateway Arch in St. Louis is a weighted catenary, chosen because an arch of that shape carries its own weight with no bending, the same variational problem solved in steel.
A path in space has several coordinates, $x(t), y(t), z(t)$, and the integral $S = \int f(x, y, z, \dot{x}, \dot{y}, \dot{z}, t)\,dt$ can be varied in each one separately. The same argument gives one Euler–Lagrange equation for each: $\partial f/\partial x = \frac{d}{dt}\partial f/\partial\dot{x}$, and likewise for $y$ and $z$.
The integration variable need not be position; in mechanics it will be time, and the unknowns will be the coordinates of a system. That is the step to Lagrangian mechanics: nature makes a particular integral, the action $\int(T - U)\,dt$, stationary, and its Euler–Lagrange equations are Newton's laws. Everything in this lesson carries over, including the first integrals.
Checking an answer. The solution must pass through both endpoints. It must satisfy the Euler–Lagrange equation when substituted back. It must be sensible: the shortest path in a plane is straight, and a light ray bends toward higher index. And the value of $S$ on your path should be smaller than on a simple trial path, such as a straight line, for a minimum problem.
A water park slide shaped as a cycloid gets riders from the top to the bottom faster than any other shape between the same two points, ignoring friction and water drag. For a drop of $10$ m, the cycloid takes $\pi\sqrt{5/9.8} = 2.24$ s; a straight ramp between the same endpoints takes $3.72\sqrt{5/9.8} = 2.66$ s, about sixteen percent longer, even though it is the shortest path.
Real slides also have friction and must keep riders on the surface, so their shapes are compromises, but the lesson of the brachistochrone shows in them: a steep start to build speed early, then a gentler run. Skate parks use the same idea in ramp design, and engineers use the calculus of variations for far more consequential curves, such as the trajectories NASA computes to send a spacecraft to Mars with the least fuel.
On a hot day, the air just above an asphalt road in Arizona can be $20$ °C warmer than the air a meter higher. Warmer air is less dense and has a slightly lower refractive index, about $1.000\,26$ against $1.000\,29$. By Fermat's principle, light from the sky heading down toward the road takes the path of least time, which curves back upward through the faster, hot air near the ground.
The first integral $n\cos\theta = \text{const}$ decides how much a ray bends. A ray from the sky arriving at a shallow angle turns before it reaches the road and enters a driver's eye from below the horizon, so the brain sees sky where the road should be: a shimmering pool that recedes as the car approaches. The same physics over the cold sea produces superior mirages that lift ships above the horizon, and it is used in the graded-index fibers that carry the internet between American cities.
The Euler–Lagrange equation says only that $S$ does not change to first order. That is true at a minimum, but also at a maximum or a saddle, just as $f'(x) = 0$ is. Great circles on a sphere are stationary paths between two points, and the long way round a great circle is not the shortest route. Whether the stationary path is a minimum takes a second-order check, which the problems in this course rarely need.
A second error is to hold $y'$ fixed when differentiating with respect to $x$ in $\frac{d}{dx}\partial f/\partial y'$. That derivative is total: it follows the path, so $y$ and $y'$ both change with $x$.
Write the length of a curve from $(x_1, y_1)$ to $(x_2, y_2)$.
$L = \displaystyle\int_{x_1}^{x_2}\sqrt{1 + y'^2}\,dx$
$ds = \sqrt{dx^2 + dy^2}$.
Take the partial derivative with respect to $y$.
$\dfrac{\partial f}{\partial y} = 0$
No $y$ in the integrand.
Take the partial derivative with respect to $y'$.
$\dfrac{\partial f}{\partial y'} = \dfrac{y'}{\sqrt{1 + y'^2}}$
The chain rule.
Integrate the Euler–Lagrange equation once.
$\dfrac{y'}{\sqrt{1 + y'^2}} = C \Rightarrow y' = m$
A function of $y'$ that is constant forces $y'$ to be constant.
Integrate for the path.
$y = mx + b$
A straight line through the endpoints.
Light goes from $A$, a height $a$ above a flat boundary, to $B$, a depth $b$ below it and a horizontal distance $d$ along. Let it cross at $x$.
$L_1 = \sqrt{a^2 + x^2}, \quad L_2 = \sqrt{b^2 + (d - x)^2}$
The two straight legs; in a uniform medium light goes straight.
Write the travel time.
$t = \dfrac{n_1L_1 + n_2L_2}{c}$
Speed $c/n$ in each medium.
Differentiate with respect to the crossing point.
$\dfrac{dt}{dx} = \dfrac{1}{c}\left(\dfrac{n_1x}{L_1} - \dfrac{n_2(d - x)}{L_2}\right)$
The chain rule on each root.
Identify the angles from the normal.
$\dfrac{x}{L_1} = \sin\theta_1, \quad \dfrac{d - x}{L_2} = \sin\theta_2$
Opposite over hypotenuse in each triangle.
Set the derivative to zero.
$n_1\sin\theta_1 = n_2\sin\theta_2$
Snell's law, from stationary time.
Measure $y$ down from the start and write the speed after falling $y$.
$v = \sqrt{2gy}$
Energy conservation from rest, with no friction.
Write the descent time with $x$ as a function of $y$.
$t = \displaystyle\int\frac{ds}{v} = \frac{1}{\sqrt{2g}}\int\sqrt{\frac{1 + x'^2}{y}}\,dy$
$ds = \sqrt{1 + x'^2}\,dy$.
Notice that $x$ itself is missing.
$\dfrac{\partial f}{\partial x} = 0 \Rightarrow \dfrac{\partial f}{\partial x'} = \dfrac{x'}{\sqrt{y(1 + x'^2)}} = \text{const}$
A first integral.
Name the constant and solve for the slope.
$\dfrac{x'^2}{y(1 + x'^2)} = \dfrac{1}{2a} \Rightarrow x' = \sqrt{\dfrac{y}{2a - y}}$
Square and rearrange.
Substitute a parameter for the height.
$y = a(1 - \cos\theta), \quad dy = a\sin\theta\,d\theta$
It makes the root simplify.
Integrate for the horizontal position.
$x = \displaystyle\int a(1 - \cos\theta)\,d\theta = a(\theta - \sin\theta)$
Using $\sqrt{y/(2a - y)} = \tan(\theta/2)$.
Identify the curve.
$x = a(\theta - \sin\theta), \quad y = a(1 - \cos\theta)$
A cycloid starting at a cusp, with $a$ fixed by the end point.
Find the partial derivative with respect to $y$.
$\dfrac{\partial f}{\partial y} = -18y$
Differentiate $-9y^2$.
Find the partial derivative with respect to $y'$.
$\dfrac{\partial f}{\partial y'} = 2y'$
Differentiate $y'^2$.
Form the Euler–Lagrange equation.
The length of a curve $y(x)$ in the plane from $x = 0$ to $x = 8$ is $\int\sqrt{1 + y'^2}\,dx$. What does the Euler–Lagrange equation say the shortest curve is?
Complete the worked solution: the shortest curve from $(0, 1)$ to $(8, 16)$ in the plane is the straight line the Euler–Lagrange equation gives. Find its slope, its length, and its height $y$ at $x = 4$.
Divide the rise by the run.
$m =$ m
The constant slope the Euler–Lagrange equation requires.
Evaluate the arc-length integral along the line.
$\displaystyle\int\sqrt{1 + m^2}\,dx = \sqrt{\text{run}^2 + \text{rise}^2} =$ l
The integrand is constant on a line.
Add half the rise to the starting height.
$y(\text{midpoint}) =$ y
Halfway along a straight line is halfway up.
Check the length against any other path.
$\text{any bent path} > \text{the straight length}$
Here the stationary path is a true minimum.
Match each problem to the integrand $f$ whose integral is made stationary.
| $\sqrt{1 + y'^2}$ | $\sqrt{(1 + y'^2)/y}$ | $y\sqrt{1 + y'^2}$ | $n\sqrt{1 + y'^2}$ | |
|---|---|---|---|---|
| shortest path | ||||
| fastest slide | ||||
| least surface of revolution | ||||
| path of light |
Take $f(y, y') = y'^2 + 4y^2$. At a point on a trial curve where $y = 4$ and $y' = 2$, fill in $\partial f/\partial y$, $\partial f/\partial y'$, and the value of $y''$ the Euler–Lagrange equation requires there.
| value | |
|---|---|
| $\partial f/\partial y$ | |
| $\partial f/\partial y'$ | |
| required $y''$ |
Find the curve $y(x)$ with $y(0) = 0$ and $y(1) = 0$ that makes $\int_0^{1}\left(y'^2 + 4y\right)dx$ stationary. Write $y$ as a formula in $x$.
Answer:
Light travels from air ($n = 1$) into a medium of index $1.6$. The sine of its angle of incidence is $0.7$. By Fermat's principle, what is the sine of its angle of refraction?
Answer: sine of the refracted angle
A designer at a Texas water park shapes a frictionless slide as a cycloid, the brachistochrone, dropping $30$ m from its start at rest to its lowest point. How long does the descent take, in seconds, with $g = 9.8$ m/s²?
Answer: s down the cycloid
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
Find the curve $y(x)$ with $y(0) = 0$ and $y(1) = 0$ that makes $\int_0^{1}\left(y'^2 + 16y\right)dx$ stationary. Write $y$ as a formula in $x$.
Answer:
You can use the calculus of variations. Explain to someone why the fastest slide between two points is not the straight one.
18. Your turn: find the Euler–Lagrange equation for $f = y'^2 - 9y^2$., step 3
$-18y - 2y'' = 0 \Rightarrow y'' = -9y$
Simple harmonic, with solutions $\sin 3x$ and $\cos 3x$.